libopusenc: Callback Functions

| libopusenc 0.3 Stand-alone encoder library for .opus files.

Loading...
Searching...
No Matches
Callback Functions

## Data Structures
struct | OpusEncCallbacks
| Callback functions for accessing the stream. More...

## Callback functions
These are the callbacks that can be implemented for an encoder.
typedef int(* | ope_write_func) (void *user_data, const unsigned char *ptr, opus_int32 len)
| Called for writing a page.
typedef int(* | ope_close_func) (void *user_data)
| Called for closing a stream.
typedef void(* | ope_packet_func) (void *user_data, const unsigned char *packet_ptr, opus_int32 packet_len, opus_uint32 flags)
| Called on every packet encoded (including header).

## Detailed Description

## Typedef Documentation

## ◆ ope_write_func

typedef int(* ope_write_func) (void *user_data, const unsigned char *ptr, opus_int32 len)

Called for writing a page.

Parameters

  user_data | user-defined data passed to the callback
  ptr | buffer to be written
  len | number of bytes to be written

Returns
  error code

Return values

  0 | success
  1 | failure

## ◆ ope_close_func

typedef int(* ope_close_func) (void *user_data)

Called for closing a stream.

Parameters

  user_data | user-defined data passed to the callback

Returns
  error code

Return values

  0 | success
  1 | failure

## ◆ ope_packet_func

typedef void(* ope_packet_func) (void *user_data, const unsigned char *packet_ptr, opus_int32 packet_len, opus_uint32 flags)

Called on every packet encoded (including header).

Parameters

  user_data | user-defined data passed to the callback
  packet_ptr | packet data
  packet_len | number of bytes in the packet
  flags | optional flags (none defined for now so zero)