ALT Linux Bugzilla
– Attachment 1836 Details for
Bug 10940
unsupported flac >= 1.1.3
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
gst-plugins-good-0.10.5+flac-1.1.3.patch
gst-plugins-good-0.10.5+flac-1.1.3.patch (text/plain), 36.49 KB, created by
led
on 2007-02-26 15:30:59 MSK
(
hide
)
Description:
gst-plugins-good-0.10.5+flac-1.1.3.patch
Filename:
MIME Type:
Creator:
led
Created:
2007-02-26 15:30:59 MSK
Size:
36.49 KB
patch
obsolete
>diff -urN gst-plugins-good-0.10.5.orig/configure.ac gst-plugins-good-0.10.5/configure.ac >--- gst-plugins-good-0.10.5.orig/configure.ac 2006-12-21 16:20:44 +0200 >+++ gst-plugins-good-0.10.5/configure.ac 2007-02-26 14:03:56 +0200 >@@ -551,13 +551,19 @@ > dnl *** FLAC *** > translit(dnm, m, l) AM_CONDITIONAL(USE_FLAC, true) > GST_CHECK_FEATURE(FLAC, [FLAC lossless audio], flac, [ >- GST_CHECK_LIBHEADER(FLAC, FLAC, FLAC__seekable_stream_encoder_new, -lm, FLAC/all.h, FLAC_LIBS="-lFLAC -lm") >+ GST_CHECK_LIBHEADER(FLAC, FLAC, FLAC__stream_encoder_new, -lm, FLAC/all.h, FLAC_LIBS="-lFLAC -logg -lm") > dnl API change in FLAC 1.1.1, so require that... > dnl (this check will also fail with FLAC 1.1.3 which changed API again > dnl and with which our plugin does not compile or work yet) > if test x$HAVE_FLAC = xyes; then > AC_CHECK_DECL(FLAC__SEEKABLE_STREAM_ENCODER_TELL_ERROR, >- HAVE_FLAC="yes", HAVE_FLAC="no", [ >+ HAVE_FLAC="yes", >+ AC_CHECK_DECL(FLAC__STREAM_ENCODER_TELL_STATUS_ERROR, >+ HAVE_FLAC="yes", HAVE_FLAC="no", >+ [ >+#include <FLAC/stream_encoder.h> >+ ]), >+ [ > #include <FLAC/seekable_stream_encoder.h> > ]) > fi >diff -urN gst-plugins-good-0.10.5.orig/ext/flac/gstflacdec.c gst-plugins-good-0.10.5/ext/flac/gstflacdec.c >--- gst-plugins-good-0.10.5.orig/ext/flac/gstflacdec.c 2006-10-16 21:22:46 +0300 >+++ gst-plugins-good-0.10.5/ext/flac/gstflacdec.c 2007-02-26 14:03:56 +0200 >@@ -91,45 +91,90 @@ > static GstFlowReturn gst_flac_dec_chain (GstPad * pad, GstBuffer * buf); > static void gst_flac_dec_reset_decoders (GstFlacDec * flacdec); > static void gst_flac_dec_setup_seekable_decoder (GstFlacDec * flacdec); >+#ifdef LEGACY_FLAC > static void gst_flac_dec_setup_stream_decoder (GstFlacDec * flacdec); >+#endif > >+#ifdef LEGACY_FLAC > static FLAC__SeekableStreamDecoderReadStatus > gst_flac_dec_read_seekable (const FLAC__SeekableStreamDecoder * decoder, > FLAC__byte buffer[], unsigned *bytes, void *client_data); >+#else >+static FLAC__StreamDecoderReadStatus >+gst_flac_dec_read_seekable (const FLAC__StreamDecoder * decoder, >+ FLAC__byte buffer[], size_t *bytes, void *client_data); >+#endif >+#ifdef LEGACY_FLAC > static FLAC__SeekableStreamDecoderSeekStatus > gst_flac_dec_seek (const FLAC__SeekableStreamDecoder * decoder, >+#else >+static FLAC__StreamDecoderSeekStatus >+gst_flac_dec_seek (const FLAC__StreamDecoder * decoder, >+#endif > FLAC__uint64 position, void *client_data); >+#ifdef LEGACY_FLAC > static FLAC__SeekableStreamDecoderTellStatus > gst_flac_dec_tell (const FLAC__SeekableStreamDecoder * decoder, >+#else >+static FLAC__StreamDecoderTellStatus >+gst_flac_dec_tell (const FLAC__StreamDecoder * decoder, >+#endif > FLAC__uint64 * position, void *client_data); >+#ifdef LEGACY_FLAC > static FLAC__SeekableStreamDecoderLengthStatus > gst_flac_dec_length (const FLAC__SeekableStreamDecoder * decoder, >+#else >+static FLAC__StreamDecoderLengthStatus >+gst_flac_dec_length (const FLAC__StreamDecoder * decoder, >+#endif > FLAC__uint64 * length, void *client_data); >+#ifdef LEGACY_FLAC > static FLAC__bool gst_flac_dec_eof (const FLAC__SeekableStreamDecoder * decoder, >+#else >+static FLAC__bool gst_flac_dec_eof (const FLAC__StreamDecoder * decoder, >+#endif > void *client_data); > static FLAC__StreamDecoderReadStatus > gst_flac_dec_read_stream (const FLAC__StreamDecoder * decoder, > FLAC__byte buffer[], unsigned *bytes, void *client_data); > static FLAC__StreamDecoderWriteStatus >+#ifdef LEGACY_FLAC > gst_flac_dec_write_seekable (const FLAC__SeekableStreamDecoder * decoder, >+#else >+gst_flac_dec_write_seekable (const FLAC__StreamDecoder * decoder, >+#endif > const FLAC__Frame * frame, > const FLAC__int32 * const buffer[], void *client_data); >+#ifdef LEGACY_FLAC > static FLAC__StreamDecoderWriteStatus > gst_flac_dec_write_stream (const FLAC__StreamDecoder * decoder, > const FLAC__Frame * frame, > const FLAC__int32 * const buffer[], void *client_data); >+#endif > static void gst_flac_dec_metadata_callback_seekable (const >+#ifdef LEGACY_FLAC > FLAC__SeekableStreamDecoder * decoder, >+#else >+ FLAC__StreamDecoder * decoder, >+#endif > const FLAC__StreamMetadata * metadata, void *client_data); >+#ifdef LEGACY_FLAC > static void gst_flac_dec_metadata_callback_stream (const FLAC__StreamDecoder * > decoder, const FLAC__StreamMetadata * metadata, void *client_data); >+#endif > static void gst_flac_dec_metadata_callback (GstFlacDec * flacdec, > const FLAC__StreamMetadata * metadata); > static void gst_flac_dec_error_callback_seekable (const >+#ifdef LEGACY_FLAC > FLAC__SeekableStreamDecoder * decoder, >+#else >+ FLAC__StreamDecoder * decoder, >+#endif > FLAC__StreamDecoderErrorStatus status, void *client_data); >+#ifdef LEGACY_FLAC > static void gst_flac_dec_error_callback_stream (const FLAC__StreamDecoder * > decoder, FLAC__StreamDecoderErrorStatus status, void *client_data); >+#endif > > GST_BOILERPLATE (GstFlacDec, gst_flac_dec, GstElement, GST_TYPE_ELEMENT); > #define GST_FLAC_DEC_SRC_CAPS \ >@@ -212,15 +257,21 @@ > gst_flac_dec_reset_decoders (GstFlacDec * flacdec) > { > if (flacdec->seekable_decoder) { >+#ifdef LEGACY_FLAC > FLAC__seekable_stream_decoder_delete (flacdec->seekable_decoder); >+#else >+ FLAC__stream_decoder_delete (flacdec->seekable_decoder); >+#endif > flacdec->seekable_decoder = NULL; > } > >+#ifdef LEGACY_FLAC > /* Clean up the stream_decoder */ > if (flacdec->stream_decoder) { > FLAC__stream_decoder_delete (flacdec->stream_decoder); > flacdec->stream_decoder = NULL; > } >+#endif > > if (flacdec->adapter) { > gst_adapter_clear (flacdec->adapter); >@@ -238,8 +289,13 @@ > { > gst_flac_dec_reset_decoders (dec); > >+#ifdef LEGACY_FLAC > dec->seekable_decoder = FLAC__seekable_stream_decoder_new (); >+#else >+ dec->seekable_decoder = FLAC__stream_decoder_new (); >+#endif > >+#ifdef LEGACY_FLAC > FLAC__seekable_stream_decoder_set_read_callback (dec->seekable_decoder, > gst_flac_dec_read_seekable); > FLAC__seekable_stream_decoder_set_seek_callback (dec->seekable_decoder, >@@ -253,14 +309,20 @@ > FLAC__seekable_stream_decoder_set_write_callback (dec->seekable_decoder, > gst_flac_dec_write_seekable); > FLAC__seekable_stream_decoder_set_metadata_respond (dec->seekable_decoder, >+#else >+ FLAC__stream_decoder_set_metadata_respond (dec->seekable_decoder, >+#endif > FLAC__METADATA_TYPE_VORBIS_COMMENT); >+#ifdef LEGACY_FLAC > FLAC__seekable_stream_decoder_set_metadata_callback (dec->seekable_decoder, > gst_flac_dec_metadata_callback_seekable); > FLAC__seekable_stream_decoder_set_error_callback (dec->seekable_decoder, > gst_flac_dec_error_callback_seekable); > FLAC__seekable_stream_decoder_set_client_data (dec->seekable_decoder, dec); >+#endif > } > >+#ifdef LEGACY_FLAC > static void > gst_flac_dec_setup_stream_decoder (GstFlacDec * dec) > { >@@ -282,6 +344,7 @@ > gst_flac_dec_error_callback_stream); > FLAC__stream_decoder_set_client_data (dec->stream_decoder, dec); > } >+#endif > > static void > gst_flac_dec_finalize (GObject * object) >@@ -545,7 +608,11 @@ > } > > static void >+#ifdef LEGACY_FLAC > gst_flac_dec_metadata_callback_seekable (const FLAC__SeekableStreamDecoder * d, >+#else >+gst_flac_dec_metadata_callback_seekable (const FLAC__StreamDecoder * d, >+#endif > const FLAC__StreamMetadata * metadata, void *client_data) > { > GstFlacDec *dec = GST_FLAC_DEC (client_data); >@@ -553,6 +620,7 @@ > gst_flac_dec_metadata_callback (dec, metadata); > } > >+#ifdef LEGACY_FLAC > static void > gst_flac_dec_metadata_callback_stream (const FLAC__StreamDecoder * decoder, > const FLAC__StreamMetadata * metadata, void *client_data) >@@ -561,6 +629,7 @@ > > gst_flac_dec_metadata_callback (dec, metadata); > } >+#endif > > static void > gst_flac_dec_error_callback (GstFlacDec * dec, >@@ -588,21 +657,32 @@ > } > > static void >+#ifdef LEGACY_FLAC > gst_flac_dec_error_callback_seekable (const FLAC__SeekableStreamDecoder * d, >+#else >+gst_flac_dec_error_callback_seekable (const FLAC__StreamDecoder * d, >+#endif > FLAC__StreamDecoderErrorStatus status, void *client_data) > { > gst_flac_dec_error_callback (GST_FLAC_DEC (client_data), status); > } > >+#ifdef LEGACY_FLAC > static void > gst_flac_dec_error_callback_stream (const FLAC__StreamDecoder * d, > FLAC__StreamDecoderErrorStatus status, void *client_data) > { > gst_flac_dec_error_callback (GST_FLAC_DEC (client_data), status); > } >+#endif > >+#ifdef LEGACY_FLAC > static FLAC__SeekableStreamDecoderSeekStatus > gst_flac_dec_seek (const FLAC__SeekableStreamDecoder * decoder, >+#else >+static FLAC__StreamDecoderSeekStatus >+gst_flac_dec_seek (const FLAC__StreamDecoder * decoder, >+#endif > FLAC__uint64 position, void *client_data) > { > GstFlacDec *flacdec; >@@ -612,11 +692,20 @@ > GST_DEBUG ("seek %" G_GINT64_FORMAT, position); > flacdec->offset = position; > >+#ifdef LEGACY_FLAC > return FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_OK; >+#else >+ return FLAC__STREAM_DECODER_SEEK_STATUS_OK; >+#endif > } > >+#ifdef LEGACY_FLAC > static FLAC__SeekableStreamDecoderTellStatus > gst_flac_dec_tell (const FLAC__SeekableStreamDecoder * decoder, >+#else >+static FLAC__StreamDecoderTellStatus >+gst_flac_dec_tell (const FLAC__StreamDecoder * decoder, >+#endif > FLAC__uint64 * position, void *client_data) > { > GstFlacDec *flacdec; >@@ -627,11 +716,20 @@ > > GST_DEBUG ("tell %" G_GINT64_FORMAT, *position); > >+#ifdef LEGACY_FLAC > return FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_OK; >+#else >+ return FLAC__STREAM_DECODER_TELL_STATUS_OK; >+#endif > } > >+#ifdef LEGACY_FLAC > static FLAC__SeekableStreamDecoderLengthStatus > gst_flac_dec_length (const FLAC__SeekableStreamDecoder * decoder, >+#else >+static FLAC__StreamDecoderLengthStatus >+gst_flac_dec_length (const FLAC__StreamDecoder * decoder, >+#endif > FLAC__uint64 * length, void *client_data) > { > GstFlacDec *flacdec; >@@ -642,21 +740,37 @@ > flacdec = GST_FLAC_DEC (client_data); > > if (!(peer = gst_pad_get_peer (flacdec->sinkpad))) >+#ifdef LEGACY_FLAC > return FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_ERROR; >+#else >+ return FLAC__STREAM_DECODER_LENGTH_STATUS_ERROR; >+#endif > gst_pad_query_duration (peer, &fmt, &len); > gst_object_unref (peer); > if (fmt != GST_FORMAT_BYTES || len == -1) >+#ifdef LEGACY_FLAC > return FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_ERROR; >+#else >+ return FLAC__STREAM_DECODER_LENGTH_STATUS_ERROR; >+#endif > > *length = len; > > GST_DEBUG ("length %" G_GINT64_FORMAT, *length); > >+#ifdef LEGACY_FLAC > return FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_OK; >+#else >+ return FLAC__STREAM_DECODER_LENGTH_STATUS_OK; >+#endif > } > > static FLAC__bool >+#ifdef LEGACY_FLAC > gst_flac_dec_eof (const FLAC__SeekableStreamDecoder * decoder, >+#else >+gst_flac_dec_eof (const FLAC__StreamDecoder * decoder, >+#endif > void *client_data) > { > GstFlacDec *flacdec; >@@ -685,9 +799,15 @@ > return ret; > } > >+#ifdef LEGACY_FLAC > static FLAC__SeekableStreamDecoderReadStatus > gst_flac_dec_read_seekable (const FLAC__SeekableStreamDecoder * decoder, > FLAC__byte buffer[], unsigned *bytes, void *client_data) >+#else >+static FLAC__StreamDecoderReadStatus >+gst_flac_dec_read_seekable (const FLAC__StreamDecoder * decoder, >+ FLAC__byte buffer[], size_t *bytes, void *client_data) >+#endif > { > GstFlacDec *flacdec; > GstBuffer *buf; >@@ -696,7 +816,11 @@ > > if (gst_pad_pull_range (flacdec->sinkpad, flacdec->offset, *bytes, > &buf) != GST_FLOW_OK) >+#ifdef LEGACY_FLAC > return FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_ERROR; >+#else >+ return FLAC__STREAM_DECODER_READ_STATUS_ABORT; >+#endif > > GST_DEBUG ("Read %d bytes at %" G_GUINT64_FORMAT, > GST_BUFFER_SIZE (buf), flacdec->offset); >@@ -705,7 +829,11 @@ > gst_buffer_unref (buf); > flacdec->offset += *bytes; > >+#ifdef LEGACY_FLAC > return FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_OK; >+#else >+ return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE; >+#endif > } > > static FLAC__StreamDecoderReadStatus >@@ -881,13 +1009,18 @@ > } > > static FLAC__StreamDecoderWriteStatus >+#ifdef LEGACY_FLAC > gst_flac_dec_write_seekable (const FLAC__SeekableStreamDecoder * decoder, >+#else >+gst_flac_dec_write_seekable (const FLAC__StreamDecoder * decoder, >+#endif > const FLAC__Frame * frame, > const FLAC__int32 * const buffer[], void *client_data) > { > return gst_flac_dec_write (GST_FLAC_DEC (client_data), frame, buffer); > } > >+#ifdef LEGACY_FLAC > static FLAC__StreamDecoderWriteStatus > gst_flac_dec_write_stream (const FLAC__StreamDecoder * decoder, > const FLAC__Frame * frame, >@@ -895,12 +1028,17 @@ > { > return gst_flac_dec_write (GST_FLAC_DEC (client_data), frame, buffer); > } >+#endif > > static void > gst_flac_dec_loop (GstPad * sinkpad) > { > GstFlacDec *flacdec; >+#ifdef LEGACY_FLAC > FLAC__SeekableStreamDecoderState s; >+#else >+ FLAC__StreamDecoderState s; >+#endif > > flacdec = GST_FLAC_DEC (GST_OBJECT_PARENT (sinkpad)); > >@@ -908,10 +1046,28 @@ > > if (flacdec->init) { > GST_DEBUG_OBJECT (flacdec, "initializing decoder"); >+#ifdef LEGACY_FLAC > s = FLAC__seekable_stream_decoder_init (flacdec->seekable_decoder); > if (s != FLAC__SEEKABLE_STREAM_DECODER_OK) >+#else >+ s = FLAC__stream_decoder_init_stream (flacdec->seekable_decoder, >+ gst_flac_dec_read_seekable, >+ gst_flac_dec_seek, >+ gst_flac_dec_tell, >+ gst_flac_dec_length, >+ gst_flac_dec_eof, >+ gst_flac_dec_write_seekable, >+ gst_flac_dec_metadata_callback_seekable, >+ gst_flac_dec_error_callback_seekable, >+ flacdec); >+ if (s != FLAC__STREAM_DECODER_INIT_STATUS_OK) >+#endif > goto analyze_state; >+#ifdef LEGACY_FLAC > /* FLAC__seekable_stream_decoder_process_metadata (flacdec->seekable_decoder); */ >+#else >+ /* FLAC__stream_decoder_process_metadata (flacdec->seekable_decoder); */ >+#endif > flacdec->init = FALSE; > } > >@@ -920,15 +1076,28 @@ > flacdec->last_flow = GST_FLOW_OK; > > GST_LOG_OBJECT (flacdec, "processing single"); >+#ifdef LEGACY_FLAC > FLAC__seekable_stream_decoder_process_single (flacdec->seekable_decoder); >+#else >+ FLAC__stream_decoder_process_single (flacdec->seekable_decoder); >+#endif > > analyze_state: > > GST_LOG_OBJECT (flacdec, "done processing, checking encoder state"); >+#ifdef LEGACY_FLAC > s = FLAC__seekable_stream_decoder_get_state (flacdec->seekable_decoder); > switch (s) { > case FLAC__SEEKABLE_STREAM_DECODER_OK: > case FLAC__SEEKABLE_STREAM_DECODER_SEEKING:{ >+#else >+ s = FLAC__stream_decoder_get_state (flacdec->seekable_decoder); >+ switch (s) { >+ case FLAC__STREAM_DECODER_INIT_STATUS_OK: >+ case FLAC__STREAM_DECODER_READ_METADATA: >+ case FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC: >+ case FLAC__STREAM_DECODER_READ_FRAME:{ >+#endif > GST_DEBUG_OBJECT (flacdec, "everything ok"); > > if (flacdec->last_flow != GST_FLOW_OK && >@@ -956,9 +1125,17 @@ > return; > } > >+#ifdef LEGACY_FLAC > case FLAC__SEEKABLE_STREAM_DECODER_END_OF_STREAM:{ >+#else >+ case FLAC__STREAM_DECODER_END_OF_STREAM:{ >+#endif > GST_DEBUG_OBJECT (flacdec, "EOS"); >+#ifdef LEGACY_FLAC > FLAC__seekable_stream_decoder_reset (flacdec->seekable_decoder); >+#else >+ FLAC__stream_decoder_reset (flacdec->seekable_decoder); >+#endif > > if ((flacdec->segment.flags & GST_SEEK_FLAG_SEGMENT) != 0) { > if (flacdec->segment.duration > 0) { >@@ -972,6 +1149,7 @@ > goto eos_and_pause; > } > >+#ifdef LEGACY_FLAC > case FLAC__SEEKABLE_STREAM_DECODER_MEMORY_ALLOCATION_ERROR: > case FLAC__SEEKABLE_STREAM_DECODER_STREAM_DECODER_ERROR: > case FLAC__SEEKABLE_STREAM_DECODER_READ_ERROR: >@@ -979,11 +1157,22 @@ > case FLAC__SEEKABLE_STREAM_DECODER_ALREADY_INITIALIZED: > case FLAC__SEEKABLE_STREAM_DECODER_INVALID_CALLBACK: > case FLAC__SEEKABLE_STREAM_DECODER_UNINITIALIZED: >+#else >+ case FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR: >+ case FLAC__STREAM_DECODER_OGG_ERROR: >+ case FLAC__STREAM_DECODER_SEEK_ERROR: >+ case FLAC__STREAM_DECODER_ABORTED: >+ case FLAC__STREAM_DECODER_UNINITIALIZED: >+#endif > default:{ > /* fixme: this error sucks -- should try to figure out when/if an more > specific error was already sent via the callback */ > GST_ELEMENT_ERROR (flacdec, STREAM, DECODE, (NULL), >+#ifdef LEGACY_FLAC > ("%s", FLAC__SeekableStreamDecoderStateString[s])); >+#else >+ ("%s", FLAC__StreamDecoderStateString[s])); >+#endif > goto eos_and_pause; > } > } >@@ -1032,8 +1221,13 @@ > > switch (GST_EVENT_TYPE (event)) { > case GST_EVENT_FLUSH_STOP:{ >+#ifdef LEGACY_FLAC > if (dec->stream_decoder) { > FLAC__stream_decoder_flush (dec->stream_decoder); >+#else >+ if (dec->seekable_decoder) { >+ FLAC__stream_decoder_flush (dec->seekable_decoder); >+#endif > gst_adapter_clear (dec->adapter); > } > res = gst_pad_push_event (dec->srcpad, event); >@@ -1081,9 +1275,15 @@ > GST_LOG_OBJECT (dec, "EOS, with %u bytes available in adapter", > gst_adapter_available (dec->adapter)); > if (gst_adapter_available (dec->adapter) > 0) { >+#ifdef LEGACY_FLAC > FLAC__stream_decoder_process_until_end_of_stream (dec->stream_decoder); > } > FLAC__stream_decoder_flush (dec->stream_decoder); >+#else >+ FLAC__stream_decoder_process_until_end_of_stream (dec->seekable_decoder); >+ } >+ FLAC__stream_decoder_flush (dec->seekable_decoder); >+#endif > gst_adapter_clear (dec->adapter); > res = gst_pad_push_event (dec->srcpad, event); > break; >@@ -1113,7 +1313,20 @@ > > if (dec->init) { > GST_DEBUG_OBJECT (dec, "initializing decoder"); >+#ifdef LEGACY_FLAC > s = FLAC__stream_decoder_init (dec->stream_decoder); >+#else >+ s = FLAC__stream_decoder_init_stream (dec->seekable_decoder, >+ gst_flac_dec_read_stream, >+ NULL, >+ NULL, >+ NULL, >+ NULL, >+ gst_flac_dec_write_seekable, >+ gst_flac_dec_metadata_callback_seekable, >+ gst_flac_dec_error_callback_seekable, >+ (void*)dec); >+#endif > if (s != FLAC__STREAM_DECODER_SEARCH_FOR_METADATA) { > GST_ELEMENT_ERROR (GST_ELEMENT (dec), LIBRARY, INIT, (NULL), (NULL)); > return GST_FLOW_ERROR; >@@ -1125,7 +1338,11 @@ > if (GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_FLAG_DISCONT)) { > /* Clear the adapter and the decoder */ > gst_adapter_clear (dec->adapter); >+#ifdef LEGACY_FLAC > FLAC__stream_decoder_flush (dec->stream_decoder); >+#else >+ FLAC__stream_decoder_flush (dec->seekable_decoder); >+#endif > } > > if (dec->framed) { >@@ -1162,7 +1379,11 @@ > dec->last_flow == GST_FLOW_OK) { > GST_LOG_OBJECT (dec, "%u bytes available", > gst_adapter_available (dec->adapter)); >+#ifdef LEGACY_FLAC > if (!FLAC__stream_decoder_process_single (dec->stream_decoder)) { >+#else >+ if (!FLAC__stream_decoder_process_single (dec->seekable_decoder)) { >+#endif > GST_DEBUG_OBJECT (dec, "process_single failed"); > break; > } >@@ -1171,7 +1392,11 @@ > /* framed - there should always be enough data to decode something */ > GST_LOG_OBJECT (dec, "%u bytes available", > gst_adapter_available (dec->adapter)); >+#ifdef LEGACY_FLAC > if (!FLAC__stream_decoder_process_single (dec->stream_decoder)) { >+#else >+ if (!FLAC__stream_decoder_process_single (dec->seekable_decoder)) { >+#endif > GST_DEBUG_OBJECT (dec, "process_single failed"); > } > } else { >@@ -1598,7 +1823,11 @@ > flacdec->seeking = TRUE; > > seek_ok = >+#ifdef LEGACY_FLAC > FLAC__seekable_stream_decoder_seek_absolute (flacdec->seekable_decoder, >+#else >+ FLAC__stream_decoder_seek_absolute (flacdec->seekable_decoder, >+#endif > segment.start); > > flacdec->seeking = FALSE; >@@ -1681,7 +1910,11 @@ > { > GstFlacDec *dec = GST_FLAC_DEC (GST_OBJECT_PARENT (sinkpad)); > >+#ifdef LEGACY_FLAC > gst_flac_dec_setup_stream_decoder (dec); >+#else >+ gst_flac_dec_setup_seekable_decoder (dec); >+#endif > return TRUE; > } > >diff -urN gst-plugins-good-0.10.5.orig/ext/flac/gstflacdec.h gst-plugins-good-0.10.5/ext/flac/gstflacdec.h >--- gst-plugins-good-0.10.5.orig/ext/flac/gstflacdec.h 2006-08-22 15:28:24 +0300 >+++ gst-plugins-good-0.10.5/ext/flac/gstflacdec.h 2007-02-26 14:03:56 +0200 >@@ -27,6 +27,13 @@ > > #include <FLAC/all.h> > >+/* FLAC 1.1.3 has FLAC_API_VERSION_CURRENT == 8 */ >+#if !defined(FLAC_API_VERSION_CURRENT) || FLAC_API_VERSION_CURRENT < 8 >+#define LEGACY_FLAC >+#else >+#undef LEGACY_FLAC >+#endif >+ > G_BEGIN_DECLS > > #define GST_TYPE_FLAC_DEC gst_flac_dec_get_type() >@@ -41,9 +48,13 @@ > struct _GstFlacDec { > GstElement element; > >+#ifdef LEGACY_FLAC > FLAC__SeekableStreamDecoder *seekable_decoder; /* for pull-based operation */ > > FLAC__StreamDecoder *stream_decoder; /* for chain-based operation */ >+#else >+ FLAC__StreamDecoder *seekable_decoder; /* for pull-based operation */ >+#endif > GstAdapter *adapter; > gboolean framed; > >diff -urN gst-plugins-good-0.10.5.orig/ext/flac/gstflacenc.c gst-plugins-good-0.10.5/ext/flac/gstflacenc.c >--- gst-plugins-good-0.10.5.orig/ext/flac/gstflacenc.c 2006-10-16 21:22:46 +0300 >+++ gst-plugins-good-0.10.5/ext/flac/gstflacenc.c 2007-02-26 14:14:09 +0200 >@@ -109,14 +109,28 @@ > GstStateChange transition); > > static FLAC__StreamEncoderWriteStatus >+#ifdef LEGACY_FLAC > gst_flac_enc_write_callback (const FLAC__SeekableStreamEncoder * encoder, >+#else >+gst_flac_enc_write_callback (const FLAC__StreamEncoder * encoder, >+#endif > const FLAC__byte buffer[], unsigned bytes, > unsigned samples, unsigned current_frame, void *client_data); >+#ifdef LEGACY_FLAC > static FLAC__SeekableStreamEncoderSeekStatus > gst_flac_enc_seek_callback (const FLAC__SeekableStreamEncoder * encoder, >+#else >+static FLAC__StreamEncoderSeekStatus >+gst_flac_enc_seek_callback (const FLAC__StreamEncoder * encoder, >+#endif > FLAC__uint64 absolute_byte_offset, void *client_data); >+#ifdef LEGACY_FLAC > static FLAC__SeekableStreamEncoderTellStatus > gst_flac_enc_tell_callback (const FLAC__SeekableStreamEncoder * encoder, >+#else >+static FLAC__StreamEncoderTellStatus >+gst_flac_enc_tell_callback (const FLAC__StreamEncoder * encoder, >+#endif > FLAC__uint64 * absolute_byte_offset, void *client_data); > > typedef struct >@@ -302,7 +316,11 @@ > gst_pad_use_fixed_caps (flacenc->srcpad); > gst_element_add_pad (GST_ELEMENT (flacenc), flacenc->srcpad); > >+#ifdef LEGACY_FLAC > flacenc->encoder = FLAC__seekable_stream_encoder_new (); >+#else >+ flacenc->encoder = FLAC__stream_encoder_new (); >+#endif > > flacenc->offset = 0; > flacenc->samples_written = 0; >@@ -315,7 +333,11 @@ > { > GstFlacEnc *flacenc = GST_FLAC_ENC (object); > >+#ifdef LEGACY_FLAC > FLAC__seekable_stream_encoder_delete (flacenc->encoder); >+#else >+ FLAC__stream_encoder_delete (flacenc->encoder); >+#endif > > G_OBJECT_CLASS (parent_class)->finalize (object); > } >@@ -360,7 +382,11 @@ > FLAC__metadata_object_new (FLAC__METADATA_TYPE_VORBIS_COMMENT); > gst_tag_list_foreach (copy, add_one_tag, flacenc); > >+#ifdef LEGACY_FLAC > if (FLAC__seekable_stream_encoder_set_metadata (flacenc->encoder, >+#else >+ if (FLAC__stream_encoder_set_metadata (flacenc->encoder, >+#endif > flacenc->meta, 1) != true) > g_warning ("Dude, i'm already initialized!"); > gst_tag_list_free (copy); >@@ -371,13 +397,22 @@ > { > GstFlacEnc *flacenc; > GstStructure *structure; >+#ifdef LEGACY_FLAC > FLAC__SeekableStreamEncoderState state; >+#else >+ FLAC__StreamEncoderState state; >+#endif > > /* takes a ref on flacenc */ > flacenc = GST_FLAC_ENC (gst_pad_get_parent (pad)); > >+#ifdef LEGACY_FLAC > if (FLAC__seekable_stream_encoder_get_state (flacenc->encoder) != > FLAC__SEEKABLE_STREAM_ENCODER_UNINITIALIZED) >+#else >+ if (FLAC__stream_encoder_get_state (flacenc->encoder) != >+ FLAC__STREAM_ENCODER_UNINITIALIZED) >+#endif > goto encoder_already_initialized; > > structure = gst_caps_get_structure (caps, 0); >@@ -397,13 +432,23 @@ > > gst_caps_unref (caps); > >+#ifdef LEGACY_FLAC > FLAC__seekable_stream_encoder_set_bits_per_sample (flacenc->encoder, > flacenc->depth); > FLAC__seekable_stream_encoder_set_sample_rate (flacenc->encoder, > flacenc->sample_rate); > FLAC__seekable_stream_encoder_set_channels (flacenc->encoder, > flacenc->channels); >+#else >+ FLAC__stream_encoder_set_bits_per_sample (flacenc->encoder, >+ flacenc->depth); >+ FLAC__stream_encoder_set_sample_rate (flacenc->encoder, >+ flacenc->sample_rate); >+ FLAC__stream_encoder_set_channels (flacenc->encoder, >+ flacenc->channels); >+#endif > >+#ifdef LEGACY_FLAC > FLAC__seekable_stream_encoder_set_write_callback (flacenc->encoder, > gst_flac_enc_write_callback); > FLAC__seekable_stream_encoder_set_seek_callback (flacenc->encoder, >@@ -412,11 +457,22 @@ > gst_flac_enc_tell_callback); > > FLAC__seekable_stream_encoder_set_client_data (flacenc->encoder, flacenc); >+#endif > > gst_flac_enc_set_metadata (flacenc); > >+#ifdef LEGACY_FLAC > state = FLAC__seekable_stream_encoder_init (flacenc->encoder); > if (state != FLAC__STREAM_ENCODER_OK) >+#else >+ state = FLAC__stream_encoder_init_stream (flacenc->encoder, >+ gst_flac_enc_write_callback, >+ gst_flac_enc_seek_callback, >+ gst_flac_enc_tell_callback, >+ NULL, >+ flacenc); >+ if (state != FLAC__STREAM_ENCODER_INIT_STATUS_OK) >+#endif > goto failed_to_initialize; > > gst_object_unref (flacenc); >@@ -451,6 +507,7 @@ > { > flacenc->quality = quality; > >+#ifdef LEGACY_FLAC > #define DO_UPDATE(name, val, str) \ > G_STMT_START { \ > if (FLAC__seekable_stream_encoder_get_##name (flacenc->encoder) != \ >@@ -460,6 +517,17 @@ > g_object_notify (G_OBJECT (flacenc), str); \ > } \ > } G_STMT_END >+#else >+#define DO_UPDATE(name, val, str) \ >+ G_STMT_START { \ >+ if (FLAC__stream_encoder_get_##name (flacenc->encoder) != \ >+ flacenc_params[quality].val) { \ >+ FLAC__stream_encoder_set_##name (flacenc->encoder, \ >+ flacenc_params[quality].val); \ >+ g_object_notify (G_OBJECT (flacenc), str); \ >+ } \ >+ } G_STMT_END >+#endif > > g_object_freeze_notify (G_OBJECT (flacenc)); > >@@ -490,8 +558,13 @@ > return TRUE; > } > >+#ifdef LEGACY_FLAC > static FLAC__SeekableStreamEncoderSeekStatus > gst_flac_enc_seek_callback (const FLAC__SeekableStreamEncoder * encoder, >+#else >+static FLAC__StreamEncoderSeekStatus >+gst_flac_enc_seek_callback (const FLAC__StreamEncoder * encoder, >+#endif > FLAC__uint64 absolute_byte_offset, void *client_data) > { > GstFlacEnc *flacenc; >@@ -501,7 +574,11 @@ > flacenc = GST_FLAC_ENC (client_data); > > if (flacenc->stopped) >+#ifdef LEGACY_FLAC > return FLAC__SEEKABLE_STREAM_ENCODER_SEEK_STATUS_OK; >+#else >+ return FLAC__STREAM_ENCODER_SEEK_STATUS_OK; >+#endif > > event = gst_event_new_new_segment (TRUE, 1.0, GST_FORMAT_BYTES, > absolute_byte_offset, GST_BUFFER_OFFSET_NONE, 0); >@@ -525,11 +602,19 @@ > > flacenc->offset = absolute_byte_offset; > >+#ifdef LEGACY_FLAC > return FLAC__SEEKABLE_STREAM_ENCODER_SEEK_STATUS_OK; >+#else >+ return FLAC__STREAM_ENCODER_SEEK_STATUS_OK; >+#endif > } > > static FLAC__StreamEncoderWriteStatus >+#ifdef LEGACY_FLAC > gst_flac_enc_write_callback (const FLAC__SeekableStreamEncoder * encoder, >+#else >+gst_flac_enc_write_callback (const FLAC__StreamEncoder * encoder, >+#endif > const FLAC__byte buffer[], unsigned bytes, > unsigned samples, unsigned current_frame, void *client_data) > { >@@ -577,15 +662,24 @@ > return FLAC__STREAM_ENCODER_WRITE_STATUS_OK; > } > >+#ifdef LEGACY_FLAC > static FLAC__SeekableStreamEncoderTellStatus > gst_flac_enc_tell_callback (const FLAC__SeekableStreamEncoder * encoder, >+#else >+static FLAC__StreamEncoderTellStatus >+gst_flac_enc_tell_callback (const FLAC__StreamEncoder * encoder, >+#endif > FLAC__uint64 * absolute_byte_offset, void *client_data) > { > GstFlacEnc *flacenc = GST_FLAC_ENC (client_data); > > *absolute_byte_offset = flacenc->offset; > >+#ifdef LEGACY_FLAC > return FLAC__SEEKABLE_STREAM_ENCODER_TELL_STATUS_OK; >+#else >+ return FLAC__STREAM_ENCODER_TELL_STATUS_OK; >+#endif > } > > static gboolean >@@ -629,7 +723,11 @@ > break; > } > case GST_EVENT_EOS: >+#ifdef LEGACY_FLAC > FLAC__seekable_stream_encoder_finish (flacenc->encoder); >+#else >+ FLAC__stream_encoder_finish (flacenc->encoder); >+#endif > ret = gst_pad_event_default (pad, event); > break; > case GST_EVENT_TAG: >@@ -686,7 +784,11 @@ > > gst_buffer_unref (buffer); > >+#ifdef LEGACY_FLAC > res = FLAC__seekable_stream_encoder_process_interleaved (flacenc->encoder, >+#else >+ res = FLAC__stream_encoder_process_interleaved (flacenc->encoder, >+#endif > (const FLAC__int32 *) data, samples / flacenc->channels); > > g_free (data); >@@ -712,51 +814,99 @@ > gst_flac_enc_update_quality (this, g_value_get_enum (value)); > break; > case PROP_STREAMABLE_SUBSET: >+#ifdef LEGACY_FLAC > FLAC__seekable_stream_encoder_set_streamable_subset (this->encoder, >+#else >+ FLAC__stream_encoder_set_streamable_subset (this->encoder, >+#endif > g_value_get_boolean (value)); > break; > case PROP_MID_SIDE_STEREO: >+#ifdef LEGACY_FLAC > FLAC__seekable_stream_encoder_set_do_mid_side_stereo (this->encoder, >+#else >+ FLAC__stream_encoder_set_do_mid_side_stereo (this->encoder, >+#endif > g_value_get_boolean (value)); > break; > case PROP_LOOSE_MID_SIDE_STEREO: >+#ifdef LEGACY_FLAC > FLAC__seekable_stream_encoder_set_loose_mid_side_stereo (this->encoder, >+#else >+ FLAC__stream_encoder_set_loose_mid_side_stereo (this->encoder, >+#endif > g_value_get_boolean (value)); > break; > case PROP_BLOCKSIZE: >+#ifdef LEGACY_FLAC > FLAC__seekable_stream_encoder_set_blocksize (this->encoder, >+#else >+ FLAC__stream_encoder_set_blocksize (this->encoder, >+#endif > g_value_get_uint (value)); > break; > case PROP_MAX_LPC_ORDER: >+#ifdef LEGACY_FLAC > FLAC__seekable_stream_encoder_set_max_lpc_order (this->encoder, >+#else >+ FLAC__stream_encoder_set_max_lpc_order (this->encoder, >+#endif > g_value_get_uint (value)); > break; > case PROP_QLP_COEFF_PRECISION: >+#ifdef LEGACY_FLAC > FLAC__seekable_stream_encoder_set_qlp_coeff_precision (this->encoder, >+#else >+ FLAC__stream_encoder_set_qlp_coeff_precision (this->encoder, >+#endif > g_value_get_uint (value)); > break; > case PROP_QLP_COEFF_PREC_SEARCH: >+#ifdef LEGACY_FLAC > FLAC__seekable_stream_encoder_set_do_qlp_coeff_prec_search (this->encoder, >+#else >+ FLAC__stream_encoder_set_do_qlp_coeff_prec_search (this->encoder, >+#endif > g_value_get_boolean (value)); > break; > case PROP_ESCAPE_CODING: >+#ifdef LEGACY_FLAC > FLAC__seekable_stream_encoder_set_do_escape_coding (this->encoder, >+#else >+ FLAC__stream_encoder_set_do_escape_coding (this->encoder, >+#endif > g_value_get_boolean (value)); > break; > case PROP_EXHAUSTIVE_MODEL_SEARCH: >+#ifdef LEGACY_FLAC > FLAC__seekable_stream_encoder_set_do_exhaustive_model_search (this-> >+#else >+ FLAC__stream_encoder_set_do_exhaustive_model_search (this-> >+#endif > encoder, g_value_get_boolean (value)); > break; > case PROP_MIN_RESIDUAL_PARTITION_ORDER: >+#ifdef LEGACY_FLAC > FLAC__seekable_stream_encoder_set_min_residual_partition_order (this-> >+#else >+ FLAC__stream_encoder_set_min_residual_partition_order (this-> >+#endif > encoder, g_value_get_uint (value)); > break; > case PROP_MAX_RESIDUAL_PARTITION_ORDER: >+#ifdef LEGACY_FLAC > FLAC__seekable_stream_encoder_set_max_residual_partition_order (this-> >+#else >+ FLAC__stream_encoder_set_max_residual_partition_order (this-> >+#endif > encoder, g_value_get_uint (value)); > break; > case PROP_RICE_PARAMETER_SEARCH_DIST: >+#ifdef LEGACY_FLAC > FLAC__seekable_stream_encoder_set_rice_parameter_search_dist (this-> >+#else >+ FLAC__stream_encoder_set_rice_parameter_search_dist (this-> >+#endif > encoder, g_value_get_uint (value)); > break; > default: >@@ -781,57 +931,105 @@ > break; > case PROP_STREAMABLE_SUBSET: > g_value_set_boolean (value, >+#ifdef LEGACY_FLAC > FLAC__seekable_stream_encoder_get_streamable_subset (this->encoder)); >+#else >+ FLAC__stream_encoder_get_streamable_subset (this->encoder)); >+#endif > break; > case PROP_MID_SIDE_STEREO: > g_value_set_boolean (value, >+#ifdef LEGACY_FLAC > FLAC__seekable_stream_encoder_get_do_mid_side_stereo (this->encoder)); >+#else >+ FLAC__stream_encoder_get_do_mid_side_stereo (this->encoder)); >+#endif > break; > case PROP_LOOSE_MID_SIDE_STEREO: > g_value_set_boolean (value, >+#ifdef LEGACY_FLAC > FLAC__seekable_stream_encoder_get_loose_mid_side_stereo (this-> >+#else >+ FLAC__stream_encoder_get_loose_mid_side_stereo (this-> >+#endif > encoder)); > break; > case PROP_BLOCKSIZE: > g_value_set_uint (value, >+#ifdef LEGACY_FLAC > FLAC__seekable_stream_encoder_get_blocksize (this->encoder)); >+#else >+ FLAC__stream_encoder_get_blocksize (this->encoder)); >+#endif > break; > case PROP_MAX_LPC_ORDER: > g_value_set_uint (value, >+#ifdef LEGACY_FLAC > FLAC__seekable_stream_encoder_get_max_lpc_order (this->encoder)); >+#else >+ FLAC__stream_encoder_get_max_lpc_order (this->encoder)); >+#endif > break; > case PROP_QLP_COEFF_PRECISION: > g_value_set_uint (value, >+#ifdef LEGACY_FLAC > FLAC__seekable_stream_encoder_get_qlp_coeff_precision (this-> >+#else >+ FLAC__stream_encoder_get_qlp_coeff_precision (this-> >+#endif > encoder)); > break; > case PROP_QLP_COEFF_PREC_SEARCH: > g_value_set_boolean (value, >+#ifdef LEGACY_FLAC > FLAC__seekable_stream_encoder_get_do_qlp_coeff_prec_search (this-> >+#else >+ FLAC__stream_encoder_get_do_qlp_coeff_prec_search (this-> >+#endif > encoder)); > break; > case PROP_ESCAPE_CODING: > g_value_set_boolean (value, >+#ifdef LEGACY_FLAC > FLAC__seekable_stream_encoder_get_do_escape_coding (this->encoder)); >+#else >+ FLAC__stream_encoder_get_do_escape_coding (this->encoder)); >+#endif > break; > case PROP_EXHAUSTIVE_MODEL_SEARCH: > g_value_set_boolean (value, >+#ifdef LEGACY_FLAC > FLAC__seekable_stream_encoder_get_do_exhaustive_model_search (this-> >+#else >+ FLAC__stream_encoder_get_do_exhaustive_model_search (this-> >+#endif > encoder)); > break; > case PROP_MIN_RESIDUAL_PARTITION_ORDER: > g_value_set_uint (value, >+#ifdef LEGACY_FLAC > FLAC__seekable_stream_encoder_get_min_residual_partition_order (this-> >+#else >+ FLAC__stream_encoder_get_min_residual_partition_order (this-> >+#endif > encoder)); > break; > case PROP_MAX_RESIDUAL_PARTITION_ORDER: > g_value_set_uint (value, >+#ifdef LEGACY_FLAC > FLAC__seekable_stream_encoder_get_max_residual_partition_order (this-> >+#else >+ FLAC__stream_encoder_get_max_residual_partition_order (this-> >+#endif > encoder)); > break; > case PROP_RICE_PARAMETER_SEARCH_DIST: > g_value_set_uint (value, >+#ifdef LEGACY_FLAC > FLAC__seekable_stream_encoder_get_rice_parameter_search_dist (this-> >+#else >+ FLAC__stream_encoder_get_rice_parameter_search_dist (this-> >+#endif > encoder)); > break; > default: >@@ -864,10 +1062,18 @@ > case GST_STATE_CHANGE_PLAYING_TO_PAUSED: > break; > case GST_STATE_CHANGE_PAUSED_TO_READY: >+#ifdef LEGACY_FLAC > if (FLAC__seekable_stream_encoder_get_state (flacenc->encoder) != >+#else >+ if (FLAC__stream_encoder_get_state (flacenc->encoder) != >+#endif > FLAC__STREAM_ENCODER_UNINITIALIZED) { > flacenc->stopped = TRUE; >+#ifdef LEGACY_FLAC > FLAC__seekable_stream_encoder_finish (flacenc->encoder); >+#else >+ FLAC__stream_encoder_finish (flacenc->encoder); >+#endif > } > flacenc->offset = 0; > flacenc->samples_written = 0; >diff -urN gst-plugins-good-0.10.5.orig/ext/flac/gstflacenc.h gst-plugins-good-0.10.5/ext/flac/gstflacenc.h >--- gst-plugins-good-0.10.5.orig/ext/flac/gstflacenc.h 2006-06-02 00:07:23 +0300 >+++ gst-plugins-good-0.10.5/ext/flac/gstflacenc.h 2007-02-26 14:03:56 +0200 >@@ -25,6 +25,13 @@ > > #include <FLAC/all.h> > >+/* FLAC 1.1.3 has FLAC_API_VERSION_CURRENT == 8 */ >+#if !defined(FLAC_API_VERSION_CURRENT) || FLAC_API_VERSION_CURRENT < 8 >+#define LEGACY_FLAC >+#else >+#undef LEGACY_FLAC >+#endif >+ > G_BEGIN_DECLS > > #define GST_TYPE_FLAC_ENC (gst_flac_enc_get_type()) >@@ -54,7 +61,11 @@ > gboolean stopped; > FLAC__int32 *data; > >+#ifdef LEGACY_FLAC > FLAC__SeekableStreamEncoder *encoder; >+#else >+ FLAC__StreamEncoder *encoder; >+#endif > FLAC__StreamMetadata **meta; > > GstTagList * tags;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 10940
: 1836