libmimic
1.0.4
|
The public API of the libmimic library. More...
Typedefs | |
typedef struct _MimCtx | MimCtx |
Enumerations | |
enum | MimicResEnum { MIMIC_RES_LOW, MIMIC_RES_HIGH } |
Functions | |
MimCtx * | mimic_open () |
void | mimic_close (MimCtx *ctx) |
gboolean | mimic_encoder_init (MimCtx *ctx, const MimicResEnum resolution) |
gboolean | mimic_decoder_init (MimCtx *ctx, const guchar *frame_buffer) |
gboolean | mimic_get_property (MimCtx *ctx, const gchar *name, gpointer data) |
gboolean | mimic_set_property (MimCtx *ctx, const gchar *name, gpointer data) |
gboolean | mimic_encode_frame (MimCtx *ctx, const guchar *input_buffer, guchar *output_buffer, gint *output_length, gboolean make_keyframe) |
gboolean | mimic_decode_frame (MimCtx *ctx, const guchar *input_buffer, guchar *output_buffer) |
The public API of the libmimic library.
libmimic provides the API required for encoding and decoding MIMIC v2.x-encoded content.
The mimic encoding/decoding context returned by mimic_open and used for all further API calls until mimic_close.
enum MimicResEnum |
MimCtx* mimic_open | ( | ) |
Creates a new instance and returns a pointer to the new context that can be used for either encoding or decoding by calling mimic_encoder_init or mimic_decoder_init.
mimic_close is called to free any resources associated with the context once done.
void mimic_close | ( | MimCtx * | ctx | ) |
Frees any resources associated with the given context.
ctx | the mimic context to free |
gboolean mimic_encoder_init | ( | MimCtx * | ctx, |
const MimicResEnum | resolution | ||
) |
Initialize the mimic encoder and prepare for encoding by initializing internal state and allocating resources as needed.
After initializing use mimic_get_property to determine the size of the output buffer needed for calls to mimic_encode_frame. Use mimic_set_property to set encoding quality.
Note that once a given context has been initialized for either encoding or decoding it is not possible to initialize it again.
ctx | the mimic context to initialize |
resolution | a MimicResEnum used to specify the resolution |
References MIMIC_RES_HIGH, and MIMIC_RES_LOW.
gboolean mimic_decoder_init | ( | MimCtx * | ctx, |
const guchar * | frame_buffer | ||
) |
Initialize the mimic decoder. The frame passed in frame_buffer is used to determine the resolution so that the internal state can be prepared and resources allocated accordingly. Note that the frame passed has to be a keyframe.
After initializing use mimic_get_property to determine required buffer-size, resolution, quality, etc.
Note that once a given context has been initialized for either encoding or decoding it is not possible to initialize it again.
ctx | the mimic context to initialize |
frame_buffer | buffer containing the first frame to decode |
gboolean mimic_get_property | ( | MimCtx * | ctx, |
const gchar * | name, | ||
gpointer | data | ||
) |
Get a property from a given mimic context. The context has to be initialized.
Currently the following properties are defined:
ctx | the mimic context to retrieve the property from |
name | of the property to retrieve the current value of |
data | pointer to the data that will receive the retrieved value |
gboolean mimic_set_property | ( | MimCtx * | ctx, |
const gchar * | name, | ||
gpointer | data | ||
) |
Set a property in a given mimic context. The context has to be initialized.
Currently the following properties are defined:
ctx | the mimic context to set a property in |
name | of the property to set to a new value |
data | pointer to the data that contains the new value |
gboolean mimic_encode_frame | ( | MimCtx * | ctx, |
const guchar * | input_buffer, | ||
guchar * | output_buffer, | ||
gint * | output_length, | ||
gboolean | make_keyframe | ||
) |
Encode a MIMIC-encoded frame from RGB data.
ctx | the mimic context |
input_buffer | buffer containing pixeldata in RGB 24-bpp packed pixel top-down format |
output_buffer | buffer that will receive the MIMIC-encoded frame (use mimic_get_property to determine the required buffer size) |
output_length | pointer to an integer that receives the length of the encoded data written to output_buffer |
make_keyframe | whether the encoder should make this frame a keyframe |
gboolean mimic_decode_frame | ( | MimCtx * | ctx, |
const guchar * | input_buffer, | ||
guchar * | output_buffer | ||
) |
Decode a MIMIC-encoded frame into RGB data.
ctx | the mimic context |
input_buffer | buffer containing the MIMIC-encoded frame to decode |
output_buffer | buffer that will receive the decoded frame in RGB 24-bpp packed pixel top-down format (use mimic_get_property to determine the required buffer size, as well as frame width and height) |