module From_audio_video: sig
.. end
Generator that consumes audio and video asynchronously, and produces
frames.
type
t
type
mode = [ `Audio | `Both | `Undefined | `Video ]
In `Audio
mode, only audio can be put in the buffer, and similarly for
the `Video
mode. In `Both
mode, both types of content can be fed into
the generator, asynchronously, and they exit the buffer synchronously.
`Undefined
forbids any feeding, it's useful to make sure a meaningful
mode is assigned before any use.
val create : mode -> t
val mode : t -> mode
Current mode:
in Audio mode (resp. Video), only audio (resp. Audio) can be fed,
otherwise both have to be fed.
val set_mode : t -> mode -> unit
Change the generator mode.
Only allowed when there is as much audio as video.
val audio_length : t -> int
Audio length, in ticks.
val video_length : t -> int
Video length, in ticks.
val length : t -> int
Total length.
val remaining : t -> int
Duration of data (in ticks) before the next break, -1 if there's none.
val add_metadata : t -> Frame.metadata -> unit
Add metadata at the minimum position of audio and video.
You probably want to call this when there is as much
audio as video.
val add_break : ?sync:[ `Drop | `Ignore | `Strict ] -> t -> unit
Add a track limit. Audio and video length should be equal.
val put_audio : t -> Frame.audio_t array -> int -> int -> unit
Add some audio content. Offset and length are given in audio samples.
val put_video : t -> Frame.video_t array -> int -> int -> unit
Add some video content. Offset and length are given in video samples.
val fill : t -> Frame.t -> unit
val remove : t -> int -> unit
val clear : t -> unit