libkate  0.4.1
Functions
oggkate.h File Reference
#include <stddef.h>
#include <ogg/ogg.h>
#include "kate/kate.h"

Go to the source code of this file.

Functions

int kate_ogg_encode_headers (kate_state *k, kate_comment *kc, ogg_packet *op)
 
int kate_ogg_encode_text (kate_state *k, kate_float start_time, kate_float stop_time, const char *text, size_t sz, ogg_packet *op)
 
int kate_ogg_encode_text_raw_times (kate_state *k, kate_int64_t start_time, kate_int64_t stop_time, const char *text, size_t sz, ogg_packet *op)
 
int kate_ogg_encode_repeat (kate_state *k, kate_float t, kate_float threshold, ogg_packet *op)
 
int kate_ogg_encode_repeat_raw_times (kate_state *k, kate_int64_t t, kate_int64_t threshold, ogg_packet *op)
 
int kate_ogg_encode_keepalive (kate_state *k, kate_float t, ogg_packet *op)
 
int kate_ogg_encode_keepalive_raw_times (kate_state *k, kate_int64_t t, ogg_packet *op)
 
int kate_ogg_encode_finish (kate_state *k, kate_float t, ogg_packet *op)
 
int kate_ogg_encode_finish_raw_times (kate_state *k, kate_int64_t t, ogg_packet *op)
 
int kate_ogg_decode_is_idheader (const ogg_packet *op)
 
int kate_ogg_decode_headerin (kate_info *ki, kate_comment *kc, ogg_packet *op)
 
int kate_ogg_decode_packetin (kate_state *k, ogg_packet *op)
 

Detailed Description

The libkate Ogg interface public API.

Function Documentation

◆ kate_ogg_decode_headerin()

int kate_ogg_decode_headerin ( kate_info ki,
kate_comment kc,
ogg_packet *  op 
)

Decodes a Kate header

Parameters
kithe kate_info structure to fill from headers
kcthe kate_comment structure to fill from headers
opthe ogg_packet to test
Returns
0 success
1 success, and all headers have been decoded
KATE_E_* error
Examples
decoding.c.

References kate_decode_headerin(), and KATE_E_INVALID_PARAMETER.

◆ kate_ogg_decode_is_idheader()

int kate_ogg_decode_is_idheader ( const ogg_packet *  op)

Checks whether an Ogg packet contains a Kate identification header.

Parameters
opthe ogg_packet to test
Returns
1 success, and the packet contains a Kate identification header
0 success, and the packet does not contain a Kate identification header
KATE_E_* error

References kate_decode_is_idheader().

◆ kate_ogg_decode_packetin()

int kate_ogg_decode_packetin ( kate_state k,
ogg_packet *  op 
)

Decodes a Kate data packet

Parameters
kthe kate_state structure to decode a packet for
opthe ogg_packet to test
Returns
0 success
1 success, and we're at end of stream
KATE_E_* error
Examples
decoding.c.

References kate_decode_packetin(), and KATE_E_INVALID_PARAMETER.

◆ kate_ogg_encode_finish()

int kate_ogg_encode_finish ( kate_state k,
kate_float  t,
ogg_packet *  op 
)

Encodes an end-of-stream data packet to an Ogg packet The kate_state structure should have been initialized with kate_decode_init or kate_encode_init. No other packet may be encoded afer an end of stream packet is encoded.

Parameters
kthe kate_state structure to encode headers for
tthe time at which to insert the packet
opthe ogg_packet to encode the packet to
Returns
0 success
KATE_E_* error
Examples
encoding.c.

References kate_encode_finish().

◆ kate_ogg_encode_finish_raw_times()

int kate_ogg_encode_finish_raw_times ( kate_state k,
kate_int64_t  t,
ogg_packet *  op 
)

Encodes an end-of-stream data packet to an Ogg packet The kate_state structure should have been initialized with kate_decode_init or kate_encode_init. No other packet may be encoded afer an end of stream packet is encoded.

Parameters
kthe kate_state structure to encode headers for
tthe time at which to insert the packet
opthe ogg_packet to encode the packet to
Returns
0 success
KATE_E_* error

References kate_encode_finish_raw_times().

◆ kate_ogg_encode_headers()

int kate_ogg_encode_headers ( kate_state k,
kate_comment kc,
ogg_packet *  op 
)

