Displaying 5 results from an estimated 5 matches for "m_pile_array".
2013 Jul 02
2
About Decode Streaming
...ead callback function is just ;
* /// \brief read callback function of decoder*
* FLAC__StreamDecoderReadStatus decoderReadCallback( const
FLAC__StreamDecoder *decoder, FLAC__byte buffer[], size_t *bytes, void
*callback_param)*
* {*
* // mutex lock*
* m_mutex.lock();*
*
*
* // copy buffer array to m_pile_array*
* if(input_pile_size > 0) {*
* memcpy(input_pile_array, buffer, input_pile_size);*
* *bytes = input_pile_size;// = 0;*
*
*
* // mutex unlock*
* m_mutex.unlock();*
*
*
* return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE;*
* }*
*
*
* // mutex unlock*
* m_mutex.unlock();*
*
*
* return FLAC__STREAM_...
2013 Jul 01
2
About Decode Streaming
Sorry, I am newbie.
Sample codes are from
https://github.com/oneman/libflac/tree/master/examples/cpp.
I used FLAC__stream_decoder_process_single function but it still gives
exception. Maybe I could not control read callback, you're right.
I will check it and write result in this thread.
Thanks for help.
2013/7/1 Martijn van Beurden <mvanb1 at gmail.com>
> I'll top-post this
2013 Jul 02
3
About Decode Streaming
Yes, I have tried plain wav data with file and stream functions of decoder
and encoder. They work succesfully.
You're right about FLAC can't find the first block in stream, because I
didn't add any metadata in stream. The documentation of FLAC says that
metadata callback function is optional for stream function of decoder, so I
didn't need adding metadata.
Actually, I am sure
2013 Jul 02
0
About Decode Streaming
..._StreamDecoderErrorStatus status,
void *callback_param
);
When I call following statement,
*// decode data*
*if(!FLAC__stream_decoder_process_single(m_decoder))*
* return;*
*
*
firstly, read callback is called. In read callback function, I just use
memory copy process.
*// copy buffer array to m_pile_array*
*if(input_pile_size > 0) {*
* memcpy(input_pile_array, buffer, input_pile_size);*
* input_pile_size = 0;*
*
*
*
*
* return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE;*
*}*
*
*
*return FLAC__STREAM_DECODER_READ_STATUS_ABORT;*
*
*
and I wait for calling write callback but program throws LOST_SYNC...
2013 Jul 02
2
About Decode Streaming
...);
>
> When I call following statement,
>
> *// decode data*
> *if(!FLAC__stream_decoder_process_single(m_decoder))*
> * return;*
> *
> *
> firstly, read callback is called. In read callback function, I just use
> memory copy process.
>
> *// copy buffer array to m_pile_array*
> *if(input_pile_size > 0) {*
> * memcpy(input_pile_array, buffer, input_pile_size);*
> * input_pile_size = 0;*
> *
> *
> *
> *
> * return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE;*
> *}*
> *
> *
> *return FLAC__STREAM_DECODER_READ_STATUS_ABORT;*
> *
>...