package theora

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type decoder

Type for an uninitialized decoder.

type t

Type for an initialized decoder.

val check : Ogg.Stream.packet -> bool

* Check wether an ogg logical stream contains theora data * * This function shall be called just after you put * the first page in the stream. See examples/thdecode.ml * * Raises Ogg.Bad_data if the stream does not contain theora data.

val create : unit -> decoder

Initialize the decoding structure. * The decoder should then be processed with headerin.

val headerin : decoder -> Ogg.Stream.packet -> t * info * string * (string * string) list

Add one packet from the stream and try to parse theora headers. * * Returns an initialized decoder. * * Raises Ogg.Not_enough_data is decoding header needs another packet. * * This function should be called with the first packets of the stream * until it returns the requested values. It may consume at most 5 packets * (3 header packet, 1 additional packet and the initial video packet)

val get_yuv : t -> Ogg.Stream.stream -> yuv_buffer

* Output the next available frame of decoded YUV data. * * Raises Ogg.Not_enough_data if the Ogg.Stream.stream which * has been used to initialize the handler does not contain * enought data. You should submit a new page to it, and * run this function again until it returns. * * Raises Not_initialized if the decoder was not properly * initialized with headerin.

val frames_of_granulepos : t -> Stdlib.Int64.t -> Stdlib.Int64.t

Convert a granulepos to an absolute frame index, starting at 0. * The granulepos is interpreted in the context of a given theora_state handle.