17 #ifndef __NUGU_ENCODER_H__
18 #define __NUGU_ENCODER_H__
103 const void *data,
size_t data_len,
161 const void *data,
size_t data_len,
NuguBuffer *out_buf);
struct _nugu_buffer NuguBuffer
Buffer object.
Definition: nugu_buffer.h:52
NUGU_API NuguEncoderDriver * nugu_encoder_driver_find_bytype(enum nugu_encoder_type type)
Find a driver by type in the driver list.
struct _nugu_encoder_driver NuguEncoderDriver
encoder driver object
Definition: nugu_encoder.h:42
NUGU_API NuguEncoderDriver * nugu_encoder_driver_find(const char *name)
Find a driver by name in the driver list.
NUGU_API int nugu_encoder_driver_remove(NuguEncoderDriver *driver)
Remove the driver from driver list.
NUGU_API int nugu_encoder_driver_free(NuguEncoderDriver *driver)
Destroy the encoder driver.
NUGU_API int nugu_encoder_driver_register(NuguEncoderDriver *driver)
Register the driver to driver list.
NUGU_API NuguEncoderDriver * nugu_encoder_driver_new(const char *name, enum nugu_encoder_type type, struct nugu_encoder_driver_ops *ops)
Create new encoder driver.
nugu_encoder_type
encoder type
Definition: nugu_encoder.h:138
@ NUGU_ENCODER_TYPE_OPUS
Definition: nugu_encoder.h:140
@ NUGU_ENCODER_TYPE_SPEEX
Definition: nugu_encoder.h:139
@ NUGU_ENCODER_TYPE_CUSTOM
Definition: nugu_encoder.h:141
NUGU_API NuguEncoder * nugu_encoder_new(NuguEncoderDriver *driver, NuguAudioProperty property)
Create new encoder object.
NUGU_API int nugu_encoder_set_driver_data(NuguEncoder *enc, void *data)
Set custom data for driver.
NUGU_API int nugu_encoder_free(NuguEncoder *enc)
Destroy the encoder object.
struct _nugu_encoder NuguEncoder
encoder object
Definition: nugu_encoder.h:36
NUGU_API const char * nugu_encoder_get_codec(NuguEncoder *enc)
Get encoder codec. e.g. "OGG_OPUS" or "SPEEX".
NUGU_API void * nugu_encoder_get_driver_data(NuguEncoder *enc)
Get custom data for driver.
NUGU_API void * nugu_encoder_encode(NuguEncoder *enc, int is_last, const void *data, size_t data_len, size_t *output_len)
Encode the encoded data.
NUGU_API const char * nugu_encoder_get_mime_type(NuguEncoder *enc)
Get encoder mime type.
audio property
Definition: nugu_audio.h:92
encoder driver operations
Definition: nugu_encoder.h:148
int(* create)(NuguEncoderDriver *driver, NuguEncoder *enc, NuguAudioProperty property)
Called when creating a new encoder.
Definition: nugu_encoder.h:153
int(* encode)(NuguEncoderDriver *driver, NuguEncoder *enc, int is_last, const void *data, size_t data_len, NuguBuffer *out_buf)
Called when a encoding request is received from the encoder.
Definition: nugu_encoder.h:160
int(* destroy)(NuguEncoderDriver *driver, NuguEncoder *enc)
Called when the encoder is destroyed.
Definition: nugu_encoder.h:166