ogg

Bindings to libogg
IN THIS PACKAGE
Module Ogg_demuxer
type t
type callbacks = {
read : bytes -> int -> int -> int;
seek : ( int -> int ) option;
tell : ( unit -> int ) option;
}
type track =
| Audio_track of string * nativeint
| Video_track of string * nativeint
type standard_tracks = {
mutable audio_track : track option;
mutable video_track : track option;
}
type metadata = string * (string * string) list
type audio_info = {
channels : int;
sample_rate : int;
}
type audio_data = float array array
type video_format =
| Yuvj_420
| Yuvj_422
| Yuvj_444
type video_info = {
fps_numerator : int;
fps_denominator : int;
width : int;
height : int;
}
type video_data = {
format : video_format;
frame_width : int;
frame_height : int;
y_stride : int;
uv_stride : int;
y : video_plane;
u : video_plane;
v : video_plane;
}
exception Invalid_stream
exception Not_available
exception End_of_stream
val init : ?log:( string -> unit ) -> callbacks -> t
val init_from_file : ?log:( string -> unit ) -> string -> t * Unix.file_descr
val init_from_fd : ?log:( string -> unit ) -> Unix.file_descr -> t
val get_ogg_sync : t -> Ogg.Sync.t
val reset : t -> unit
val abort : t -> unit
val eos : t -> bool
val get_tracks : t -> track list
val get_standard_tracks : t -> standard_tracks
val update_standard_tracks : t -> standard_tracks -> unit
val drop_track : t -> track -> unit
val audio_info : t -> track -> audio_info * metadata
val video_info : t -> track -> video_info * metadata
val sample_rate : t -> track -> int * int
val get_track_position : t -> track -> float
val get_position : t -> float
val can_seek : t -> bool
val seek : ?relative:bool -> t -> float -> float
val decode_audio : t -> track -> ( audio_data -> unit ) -> unit
val decode_video : t -> track -> ( video_data -> unit ) -> unit
type (!'a, !'b) decoder = {
name : string;
info : unit -> 'a * metadata;
decode : ( 'b -> unit ) -> unit;
restart : Ogg.Stream.stream -> unit;
samples_of_granulepos : Int64.t -> Int64.t;
}
type decoders =
| Video of ( video_info, video_data ) decoder
| Audio of ( audio_info, audio_data ) decoder
| Unknown
type register_decoder = ( Ogg.Stream.packet -> bool ) * ( Ogg.Stream.stream -> decoders )
val ogg_decoders : ( string, register_decoder ) Hashtbl.t