Module VFrame


module VFrame: sig .. end

Video frame manipulation

This is a simplified video-only version of Frame. Some parts of Frame, such as the metadata API, is unavailable. This is because it must be used with care.

Even video-only operators must comply to the general requirements of sources in liquidsoap. In particular they should be able to fill a frame starting at any position. That position might not be a video position -- in that case, the first video sample to work on, if there is one, will be a little farther in the frame. When looking for metadata (usually attached at the beginning of a track) a video position cannot be used, for the same reason: the track might not start on a video sample position.


type t = Frame.t 
val is_partial : t -> bool
Is it partially filled ?
val size : 'a -> int
Number of video frames.
val position : t -> int
val next_sample_position : t -> int
Position (in video samples) of the next video sample to fill-in.
val add_break : t -> int -> unit
Add a break at given video position.
val get_content : Frame.t -> Source.source -> (Video.buffer array * int * int) option
get_content source frame has source fill frame, and returns the produced chunk of video content. It is possible that a successful filling produced audio samples but no video sample.
val content_of_type : channels:int -> t -> Video.buffer array
Create a new video-only content layer for channels video channels, at the current position in the frame, i.e., suitable for the next filling operation. To choose the position, use Frame directly, and be careful.