package ogg

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type t
type callbacks = {
  1. read : int -> string * int;
  2. seek : (int -> int) option;
  3. tell : (unit -> int) option;
}
type track =
  1. | Audio_track of string * nativeint
  2. | Video_track of string * nativeint
type standard_tracks = {
  1. mutable audio_track : track option;
  2. mutable video_track : track option;
}
type metadata = string * (string * string) list
type audio_info = {
  1. channels : int;
  2. sample_rate : int;
}
type audio_data = float array array
type video_format =
  1. | Yuvj_420
  2. | Yuvj_422
  3. | Yuvj_444
type video_info = {
  1. fps_numerator : int;
  2. fps_denominator : int;
  3. width : int;
  4. height : int;
}
type video_data = {
  1. format : video_format;
  2. frame_width : int;
  3. frame_height : int;
  4. y_stride : int;
  5. uv_stride : int;
  6. y : video_plane;
  7. u : video_plane;
  8. 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 = {
  1. name : string;
  2. info : unit -> 'a * metadata;
  3. decode : ('b -> unit) -> unit;
  4. restart : Ogg.Stream.t -> unit;
  5. samples_of_granulepos : Int64.t -> Int64.t;
}
type decoders =
  1. | Video of (video_info, video_data) decoder
  2. | Audio of (audio_info, audio_data) decoder
  3. | Unknown
type register_decoder = (Ogg.Stream.packet -> bool) * (Ogg.Stream.t -> decoders)
val ogg_decoders : (string, register_decoder) Hashtbl.t
OCaml

Innovation. Community. Security.