Lines Matching defs:decoder
78 static FLAC__bool die_s_(const char *msg, const FLAC__StreamDecoder *decoder)
80 FLAC__StreamDecoderState state = FLAC__stream_decoder_get_state(decoder);
104 printf("\n\ngenerating %sFLAC file for decoder tests...\n", is_ogg? "Ogg ":"");
123 static FLAC__StreamDecoderReadStatus stream_decoder_read_callback_(const FLAC__StreamDecoder *decoder, FLAC__byte buffer[], size_t *bytes, void *client_data)
128 (void)decoder;
158 static FLAC__StreamDecoderSeekStatus stream_decoder_seek_callback_(const FLAC__StreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *client_data)
162 (void)decoder;
180 static FLAC__StreamDecoderTellStatus stream_decoder_tell_callback_(const FLAC__StreamDecoder *decoder, FLAC__uint64 *absolute_byte_offset, void *client_data)
185 (void)decoder;
206 static FLAC__StreamDecoderLengthStatus stream_decoder_length_callback_(const FLAC__StreamDecoder *decoder, FLAC__uint64 *stream_length, void *client_data)
210 (void)decoder;
224 static FLAC__bool stream_decoder_eof_callback_(const FLAC__StreamDecoder *decoder, void *client_data)
228 (void)decoder;
241 static FLAC__StreamDecoderWriteStatus stream_decoder_write_callback_(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data)
245 (void)decoder, (void)buffer;
266 static void stream_decoder_metadata_callback_(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data)
270 (void)decoder;
296 static void stream_decoder_error_callback_(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data)
300 (void)decoder;
313 static FLAC__bool stream_decoder_test_respond_(FLAC__StreamDecoder *decoder, StreamDecoderClientData *dcd, FLAC__bool is_ogg)
317 if(!FLAC__stream_decoder_set_md5_checking(decoder, true))
318 return die_s_("at FLAC__stream_decoder_set_md5_checking(), returned false", decoder);
335 FLAC__stream_decoder_init_ogg_stream(decoder, stream_decoder_read_callback_, /*seek_callback=*/0, /*tell_callback=*/0, /*length_callback=*/0, /*eof_callback=*/0, stream_decoder_write_callback_, stream_decoder_metadata_callback_, stream_decoder_error_callback_, dcd) :
336 FLAC__stream_decoder_init_stream(decoder, stream_decoder_read_callback_, /*seek_callback=*/0, /*tell_callback=*/0, /*length_callback=*/0, /*eof_callback=*/0, stream_decoder_write_callback_, stream_decoder_metadata_callback_, stream_decoder_error_callback_, dcd)
342 FLAC__stream_decoder_init_ogg_stream(decoder, stream_decoder_read_callback_, stream_decoder_seek_callback_, stream_decoder_tell_callback_, stream_decoder_length_callback_, stream_decoder_eof_callback_, stream_decoder_write_callback_, stream_decoder_metadata_callback_, stream_decoder_error_callback_, dcd) :
343 FLAC__stream_decoder_init_stream(decoder, stream_decoder_read_callback_, stream_decoder_seek_callback_, stream_decoder_tell_callback_, stream_decoder_length_callback_, stream_decoder_eof_callback_, stream_decoder_write_callback_, stream_decoder_metadata_callback_, stream_decoder_error_callback_, dcd);
348 FLAC__stream_decoder_init_ogg_FILE(decoder, dcd->file, stream_decoder_write_callback_, stream_decoder_metadata_callback_, stream_decoder_error_callback_, dcd) :
349 FLAC__stream_decoder_init_FILE(decoder, dcd->file, stream_decoder_write_callback_, stream_decoder_metadata_callback_, stream_decoder_error_callback_, dcd);
354 FLAC__stream_decoder_init_ogg_file(decoder, flacfilename(is_ogg), stream_decoder_write_callback_, stream_decoder_metadata_callback_, stream_decoder_error_callback_, dcd) :
355 FLAC__stream_decoder_init_file(decoder, flacfilename(is_ogg), stream_decoder_write_callback_, stream_decoder_metadata_callback_, stream_decoder_error_callback_, dcd);
362 return die_s_(0, decoder);
373 if(!FLAC__stream_decoder_process_until_end_of_stream(decoder))
374 return die_s_("returned false", decoder);
378 if(!FLAC__stream_decoder_finish(decoder))
379 return die_s_("returned false", decoder);
387 FLAC__StreamDecoder *decoder;
398 decoder = FLAC__stream_decoder_new();
399 if(0 == decoder) {
406 FLAC__stream_decoder_delete(decoder);
410 decoder = FLAC__stream_decoder_new();
411 if(0 == decoder) {
422 FLAC__stream_decoder_init_ogg_stream(decoder, 0, 0, 0, 0, 0, 0, 0, 0, 0) :
423 FLAC__stream_decoder_init_stream(decoder, 0, 0, 0, 0, 0, 0, 0, 0, 0);
428 FLAC__stream_decoder_init_ogg_FILE(decoder, stdin, 0, 0, 0, 0) :
429 FLAC__stream_decoder_init_FILE(decoder, stdin, 0, 0, 0, 0);
434 FLAC__stream_decoder_init_ogg_file(decoder, flacfilename(is_ogg), 0, 0, 0, 0) :
435 FLAC__stream_decoder_init_file(decoder, flacfilename(is_ogg), 0, 0, 0, 0);
442 return die_s_(0, decoder);
446 FLAC__stream_decoder_delete(decoder);
453 decoder = FLAC__stream_decoder_new();
454 if(0 == decoder) {
462 if(!FLAC__stream_decoder_set_ogg_serial_number(decoder, file_utils__ogg_serial_number))
463 return die_s_("returned false", decoder);
468 if(!FLAC__stream_decoder_set_md5_checking(decoder, true))
469 return die_s_("returned false", decoder);
486 FLAC__stream_decoder_init_ogg_stream(decoder, stream_decoder_read_callback_, /*seek_callback=*/0, /*tell_callback=*/0, /*length_callback=*/0, /*eof_callback=*/0, stream_decoder_write_callback_, stream_decoder_metadata_callback_, stream_decoder_error_callback_, &decoder_client_data) :
487 FLAC__stream_decoder_init_stream(decoder, stream_decoder_read_callback_, /*seek_callback=*/0, /*tell_callback=*/0, /*length_callback=*/0, /*eof_callback=*/0, stream_decoder_write_callback_, stream_decoder_metadata_callback_, stream_decoder_error_callback_, &decoder_client_data);
492 FLAC__stream_decoder_init_ogg_stream(decoder, stream_decoder_read_callback_, stream_decoder_seek_callback_, stream_decoder_tell_callback_, stream_decoder_length_callback_, stream_decoder_eof_callback_, stream_decoder_write_callback_, stream_decoder_metadata_callback_, stream_decoder_error_callback_, &decoder_client_data) :
493 FLAC__stream_decoder_init_stream(decoder, stream_decoder_read_callback_, stream_decoder_seek_callback_, stream_decoder_tell_callback_, stream_decoder_length_callback_, stream_decoder_eof_callback_, stream_decoder_write_callback_, stream_decoder_metadata_callback_, stream_decoder_error_callback_, &decoder_client_data);
498 FLAC__stream_decoder_init_ogg_FILE(decoder, decoder_client_data.file, stream_decoder_write_callback_, stream_decoder_metadata_callback_, stream_decoder_error_callback_, &decoder_client_data) :
499 FLAC__stream_decoder_init_FILE(decoder, decoder_client_data.file, stream_decoder_write_callback_, stream_decoder_metadata_callback_, stream_decoder_error_callback_, &decoder_client_data);
504 FLAC__stream_decoder_init_ogg_file(decoder, flacfilename(is_ogg), stream_decoder_write_callback_, stream_decoder_metadata_callback_, stream_decoder_error_callback_, &decoder_client_data) :
505 FLAC__stream_decoder_init_file(decoder, flacfilename(is_ogg), stream_decoder_write_callback_, stream_decoder_metadata_callback_, stream_decoder_error_callback_, &decoder_client_data);
512 return die_s_(0, decoder);
516 state = FLAC__stream_decoder_get_state(decoder);
524 if(!FLAC__stream_decoder_get_md5_checking(decoder)) {
531 if(!FLAC__stream_decoder_process_until_end_of_metadata(decoder))
532 return die_s_("returned false", decoder);
536 if(!FLAC__stream_decoder_process_single(decoder))
537 return die_s_("returned false", decoder);
541 if(!FLAC__stream_decoder_skip_single_frame(decoder))
542 return die_s_("returned false", decoder);
547 if(!FLAC__stream_decoder_flush(decoder))
548 return die_s_("returned false", decoder);
553 if(!FLAC__stream_decoder_process_single(decoder))
554 return die_s_("returned false", decoder);
561 if(FLAC__stream_decoder_seek_absolute(decoder, 0) != expect)
562 return die_s_(expect? "returned false" : "returned true", decoder);
566 if(!FLAC__stream_decoder_process_until_end_of_stream(decoder))
567 return die_s_("returned false", decoder);
572 if(FLAC__stream_decoder_seek_absolute(decoder, 0) != expect)
573 return die_s_(expect? "returned false" : "returned true", decoder);
578 unsigned channels = FLAC__stream_decoder_get_channels(decoder);
588 unsigned bits_per_sample = FLAC__stream_decoder_get_bits_per_sample(decoder);
598 unsigned sample_rate = FLAC__stream_decoder_get_sample_rate(decoder);
608 unsigned blocksize = FLAC__stream_decoder_get_blocksize(decoder);
617 FLAC__ChannelAssignment ca = FLAC__stream_decoder_get_channel_assignment(decoder);
623 if(!FLAC__stream_decoder_reset(decoder)) {
624 state = FLAC__stream_decoder_get_state(decoder);
643 if(!FLAC__stream_decoder_process_until_end_of_stream(decoder))
644 return die_s_("returned false", decoder);
649 if(!FLAC__stream_decoder_finish(decoder))
650 return die_s_("returned false", decoder);
658 if(!FLAC__stream_decoder_set_metadata_respond_all(decoder))
659 return die_s_("returned false", decoder);
686 if(!stream_decoder_test_respond_(decoder, &decoder_client_data, is_ogg))
694 if(!FLAC__stream_decoder_set_metadata_ignore_all(decoder))
695 return die_s_("returned false", decoder);
700 if(!stream_decoder_test_respond_(decoder, &decoder_client_data, is_ogg))
708 if(!FLAC__stream_decoder_set_metadata_respond_all(decoder))
709 return die_s_("returned false", decoder);
713 if(!FLAC__stream_decoder_set_metadata_ignore(decoder, FLAC__METADATA_TYPE_VORBIS_COMMENT))
714 return die_s_("returned false", decoder);
727 if(!stream_decoder_test_respond_(decoder, &decoder_client_data, is_ogg))
735 if(!FLAC__stream_decoder_set_metadata_respond_all(decoder))
736 return die_s_("returned false", decoder);
740 if(!FLAC__stream_decoder_set_metadata_ignore(decoder, FLAC__METADATA_TYPE_APPLICATION))
741 return die_s_("returned false", decoder);
764 if(!stream_decoder_test_respond_(decoder, &decoder_client_data, is_ogg))
772 if(!FLAC__stream_decoder_set_metadata_respond_all(decoder))
773 return die_s_("returned false", decoder);
777 if(!FLAC__stream_decoder_set_metadata_ignore_application(decoder, application1_.data.application.id))
778 return die_s_("returned false", decoder);
803 if(!stream_decoder_test_respond_(decoder, &decoder_client_data, is_ogg))
811 if(!FLAC__stream_decoder_set_metadata_respond_all(decoder))
812 return die_s_("returned false", decoder);
816 if(!FLAC__stream_decoder_set_metadata_ignore_application(decoder, application1_.data.application.id))
817 return die_s_("returned false", decoder);
821 if(!FLAC__stream_decoder_set_metadata_ignore_application(decoder, application2_.data.application.id))
822 return die_s_("returned false", decoder);
845 if(!stream_decoder_test_respond_(decoder, &decoder_client_data, is_ogg))
853 if(!FLAC__stream_decoder_set_metadata_ignore_all(decoder))
854 return die_s_("returned false", decoder);
858 if(!FLAC__stream_decoder_set_metadata_respond(decoder, FLAC__METADATA_TYPE_VORBIS_COMMENT))
859 return die_s_("returned false", decoder);
865 if(!stream_decoder_test_respond_(decoder, &decoder_client_data, is_ogg))
873 if(!FLAC__stream_decoder_set_metadata_ignore_all(decoder))
874 return die_s_("returned false", decoder);
878 if(!FLAC__stream_decoder_set_metadata_respond(decoder, FLAC__METADATA_TYPE_APPLICATION))
879 return die_s_("returned false", decoder);
886 if(!stream_decoder_test_respond_(decoder, &decoder_client_data, is_ogg))
894 if(!FLAC__stream_decoder_set_metadata_ignore_all(decoder))
895 return die_s_("returned false", decoder);
899 if(!FLAC__stream_decoder_set_metadata_respond_application(decoder, application1_.data.application.id))
900 return die_s_("returned false", decoder);
906 if(!stream_decoder_test_respond_(decoder, &decoder_client_data, is_ogg))
914 if(!FLAC__stream_decoder_set_metadata_ignore_all(decoder))
915 return die_s_("returned false", decoder);
919 if(!FLAC__stream_decoder_set_metadata_respond_application(decoder, application1_.data.application.id))
920 return die_s_("returned false", decoder);
924 if(!FLAC__stream_decoder_set_metadata_respond_application(decoder, application2_.data.application.id))
925 return die_s_("returned false", decoder);
932 if(!stream_decoder_test_respond_(decoder, &decoder_client_data, is_ogg))
940 if(!FLAC__stream_decoder_set_metadata_respond_all(decoder))
941 return die_s_("returned false", decoder);
945 if(!FLAC__stream_decoder_set_metadata_ignore(decoder, FLAC__METADATA_TYPE_APPLICATION))
946 return die_s_("returned false", decoder);
950 if(!FLAC__stream_decoder_set_metadata_respond_application(decoder, application1_.data.application.id))
951 return die_s_("returned false", decoder);
976 if(!stream_decoder_test_respond_(decoder, &decoder_client_data, is_ogg))
984 if(!FLAC__stream_decoder_set_metadata_ignore_all(decoder))
985 return die_s_("returned false", decoder);
989 if(!FLAC__stream_decoder_set_metadata_respond(decoder, FLAC__METADATA_TYPE_APPLICATION))
990 return die_s_("returned false", decoder);
994 if(!FLAC__stream_decoder_set_metadata_ignore_application(decoder, application1_.data.application.id))
995 return die_s_("returned false", decoder);
1001 if(!stream_decoder_test_respond_(decoder, &decoder_client_data, is_ogg))
1008 FLAC__stream_decoder_delete(decoder);