libkate: /tmp/tgz/libkate-0.3.3/include/kate/oggkate.h File Reference

# /tmp/tgz/libkate-0.3.3/include/kate/oggkate.h File Reference

`#include <stddef.h>`
`#include <stdint.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_repeat (kate_state *k, kate_float t, kate_float threshold, ogg_packet *op)
int | kate_ogg_encode_keepalive (kate_state *k, kate_float t, ogg_packet *op)
int | kate_ogg_encode_finish (kate_state *k, kate_float 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

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

Decodes a Kate header

Parameters:

  | ki | the kate_info structure to fill from headers
  | kc | the kate_comment structure to fill from headers
  | op | the 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(), KATE_E_INVALID_PARAMETER, and kate_ogg_decode_headerin().

Referenced by kate_ogg_decode_headerin().

int kate_ogg_decode_is_idheader | ( | const ogg_packet * | op | ) |

Checks whether an Ogg packet contains a Kate identification header.

Parameters:

  | op | the 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(), and kate_ogg_decode_is_idheader().

Referenced by kate_ogg_decode_is_idheader().

int kate_ogg_decode_packetin | ( | kate_state * | k,
|  | ogg_packet * | op |
| ) |  |  |

Decodes a Kate data packet

Parameters:

  | k | the kate_state structure to decode a packet for
  | op | the 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(), KATE_E_INVALID_PARAMETER, and kate_ogg_decode_packetin().

Referenced by kate_ogg_decode_packetin().

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:

  | k | the kate_state structure to encode headers for
  | t | the time at which to insert the packet
  | op | the ogg_packet to encode the packet to

Returns:
  0 success

  KATE_E_* error

Examples:
  encoding.c.

References kate_encode_finish(), kate_ogg_encode_finish(), and kate_state::kes.

Referenced by kate_ogg_encode_finish().

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:

  | k | the kate_state structure to encode headers for
  | kc | the comments to encode in headers
  | op | the 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_headers(), and kate_state::kes.

Referenced by kate_ogg_encode_headers().

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:

  | k | the kate_state structure to encode headers for
  | t | the time at which to insert the keepalive packet
  | op | the ogg_packet to encode the packet to

Returns:
  0 success

  KATE_E_* error

References kate_encode_keepalive(), kate_ogg_encode_keepalive(), and kate_state::kes.

Referenced by kate_ogg_encode_keepalive().

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:

  | k | the kate_state structure to encode headers for
  | t | the time at which to insert the repeat packet
  | threshold | the minimum age an active event must be for a repeat packet to be encoded
  | op | the 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(), and kate_state::kes.

Referenced by kate_ogg_encode_repeat().

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:

  | k | the kate_state structure to encode headers for
  | start_time | the start time, in seconds, of the event
  | stop_time | the stop time, in seconds, of the event
  | text | the text this event will hold (may be empty if none)
  | sz | the size, in bytes, of the text
  | op | the ogg_packet to encode the packet to

Returns:
  0 success

  KATE_E_* error

Examples:
  encoding.c.

References kate_encode_text(), kate_ogg_encode_text(), and kate_state::kes.

Referenced by kate_ogg_encode_text().