Page
Library
Module
Module type
Parameter
Class
Class type
Source
Ogg_decoder
SourceOgg stream demuxer
This module provides a functional abstract API to * decode and seek in Ogg streams. * * Decoders are also provided in ocaml-vorbis, * ocaml-speex, ocaml-schroedinger, ocaml-flac and * ocaml-theora. * * Functions in this module are not thread safe!
Type of an ogg stream decoder.
Type for callbacks used to acess encoded data.
Type for a decodable track. * First element is a string describing * the decoder used to decode the track. * Second element is the serial number * associated to the Ogg.Stream.stream
logical * stream used to pull data packets for that * track.
Type for standard tracks (see get_standard_tracks
below).
Type for metadata. First element * is a string describing the vendor, second * element is a list of metadata of the form: * (label,value)
.
Type for audio information.
Type for audio data.
Type of a video plane.
Supported video formats.
type video_data = {
format : video_format;
frame_width : int;
frame_height : int;
y_stride : int;
Length, in bytes, per line
*)uv_stride : int;
Length, in bytes, per line
*)y : video_plane;
luminance data
*)u : video_plane;
Cb data
*)v : video_plane;
Cr data
*)}
Type for video data.
Initiate a decoder with the given callbacks. * log
is an optional functioned used to * return logged messages during the deocding * process.
Initiate a decoder from a given file name.
Initate a decoder from a given Unix.file_descriptor
Get the Ogg.Sync handler associated to * the decoder. Use only if know what you are doing.
Reset encoder, try to parse a new sequentialized stream. * To use when end_of_stream has been reached.
Consume all remaining pages of the current * stream. This function may be called to skip * a sequentialized stream but it may be quite * CPU intensive if there are many pages remaining.. * * eos dec
is true
after this call.
true
if the decoder has reached the end of each * logical streams and all data has been decoded. * * If you do not plan on decoding some data, * you should use drop_track
to indicate it * to the decoder. Otherwise, eos
will return * false
until you have decoded all data.
Get the first available audio and * video tracks and drop the other one.
Update a given record of standard tracks. You should * use this after a reset
to update the standard tracks * with the newly created tracks.
Get informations about the * audio track.
Get informations about the * video track.
Get the sample_rate of the track * of that type. Returns a pair (numerator,denominator)
.
Seek to an absolute or relative position in seconds. * * Raises Not_available
if seeking is * not possible. * * Raises End_of_stream
if the end of * current stream has been reached while * seeking. You may call reset
in this * situation to see if there is a new seqentialized * stream available. * * Returns the time actually reached, either in * relative time or absolute time.
Decode audio data, if possible. * Decoded data is passed to the second argument. * * Raises End_of_stream
if all stream have ended. * In this case, you can try reset
to see if there is a * new sequentialized stream.
Decode audio data, if possible. * Decoded data is passed to the second argument. * * Raises End_of_stream
if all stream have ended. * In this case, you can try reset
to see if there is a * new sequentialized stream.
Decode video data, if possible. * Decoded data is passed to the second argument. * * Raises End_of_stream
if all streams have ended. * In this case, you can try reset
to see if there is a * new sequentialized stream.
type ('a, 'b) decoder = {
name : string;
info : unit -> 'a * metadata;
decode : ('b -> unit) -> unit;
restart : fill:(unit -> unit) -> Ogg.Stream.stream -> unit;
samples_of_granulepos : Int64.t -> Int64.t;
}
Generic type for a decoder.
type decoders =
| Video of (video_info, video_data) decoder
| Audio of (audio_info, audio_data) decoder
| Audio_ba of (audio_info, audio_ba_data) decoder
| Audio_both of (audio_info, audio_data) decoder
* (audio_info, audio_ba_data) decoder
| Unknown
Type for a generic logical stream decoder.
type register_decoder =
(Ogg.Stream.packet ->
bool)
* (fill:(unit -> unit) ->
Ogg.Stream.stream ->
decoders)
Type used to register a new decoder. First * element is a function used to check if the initial Ogg.Stream.packet
* of an Ogg.Stream.stream
matches the format decodable by this decoder. * Second element is a function that instanciates the actual decoder * using the initial Ogg.Stream.stream
used to pull data packets for the * decoder.
Register a new decoder.