1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//! Timeline-facing real-time preview entry point.
//!
//! [`TimelinePlayer`] is the engine-level bridge from the editing model to the
//! primitive preview runner: it derives a [`Scene`](ff_preview::Scene) from a
//! [`Timeline`] and hands it to [`ff_preview::ScenePlayer`], which owns the
//! decode pipelines and audio mixer. The runner itself
//! ([`SceneRunner`](ff_preview::SceneRunner)) stays in `ff-preview` as a
//! model-agnostic `Scene` consumer.
use ;
use crateTimeline;
/// Thin builder for a ([`SceneRunner`], [`PlayerHandle`]) pair backed by a
/// [`Timeline`].
///
/// # Example
///
/// ```ignore
/// use avio::{Timeline, Clip, TimelinePlayer};
/// use ff_preview::RgbaSink;
/// use std::time::Duration;
///
/// let timeline = Timeline::builder()
/// .canvas(1920, 1080)
/// .frame_rate(30.0)
/// .video_track(vec![
/// Clip::new("intro.mp4").trim(Duration::ZERO, Duration::from_secs(5)),
/// ])
/// .build()?;
///
/// let (mut runner, handle) = TimelinePlayer::open(&timeline)?;
/// runner.set_sink(Box::new(RgbaSink::new()));
/// std::thread::spawn(move || { let _ = runner.run(); });
/// handle.play();
/// ```
;