NUGU SDK Linux  1.7.6
Decoder

Decoder functions. More...

+ Collaboration diagram for Decoder:

Typedefs

typedef struct _nugu_decoder NuguDecoder
 decoder object
 

Functions

NUGU_API void * nugu_decoder_decode (NuguDecoder *dec, const void *data, size_t data_len, size_t *output_len)
 Decode the encoded data. More...
 
NUGU_API int nugu_decoder_free (NuguDecoder *dec)
 Destroy the decoder object. More...
 
NUGU_API void * nugu_decoder_get_driver_data (NuguDecoder *dec)
 Get custom data for driver. More...
 
NUGU_API NuguPcmnugu_decoder_get_pcm (NuguDecoder *dec)
 Get pcm(sink) object. More...
 
NUGU_API NuguDecodernugu_decoder_new (NuguDecoderDriver *driver, NuguPcm *sink)
 Create new decoder object. More...
 
NUGU_API int nugu_decoder_play (NuguDecoder *dec, const void *data, size_t data_len)
 Decode the encoded data and pass the result to sink. More...
 
NUGU_API int nugu_decoder_set_driver_data (NuguDecoder *dec, void *data)
 Set custom data for driver. More...
 

Detailed Description

Decoder functions.

The decoder object decodes the encoded data. It also serves to pass the decoded result to the PCM sink.

Function Documentation

◆ nugu_decoder_new()

NUGU_API NuguDecoder* nugu_decoder_new ( NuguDecoderDriver driver,
NuguPcm sink 
)

Create new decoder object.

Parameters
[in]driverdecoder driver
[in]sinkpcm object
Returns
decoder object
See also
nugu_decoder_free()
nugu_decoder_get_pcm()
nugu_pcm_new()

◆ nugu_decoder_free()

NUGU_API int nugu_decoder_free ( NuguDecoder dec)

Destroy the decoder object.

Parameters
[in]decdecoder object
Returns
result
Return values
0success
-1failure
See also
nugu_decoder_new()

◆ nugu_decoder_play()

NUGU_API int nugu_decoder_play ( NuguDecoder dec,
const void *  data,
size_t  data_len 
)

Decode the encoded data and pass the result to sink.

Parameters
[in]decdecoder object
[in]dataencoded data
[in]data_lenencoded data length
Returns
result
Return values
0success
-1failure
See also
nugu_decoder_decode()

◆ nugu_decoder_set_driver_data()

NUGU_API int nugu_decoder_set_driver_data ( NuguDecoder dec,
void *  data 
)

Set custom data for driver.

Parameters
[in]decdecoder object
[in]datacustom data managed by driver
Returns
result
Return values
0success
-1failure
See also
nugu_decoder_get_driver_data()

◆ nugu_decoder_get_driver_data()

NUGU_API void* nugu_decoder_get_driver_data ( NuguDecoder dec)

Get custom data for driver.

Parameters
[in]decdecoder object
Returns
data
See also
nugu_decoder_set_driver_data()

◆ nugu_decoder_decode()

NUGU_API void* nugu_decoder_decode ( NuguDecoder dec,
const void *  data,
size_t  data_len,
size_t *  output_len 
)

Decode the encoded data.

Parameters
[in]decdecoder object
[in]dataencoded data
[in]data_lenencoded data length
[out]output_lenoutput buffer length
Returns
memory allocated decoded data. Developer must free the data manually.

◆ nugu_decoder_get_pcm()

NUGU_API NuguPcm* nugu_decoder_get_pcm ( NuguDecoder dec)

Get pcm(sink) object.

Parameters
[in]decdecoder object
Returns
pcm object
See also
nugu_decoder_new()