libtheoradec and libtheoraenc C API. More...
#include <ogg/ogg.h>
Go to the source code of this file.
Data Structures | |
| struct | th_img_plane |
| A buffer for a single color plane in an uncompressed image. More... | |
| struct | th_info |
| Theora bitstream information. More... | |
| struct | th_comment |
| The comment information. More... | |
| struct | th_quant_ranges |
| A set of qi ranges. More... | |
| struct | th_quant_info |
| A complete set of quantization parameters. More... | |
| struct | th_huff_code |
| A Huffman code for a Theora DCT token. More... | |
Return codes | |
| #define | TH_EFAULT (-1) |
| An invalid pointer was provided. | |
| #define | TH_EINVAL (-10) |
| An invalid argument was provided. | |
| #define | TH_EBADHEADER (-20) |
| The contents of the header were incomplete, invalid, or unexpected. | |
| #define | TH_ENOTFORMAT (-21) |
| The header does not belong to a Theora stream. | |
| #define | TH_EVERSION (-22) |
| The bitstream version is too high. | |
| #define | TH_EIMPL (-23) |
| The specified function is not implemented. | |
| #define | TH_EBADPACKET (-24) |
| There were errors in the video data packet. | |
| #define | TH_DUPFRAME (1) |
| The decoded packet represented a dropped frame. | |
Basic shared functions | |
| const char * | th_version_string (void) |
| Retrieves a human-readable string to identify the library vendor and version. | |
| ogg_uint32_t | th_version_number (void) |
| Retrieves the library version number. | |
| ogg_int64_t | th_granule_frame (void *_encdec, ogg_int64_t _granpos) |
Converts a granule position to an absolute frame index, starting at 0. | |
| double | th_granule_time (void *_encdec, ogg_int64_t _granpos) |
| Converts a granule position to an absolute time in seconds. | |
| int | th_packet_isheader (ogg_packet *_op) |
| Determines whether a Theora packet is a header or not. | |
| int | th_packet_iskeyframe (ogg_packet *_op) |
| Determines whether a theora packet is a key frame or not. | |
Functions for manipulating header data | |
| void | th_info_init (th_info *_info) |
| Initializes a th_info structure. | |
| void | th_info_clear (th_info *_info) |
| Clears a th_info structure. | |
| void | th_comment_init (th_comment *_tc) |
| Initialize a th_comment structure. | |
| void | th_comment_add (th_comment *_tc, char *_comment) |
| Add a comment to an initialized th_comment structure. | |
| void | th_comment_add_tag (th_comment *_tc, char *_tag, char *_val) |
| Add a comment to an initialized th_comment structure. | |
| char * | th_comment_query (th_comment *_tc, char *_tag, int _count) |
| Look up a comment value by its tag. | |
| int | th_comment_query_count (th_comment *_tc, char *_tag) |
| Look up the number of instances of a tag. | |
| void | th_comment_clear (th_comment *_tc) |
| Clears a th_comment structure. | |
Defines | |
| #define | _O_THEORA_CODEC_H_ (1) |
| #define | TH_NHUFFMAN_TABLES (80) |
| The number of Huffman tables used by Theora. | |
| #define | TH_NDCT_TOKENS (32) |
| The number of DCT token values in each table. | |
Typedefs | |
| typedef th_img_plane | th_ycbcr_buffer [3] |
| A complete image buffer for an uncompressed frame. | |
| typedef th_comment | th_comment |
| The comment information. | |
| typedef unsigned char | th_quant_base [64] |
| A single base matrix. | |
Enumerations | |
| enum | th_colorspace { TH_CS_UNSPECIFIED, TH_CS_ITU_REC_470M, TH_CS_ITU_REC_470BG, TH_CS_NSPACES } |
| The currently defined color space tags. More... | |
| enum | th_pixel_fmt { TH_PF_420, TH_PF_RSVD, TH_PF_422, TH_PF_444, TH_PF_NFORMATS } |
| The currently defined pixel format tags. More... | |
libtheoradec and libtheoraenc C API.
You don't need to include this directly.
|
|
|
|
|
The decoded packet represented a dropped frame. The player can continue to display the current frame, as the contents of the decoded frame buffer have not changed. |
|
|
The contents of the header were incomplete, invalid, or unexpected.
|
|
|
There were errors in the video data packet.
|
|
|
An invalid pointer was provided.
|
|
|
The specified function is not implemented.
|
|
|
An invalid argument was provided.
|
|
|
The header does not belong to a Theora stream.
|
|
|
The bitstream version is too high.
|
|
|
The number of DCT token values in each table.
|
|
|
The number of Huffman tables used by Theora.
|
|
|
The comment information. This structure holds the in-stream metadata corresponding to the 'comment' header packet. The comment header is meant to be used much like someone jotting a quick note on the label of a video. It should be a short, to the point text note that can be more than a couple words, but not more than a short paragraph. The metadata is stored as a series of (tag, value) pairs, in length-encoded string vectors. The first occurrence of the '=' character delimits the tag and value. A particular tag may occur more than once, and order is significant. The character set encoding for the strings is always UTF-8, but the tag names are limited to ASCII, and treated as case-insensitive. See the Theora specification, Section 6.3.3 for details. In filling in this structure, th_decode_headerin() will null-terminate the user_comment strings for safety. However, the bitstream format itself treats them as 8-bit clean vectors, possibly containing null characters, and so the length array should be treated as their authoritative length. |
|
|
A single base matrix.
|
|
|
A complete image buffer for an uncompressed frame. The chroma planes may be decimated by a factor of two in either direction, as indicated by th_info::pixel_fmt. The width and height of the Y' plane must be multiples of 16. They may need to be cropped for display, using the rectangle specified by th_info::pic_x, th_info::pic_y, th_info::pic_width, and th_info::pic_height. All samples are 8 bits.
|
|
|
The currently defined color space tags. See the Theora specification, Chapter 4, for exact details on the meaning of each of these color spaces.
|
|
|
The currently defined pixel format tags. See the Theora specification, Section 4.4, for details on the precise sample locations.
|
|
||||||||||||
|
Add a comment to an initialized th_comment structure.
|
|
||||||||||||||||
|
Add a comment to an initialized th_comment structure.
|
|
|
Clears a th_comment structure. This should be called on a th_comment structure after it is no longer needed. It will free all memory used by the structure members.
|
|
|
Initialize a th_comment structure. This should be called on a freshly allocated th_comment structure before attempting to use it.
|
|
||||||||||||||||
|
Look up a comment value by its tag.
|
|
||||||||||||
|
Look up the number of instances of a tag. Call this first when querying for a specific tag and then iterate over the number of instances with separate calls to th_comment_query() to retrieve all the values for that tag in order.
|
|
||||||||||||
|
Converts a granule position to an absolute frame index, starting at The granule position is interpreted in the context of a given th_enc_ctx or th_dec_ctx handle (either will suffice).
|
|
||||||||||||
|
Converts a granule position to an absolute time in seconds. The granule position is interpreted in the context of a given th_enc_ctx or th_dec_ctx handle (either will suffice).
|
|
|
Clears a th_info structure. This should be called on a th_info structure after it is no longer needed.
|
|
|
Initializes a th_info structure. This should be called on a freshly allocated th_info structure before attempting to use it.
|
|
|
Determines whether a Theora packet is a header or not. This function does no verification beyond checking the packet type bit, so it should not be used for bitstream identification; use th_decode_headerin() for that. As per the Theora specification, an empty (0-byte) packet is treated as a data packet (a delta frame with no coded blocks).
|
|
|
Determines whether a theora packet is a key frame or not. This function does no verification beyond checking the packet type and key frame bits, so it should not be used for bitstream identification; use th_decode_headerin() for that. As per the Theora specification, an empty (0-byte) packet is treated as a delta frame (with no coded blocks).
|
|
|
Retrieves the library version number. This is the highest bitstream version that the encoder library will produce, or that the decoder library can decode. This number is composed of a 16-bit major version, 8-bit minor version and 8 bit sub-version, composed as follows: (VERSION_MAJOR<<16)+(VERSION_MINOR<<8)+(VERSION_SUBMINOR)
|
|
|
Retrieves a human-readable string to identify the library vendor and version.
|
1.4.4