Encodes a Kate header to an Ogg packet The kate_state structure should have been initialized with kate_decode_init or kate_encode_init.

Parameters
kthe kate_state structure to encode headers for
kcthe comments to encode in headers
opthe ogg_packet to encode headers to
Returns
0 success
1 success, and all headers have been encoded
KATE_E_* error
Examples
encoding.c.

References kate_encode_headers().

◆ kate_ogg_encode_keepalive()

int kate_ogg_encode_keepalive ( kate_state k,
kate_float  t,
ogg_packet *  op 
)

Encodes a keepalive data packet to an Ogg packet The kate_state structure should have been initialized with kate_decode_init or kate_encode_init.

Parameters
kthe kate_state structure to encode headers for
tthe time at which to insert the keepalive packet
opthe ogg_packet to encode the packet to
Returns
0 success
KATE_E_* error

References kate_encode_keepalive().

◆ kate_ogg_encode_keepalive_raw_times()

int kate_ogg_encode_keepalive_raw_times ( kate_state k,
kate_int64_t  t,
ogg_packet *  op 
)

Encodes a keepalive data packet to an Ogg packet The kate_state structure should have been initialized with kate_decode_init or kate_encode_init.

Parameters
kthe kate_state structure to encode headers for
tthe time at which to insert the keepalive packet
opthe ogg_packet to encode the packet to
Returns
0 success
KATE_E_* error

References kate_encode_keepalive_raw_times().

◆ kate_ogg_encode_repeat()

int kate_ogg_encode_repeat ( kate_state k,
kate_float  t,
kate_float  threshold,
ogg_packet *  op 
)

Encodes a repeat data packet to an Ogg packet The kate_state structure should have been initialized with kate_decode_init or kate_encode_init.

Parameters
kthe kate_state structure to encode headers for
tthe time at which to insert the repeat packet
thresholdthe minimum age an active event must be for a repeat packet to be encoded
opthe ogg_packet to encode the packet to
Returns
0 success, and no repeat packets were needed
1 success, and a repeat packet was encoded
KATE_E_* error

References kate_encode_repeat().

◆ kate_ogg_encode_repeat_raw_times()

int kate_ogg_encode_repeat_raw_times ( kate_state k,
kate_int64_t  t,
kate_int64_t  threshold,
ogg_packet *  op 
)

Encodes a repeat data packet to an Ogg packet The kate_state structure should have been initialized with kate_decode_init or kate_encode_init.

Parameters
kthe kate_state structure to encode headers for
tthe time at which to insert the repeat packet
thresholdthe minimum age an active event must be for a repeat packet to be encoded
opthe ogg_packet to encode the packet to
Returns
0 success, and no repeat packets were needed
1 success, and a repeat packet was encoded
KATE_E_* error

References kate_encode_repeat_raw_times().

◆ kate_ogg_encode_text()

int kate_ogg_encode_text ( kate_state k,
kate_float  start_time,
kate_float  stop_time,
const char *  text,
size_t  sz,
ogg_packet *  op 
)

Encodes a text data packet to an Ogg packet The kate_state structure should have been initialized with kate_decode_init or kate_encode_init.

Parameters
kthe kate_state structure to encode headers for
start_timethe start time, in seconds, of the event
stop_timethe stop time, in seconds, of the event
textthe text this event will hold (may be empty if none)
szthe size, in bytes, of the text
opthe ogg_packet to encode the packet to
Returns
0 success
KATE_E_* error
Examples
encoding.c.

References kate_encode_text().

◆ kate_ogg_encode_text_raw_times()

int kate_ogg_encode_text_raw_times ( kate_state k,
kate_int64_t  start_time,
kate_int64_t  stop_time,
const char *  text,
size_t  sz,
ogg_packet *  op 
)

Encodes a text data packet to an Ogg packet The kate_state structure should have been initialized with kate_decode_init or kate_encode_init.

Parameters
kthe kate_state structure to encode headers for
start_timethe start time, in seconds, of the event
stop_timethe stop time, in seconds, of the event
textthe text this event will hold (may be empty if none)
szthe size, in bytes, of the text
opthe ogg_packet to encode the packet to
Returns
0 success
KATE_E_* error

References kate_encode_text_raw_times().