]> git.pld-linux.org Git - packages/gstreamer-plugins-good.git/blob - gstreamer-plugins-good-flac.patch
41c0f4cadcfb2c5677cadc79045ceb20028152f2
[packages/gstreamer-plugins-good.git] / gstreamer-plugins-good-flac.patch
1 --- gst-plugins-good-0.10.5/configure.ac.orig   2006-12-24 16:17:41.709930000 +0100
2 +++ gst-plugins-good-0.10.5/configure.ac        2006-12-24 21:17:31.439106784 +0100
3 @@ -551,14 +551,12 @@
4  dnl *** FLAC ***
5  translit(dnm, m, l) AM_CONDITIONAL(USE_FLAC, true)
6  GST_CHECK_FEATURE(FLAC, [FLAC lossless audio], flac, [
7 -  GST_CHECK_LIBHEADER(FLAC, FLAC, FLAC__seekable_stream_encoder_new, -lm, FLAC/all.h, FLAC_LIBS="-lFLAC -lm")
8 -  dnl API change in FLAC 1.1.1, so require that...
9 -  dnl (this check will also fail with FLAC 1.1.3 which changed API again
10 -  dnl and with which our plugin does not compile or work yet)
11 +  GST_CHECK_LIBHEADER(FLAC, FLAC, FLAC__stream_encoder_init_stream, -lm, FLAC/all.h, FLAC_LIBS="-lFLAC -lm")
12 +  dnl API change in FLAC 1.1.3, so require that...
13    if test x$HAVE_FLAC = xyes; then
14 -    AC_CHECK_DECL(FLAC__SEEKABLE_STREAM_ENCODER_TELL_ERROR,
15 +    AC_CHECK_DECL(FLAC__STREAM_ENCODER_TELL_STATUS_ERROR,
16                    HAVE_FLAC="yes", HAVE_FLAC="no", [
17 -#include <FLAC/seekable_stream_encoder.h>
18 +#include <FLAC/stream_encoder.h>
19                    ])
20    fi
21    AC_SUBST(FLAC_LIBS)
22 --- gst-plugins-good-0.10.5/ext/flac/gstflacdec.c.orig  2006-10-16 20:22:46.000000000 +0200
23 +++ gst-plugins-good-0.10.5/ext/flac/gstflacdec.c       2006-12-24 22:38:53.641327632 +0100
24 @@ -93,25 +93,25 @@
25  static void gst_flac_dec_setup_seekable_decoder (GstFlacDec * flacdec);
26  static void gst_flac_dec_setup_stream_decoder (GstFlacDec * flacdec);
27  
28 -static FLAC__SeekableStreamDecoderReadStatus
29 -gst_flac_dec_read_seekable (const FLAC__SeekableStreamDecoder * decoder,
30 +static FLAC__StreamDecoderReadStatus
31 +gst_flac_dec_read_seekable (const FLAC__StreamDecoder * decoder,
32      FLAC__byte buffer[], unsigned *bytes, void *client_data);
33 -static FLAC__SeekableStreamDecoderSeekStatus
34 -gst_flac_dec_seek (const FLAC__SeekableStreamDecoder * decoder,
35 +static FLAC__StreamDecoderSeekStatus
36 +gst_flac_dec_seek (const FLAC__StreamDecoder * decoder,
37      FLAC__uint64 position, void *client_data);
38 -static FLAC__SeekableStreamDecoderTellStatus
39 -gst_flac_dec_tell (const FLAC__SeekableStreamDecoder * decoder,
40 +static FLAC__StreamDecoderTellStatus
41 +gst_flac_dec_tell (const FLAC__StreamDecoder * decoder,
42      FLAC__uint64 * position, void *client_data);
43 -static FLAC__SeekableStreamDecoderLengthStatus
44 -gst_flac_dec_length (const FLAC__SeekableStreamDecoder * decoder,
45 +static FLAC__StreamDecoderLengthStatus
46 +gst_flac_dec_length (const FLAC__StreamDecoder * decoder,
47      FLAC__uint64 * length, void *client_data);
48 -static FLAC__bool gst_flac_dec_eof (const FLAC__SeekableStreamDecoder * decoder,
49 +static FLAC__bool gst_flac_dec_eof (const FLAC__StreamDecoder * decoder,
50      void *client_data);
51  static FLAC__StreamDecoderReadStatus
52  gst_flac_dec_read_stream (const FLAC__StreamDecoder * decoder,
53      FLAC__byte buffer[], unsigned *bytes, void *client_data);
54  static FLAC__StreamDecoderWriteStatus
55 -gst_flac_dec_write_seekable (const FLAC__SeekableStreamDecoder * decoder,
56 +gst_flac_dec_write_seekable (const FLAC__StreamDecoder * decoder,
57      const FLAC__Frame * frame,
58      const FLAC__int32 * const buffer[], void *client_data);
59  static FLAC__StreamDecoderWriteStatus
60 @@ -119,14 +119,14 @@
61      const FLAC__Frame * frame,
62      const FLAC__int32 * const buffer[], void *client_data);
63  static void gst_flac_dec_metadata_callback_seekable (const
64 -    FLAC__SeekableStreamDecoder * decoder,
65 +    FLAC__StreamDecoder * decoder,
66      const FLAC__StreamMetadata * metadata, void *client_data);
67  static void gst_flac_dec_metadata_callback_stream (const FLAC__StreamDecoder *
68      decoder, const FLAC__StreamMetadata * metadata, void *client_data);
69  static void gst_flac_dec_metadata_callback (GstFlacDec * flacdec,
70      const FLAC__StreamMetadata * metadata);
71  static void gst_flac_dec_error_callback_seekable (const
72 -    FLAC__SeekableStreamDecoder * decoder,
73 +    FLAC__StreamDecoder * decoder,
74      FLAC__StreamDecoderErrorStatus status, void *client_data);
75  static void gst_flac_dec_error_callback_stream (const FLAC__StreamDecoder *
76      decoder, FLAC__StreamDecoderErrorStatus status, void *client_data);
77 @@ -212,7 +212,7 @@
78  gst_flac_dec_reset_decoders (GstFlacDec * flacdec)
79  {
80    if (flacdec->seekable_decoder) {
81 -    FLAC__seekable_stream_decoder_delete (flacdec->seekable_decoder);
82 +    FLAC__stream_decoder_delete (flacdec->seekable_decoder);
83      flacdec->seekable_decoder = NULL;
84    }
85  
86 @@ -238,27 +238,10 @@
87  {
88    gst_flac_dec_reset_decoders (dec);
89  
90 -  dec->seekable_decoder = FLAC__seekable_stream_decoder_new ();
91 +  dec->seekable_decoder = FLAC__stream_decoder_new ();
92  
93 -  FLAC__seekable_stream_decoder_set_read_callback (dec->seekable_decoder,
94 -      gst_flac_dec_read_seekable);
95 -  FLAC__seekable_stream_decoder_set_seek_callback (dec->seekable_decoder,
96 -      gst_flac_dec_seek);
97 -  FLAC__seekable_stream_decoder_set_tell_callback (dec->seekable_decoder,
98 -      gst_flac_dec_tell);
99 -  FLAC__seekable_stream_decoder_set_length_callback (dec->seekable_decoder,
100 -      gst_flac_dec_length);
101 -  FLAC__seekable_stream_decoder_set_eof_callback (dec->seekable_decoder,
102 -      gst_flac_dec_eof);
103 -  FLAC__seekable_stream_decoder_set_write_callback (dec->seekable_decoder,
104 -      gst_flac_dec_write_seekable);
105 -  FLAC__seekable_stream_decoder_set_metadata_respond (dec->seekable_decoder,
106 +  FLAC__stream_decoder_set_metadata_respond (dec->seekable_decoder,
107        FLAC__METADATA_TYPE_VORBIS_COMMENT);
108 -  FLAC__seekable_stream_decoder_set_metadata_callback (dec->seekable_decoder,
109 -      gst_flac_dec_metadata_callback_seekable);
110 -  FLAC__seekable_stream_decoder_set_error_callback (dec->seekable_decoder,
111 -      gst_flac_dec_error_callback_seekable);
112 -  FLAC__seekable_stream_decoder_set_client_data (dec->seekable_decoder, dec);
113  }
114  
115  static void
116 @@ -270,17 +253,8 @@
117  
118    dec->stream_decoder = FLAC__stream_decoder_new ();
119  
120 -  FLAC__stream_decoder_set_read_callback (dec->stream_decoder,
121 -      gst_flac_dec_read_stream);
122 -  FLAC__stream_decoder_set_write_callback (dec->stream_decoder,
123 -      gst_flac_dec_write_stream);
124    FLAC__stream_decoder_set_metadata_respond (dec->stream_decoder,
125        FLAC__METADATA_TYPE_VORBIS_COMMENT);
126 -  FLAC__stream_decoder_set_metadata_callback (dec->stream_decoder,
127 -      gst_flac_dec_metadata_callback_stream);
128 -  FLAC__stream_decoder_set_error_callback (dec->stream_decoder,
129 -      gst_flac_dec_error_callback_stream);
130 -  FLAC__stream_decoder_set_client_data (dec->stream_decoder, dec);
131  }
132  
133  static void
134 @@ -545,7 +519,7 @@
135  }
136  
137  static void
138 -gst_flac_dec_metadata_callback_seekable (const FLAC__SeekableStreamDecoder * d,
139 +gst_flac_dec_metadata_callback_seekable (const FLAC__StreamDecoder * d,
140      const FLAC__StreamMetadata * metadata, void *client_data)
141  {
142    GstFlacDec *dec = GST_FLAC_DEC (client_data);
143 @@ -588,7 +562,7 @@
144  }
145  
146  static void
147 -gst_flac_dec_error_callback_seekable (const FLAC__SeekableStreamDecoder * d,
148 +gst_flac_dec_error_callback_seekable (const FLAC__StreamDecoder * d,
149      FLAC__StreamDecoderErrorStatus status, void *client_data)
150  {
151    gst_flac_dec_error_callback (GST_FLAC_DEC (client_data), status);
152 @@ -601,8 +575,8 @@
153    gst_flac_dec_error_callback (GST_FLAC_DEC (client_data), status);
154  }
155  
156 -static FLAC__SeekableStreamDecoderSeekStatus
157 -gst_flac_dec_seek (const FLAC__SeekableStreamDecoder * decoder,
158 +static FLAC__StreamDecoderSeekStatus
159 +gst_flac_dec_seek (const FLAC__StreamDecoder * decoder,
160      FLAC__uint64 position, void *client_data)
161  {
162    GstFlacDec *flacdec;
163 @@ -612,11 +586,11 @@
164    GST_DEBUG ("seek %" G_GINT64_FORMAT, position);
165    flacdec->offset = position;
166  
167 -  return FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_OK;
168 +  return FLAC__STREAM_DECODER_SEEK_STATUS_OK;
169  }
170  
171 -static FLAC__SeekableStreamDecoderTellStatus
172 -gst_flac_dec_tell (const FLAC__SeekableStreamDecoder * decoder,
173 +static FLAC__StreamDecoderTellStatus
174 +gst_flac_dec_tell (const FLAC__StreamDecoder * decoder,
175      FLAC__uint64 * position, void *client_data)
176  {
177    GstFlacDec *flacdec;
178 @@ -627,11 +601,11 @@
179  
180    GST_DEBUG ("tell %" G_GINT64_FORMAT, *position);
181  
182 -  return FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_OK;
183 +  return FLAC__STREAM_DECODER_TELL_STATUS_OK;
184  }
185  
186 -static FLAC__SeekableStreamDecoderLengthStatus
187 -gst_flac_dec_length (const FLAC__SeekableStreamDecoder * decoder,
188 +static FLAC__StreamDecoderLengthStatus
189 +gst_flac_dec_length (const FLAC__StreamDecoder * decoder,
190      FLAC__uint64 * length, void *client_data)
191  {
192    GstFlacDec *flacdec;
193 @@ -642,21 +616,21 @@
194    flacdec = GST_FLAC_DEC (client_data);
195  
196    if (!(peer = gst_pad_get_peer (flacdec->sinkpad)))
197 -    return FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_ERROR;
198 +    return FLAC__STREAM_DECODER_LENGTH_STATUS_ERROR;
199    gst_pad_query_duration (peer, &fmt, &len);
200    gst_object_unref (peer);
201    if (fmt != GST_FORMAT_BYTES || len == -1)
202 -    return FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_ERROR;
203 +    return FLAC__STREAM_DECODER_LENGTH_STATUS_ERROR;
204  
205    *length = len;
206  
207    GST_DEBUG ("length %" G_GINT64_FORMAT, *length);
208  
209 -  return FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_OK;
210 +  return FLAC__STREAM_DECODER_LENGTH_STATUS_OK;
211  }
212  
213  static FLAC__bool
214 -gst_flac_dec_eof (const FLAC__SeekableStreamDecoder * decoder,
215 +gst_flac_dec_eof (const FLAC__StreamDecoder * decoder,
216      void *client_data)
217  {
218    GstFlacDec *flacdec;
219 @@ -685,8 +659,8 @@
220    return ret;
221  }
222  
223 -static FLAC__SeekableStreamDecoderReadStatus
224 -gst_flac_dec_read_seekable (const FLAC__SeekableStreamDecoder * decoder,
225 +static FLAC__StreamDecoderReadStatus
226 +gst_flac_dec_read_seekable (const FLAC__StreamDecoder * decoder,
227      FLAC__byte buffer[], unsigned *bytes, void *client_data)
228  {
229    GstFlacDec *flacdec;
230 @@ -696,7 +670,7 @@
231  
232    if (gst_pad_pull_range (flacdec->sinkpad, flacdec->offset, *bytes,
233            &buf) != GST_FLOW_OK)
234 -    return FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_ERROR;
235 +    return FLAC__STREAM_DECODER_READ_STATUS_ABORT;
236  
237    GST_DEBUG ("Read %d bytes at %" G_GUINT64_FORMAT,
238        GST_BUFFER_SIZE (buf), flacdec->offset);
239 @@ -705,7 +679,7 @@
240    gst_buffer_unref (buf);
241    flacdec->offset += *bytes;
242  
243 -  return FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_OK;
244 +  return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE;
245  }
246  
247  static FLAC__StreamDecoderReadStatus
248 @@ -881,7 +855,7 @@
249  }
250  
251  static FLAC__StreamDecoderWriteStatus
252 -gst_flac_dec_write_seekable (const FLAC__SeekableStreamDecoder * decoder,
253 +gst_flac_dec_write_seekable (const FLAC__StreamDecoder * decoder,
254      const FLAC__Frame * frame,
255      const FLAC__int32 * const buffer[], void *client_data)
256  {
257 @@ -900,7 +874,7 @@
258  gst_flac_dec_loop (GstPad * sinkpad)
259  {
260    GstFlacDec *flacdec;
261 -  FLAC__SeekableStreamDecoderState s;
262 +  FLAC__StreamDecoderState s;
263  
264    flacdec = GST_FLAC_DEC (GST_OBJECT_PARENT (sinkpad));
265  
266 @@ -908,8 +882,17 @@
267  
268    if (flacdec->init) {
269      GST_DEBUG_OBJECT (flacdec, "initializing decoder");
270 -    s = FLAC__seekable_stream_decoder_init (flacdec->seekable_decoder);
271 -    if (s != FLAC__SEEKABLE_STREAM_DECODER_OK)
272 +    s = FLAC__stream_decoder_init_stream (flacdec->seekable_decoder,
273 +      gst_flac_dec_read_seekable,
274 +      gst_flac_dec_seek,
275 +      gst_flac_dec_tell,
276 +      gst_flac_dec_length,
277 +      gst_flac_dec_eof,
278 +      gst_flac_dec_write_seekable,
279 +      gst_flac_dec_metadata_callback_seekable,
280 +      gst_flac_dec_error_callback_seekable,
281 +      flacdec);
282 +    if (s != FLAC__STREAM_DECODER_INIT_STATUS_OK)
283        goto analyze_state;
284      /*    FLAC__seekable_stream_decoder_process_metadata (flacdec->seekable_decoder); */
285      flacdec->init = FALSE;
286 @@ -920,15 +903,17 @@
287    flacdec->last_flow = GST_FLOW_OK;
288  
289    GST_LOG_OBJECT (flacdec, "processing single");
290 -  FLAC__seekable_stream_decoder_process_single (flacdec->seekable_decoder);
291 +  FLAC__stream_decoder_process_single (flacdec->seekable_decoder);
292  
293  analyze_state:
294  
295    GST_LOG_OBJECT (flacdec, "done processing, checking encoder state");
296 -  s = FLAC__seekable_stream_decoder_get_state (flacdec->seekable_decoder);
297 +  s = FLAC__stream_decoder_get_state (flacdec->seekable_decoder);
298    switch (s) {
299 -    case FLAC__SEEKABLE_STREAM_DECODER_OK:
300 -    case FLAC__SEEKABLE_STREAM_DECODER_SEEKING:{
301 +    case FLAC__STREAM_DECODER_SEARCH_FOR_METADATA:
302 +    case FLAC__STREAM_DECODER_READ_METADATA:
303 +    case FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC:
304 +    case FLAC__STREAM_DECODER_READ_FRAME:{
305        GST_DEBUG_OBJECT (flacdec, "everything ok");
306  
307        if (flacdec->last_flow != GST_FLOW_OK &&
308 @@ -956,9 +941,9 @@
309        return;
310      }
311  
312 -    case FLAC__SEEKABLE_STREAM_DECODER_END_OF_STREAM:{
313 +    case FLAC__STREAM_DECODER_END_OF_STREAM:{
314        GST_DEBUG_OBJECT (flacdec, "EOS");
315 -      FLAC__seekable_stream_decoder_reset (flacdec->seekable_decoder);
316 +      FLAC__stream_decoder_reset (flacdec->seekable_decoder);
317  
318        if ((flacdec->segment.flags & GST_SEEK_FLAG_SEGMENT) != 0) {
319          if (flacdec->segment.duration > 0) {
320 @@ -972,18 +957,16 @@
321        goto eos_and_pause;
322      }
323  
324 -    case FLAC__SEEKABLE_STREAM_DECODER_MEMORY_ALLOCATION_ERROR:
325 -    case FLAC__SEEKABLE_STREAM_DECODER_STREAM_DECODER_ERROR:
326 -    case FLAC__SEEKABLE_STREAM_DECODER_READ_ERROR:
327 -    case FLAC__SEEKABLE_STREAM_DECODER_SEEK_ERROR:
328 -    case FLAC__SEEKABLE_STREAM_DECODER_ALREADY_INITIALIZED:
329 -    case FLAC__SEEKABLE_STREAM_DECODER_INVALID_CALLBACK:
330 -    case FLAC__SEEKABLE_STREAM_DECODER_UNINITIALIZED:
331 +    case FLAC__STREAM_DECODER_OGG_ERROR:
332 +    case FLAC__STREAM_DECODER_SEEK_ERROR:
333 +    case FLAC__STREAM_DECODER_ABORTED:
334 +    case FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR:
335 +    case FLAC__STREAM_DECODER_UNINITIALIZED:
336      default:{
337        /* fixme: this error sucks -- should try to figure out when/if an more
338           specific error was already sent via the callback */
339        GST_ELEMENT_ERROR (flacdec, STREAM, DECODE, (NULL),
340 -          ("%s", FLAC__SeekableStreamDecoderStateString[s]));
341 +          ("%s", FLAC__StreamDecoderStateString[s]));
342        goto eos_and_pause;
343      }
344    }
345 @@ -1113,8 +1096,17 @@
346  
347    if (dec->init) {
348      GST_DEBUG_OBJECT (dec, "initializing decoder");
349 -    s = FLAC__stream_decoder_init (dec->stream_decoder);
350 -    if (s != FLAC__STREAM_DECODER_SEARCH_FOR_METADATA) {
351 +    s = FLAC__stream_decoder_init_stream (dec->stream_decoder,
352 +      gst_flac_dec_read_stream,
353 +      NULL,
354 +      NULL,
355 +      NULL,
356 +      NULL,
357 +      gst_flac_dec_write_stream,
358 +      gst_flac_dec_metadata_callback_stream,
359 +      gst_flac_dec_error_callback_stream,
360 +      dec);
361 +    if (s != FLAC__STREAM_DECODER_INIT_STATUS_OK) {
362        GST_ELEMENT_ERROR (GST_ELEMENT (dec), LIBRARY, INIT, (NULL), (NULL));
363        return GST_FLOW_ERROR;
364      }
365 @@ -1598,7 +1590,7 @@
366    flacdec->seeking = TRUE;
367  
368    seek_ok =
369 -      FLAC__seekable_stream_decoder_seek_absolute (flacdec->seekable_decoder,
370 +      FLAC__stream_decoder_seek_absolute (flacdec->seekable_decoder,
371        segment.start);
372  
373    flacdec->seeking = FALSE;
374 --- gst-plugins-good-0.10.5/ext/flac/gstflacenc.h.orig  2006-06-01 23:07:23.000000000 +0200
375 +++ gst-plugins-good-0.10.5/ext/flac/gstflacenc.h       2006-12-24 22:05:00.981492950 +0100
376 @@ -54,7 +54,7 @@
377    gboolean       stopped;
378    FLAC__int32   *data;
379  
380 -  FLAC__SeekableStreamEncoder *encoder;
381 +  FLAC__StreamEncoder *encoder;
382    FLAC__StreamMetadata **meta;
383  
384    GstTagList *     tags;
385 --- gst-plugins-good-0.10.5/ext/flac/gstflacdec.h.orig  2006-12-24 22:05:36.051491475 +0100
386 +++ gst-plugins-good-0.10.5/ext/flac/gstflacdec.h       2006-12-24 22:05:24.698844524 +0100
387 @@ -41,7 +41,7 @@
388  struct _GstFlacDec {
389    GstElement     element;
390  
391 -  FLAC__SeekableStreamDecoder *seekable_decoder; /* for pull-based operation  */
392 +  FLAC__StreamDecoder         *seekable_decoder; /* for pull-based operation  */
393  
394    FLAC__StreamDecoder         *stream_decoder;   /* for chain-based operation */
395    GstAdapter                  *adapter;
396 --- gst-plugins-good-0.10.5/ext/flac/gstflacenc.c.orig  2006-10-16 20:22:46.000000000 +0200
397 +++ gst-plugins-good-0.10.5/ext/flac/gstflacenc.c       2006-12-24 22:44:18.171821571 +0100
398 @@ -109,14 +109,14 @@
399      GstStateChange transition);
400  
401  static FLAC__StreamEncoderWriteStatus
402 -gst_flac_enc_write_callback (const FLAC__SeekableStreamEncoder * encoder,
403 +gst_flac_enc_write_callback (const FLAC__StreamEncoder * encoder,
404      const FLAC__byte buffer[], unsigned bytes,
405      unsigned samples, unsigned current_frame, void *client_data);
406 -static FLAC__SeekableStreamEncoderSeekStatus
407 -gst_flac_enc_seek_callback (const FLAC__SeekableStreamEncoder * encoder,
408 +static FLAC__StreamEncoderSeekStatus
409 +gst_flac_enc_seek_callback (const FLAC__StreamEncoder * encoder,
410      FLAC__uint64 absolute_byte_offset, void *client_data);
411 -static FLAC__SeekableStreamEncoderTellStatus
412 -gst_flac_enc_tell_callback (const FLAC__SeekableStreamEncoder * encoder,
413 +static FLAC__StreamEncoderTellStatus
414 +gst_flac_enc_tell_callback (const FLAC__StreamEncoder * encoder,
415      FLAC__uint64 * absolute_byte_offset, void *client_data);
416  
417  typedef struct
418 @@ -302,7 +302,7 @@
419    gst_pad_use_fixed_caps (flacenc->srcpad);
420    gst_element_add_pad (GST_ELEMENT (flacenc), flacenc->srcpad);
421  
422 -  flacenc->encoder = FLAC__seekable_stream_encoder_new ();
423 +  flacenc->encoder = FLAC__stream_encoder_new ();
424  
425    flacenc->offset = 0;
426    flacenc->samples_written = 0;
427 @@ -315,7 +315,7 @@
428  {
429    GstFlacEnc *flacenc = GST_FLAC_ENC (object);
430  
431 -  FLAC__seekable_stream_encoder_delete (flacenc->encoder);
432 +  FLAC__stream_encoder_delete (flacenc->encoder);
433  
434    G_OBJECT_CLASS (parent_class)->finalize (object);
435  }
436 @@ -360,7 +360,7 @@
437        FLAC__metadata_object_new (FLAC__METADATA_TYPE_VORBIS_COMMENT);
438    gst_tag_list_foreach (copy, add_one_tag, flacenc);
439  
440 -  if (FLAC__seekable_stream_encoder_set_metadata (flacenc->encoder,
441 +  if (FLAC__stream_encoder_set_metadata (flacenc->encoder,
442            flacenc->meta, 1) != true)
443      g_warning ("Dude, i'm already initialized!");
444    gst_tag_list_free (copy);
445 @@ -371,13 +371,13 @@
446  {
447    GstFlacEnc *flacenc;
448    GstStructure *structure;
449 -  FLAC__SeekableStreamEncoderState state;
450 +  FLAC__StreamEncoderState state;
451  
452    /* takes a ref on flacenc */
453    flacenc = GST_FLAC_ENC (gst_pad_get_parent (pad));
454  
455 -  if (FLAC__seekable_stream_encoder_get_state (flacenc->encoder) !=
456 -      FLAC__SEEKABLE_STREAM_ENCODER_UNINITIALIZED)
457 +  if (FLAC__stream_encoder_get_state (flacenc->encoder) !=
458 +      FLAC__STREAM_ENCODER_UNINITIALIZED)
459      goto encoder_already_initialized;
460  
461    structure = gst_caps_get_structure (caps, 0);
462 @@ -397,26 +397,22 @@
463  
464    gst_caps_unref (caps);
465  
466 -  FLAC__seekable_stream_encoder_set_bits_per_sample (flacenc->encoder,
467 +  FLAC__stream_encoder_set_bits_per_sample (flacenc->encoder,
468        flacenc->depth);
469 -  FLAC__seekable_stream_encoder_set_sample_rate (flacenc->encoder,
470 +  FLAC__stream_encoder_set_sample_rate (flacenc->encoder,
471        flacenc->sample_rate);
472 -  FLAC__seekable_stream_encoder_set_channels (flacenc->encoder,
473 +  FLAC__stream_encoder_set_channels (flacenc->encoder,
474        flacenc->channels);
475  
476 -  FLAC__seekable_stream_encoder_set_write_callback (flacenc->encoder,
477 -      gst_flac_enc_write_callback);
478 -  FLAC__seekable_stream_encoder_set_seek_callback (flacenc->encoder,
479 -      gst_flac_enc_seek_callback);
480 -  FLAC__seekable_stream_encoder_set_tell_callback (flacenc->encoder,
481 -      gst_flac_enc_tell_callback);
482 -
483 -  FLAC__seekable_stream_encoder_set_client_data (flacenc->encoder, flacenc);
484 -
485    gst_flac_enc_set_metadata (flacenc);
486  
487 -  state = FLAC__seekable_stream_encoder_init (flacenc->encoder);
488 -  if (state != FLAC__STREAM_ENCODER_OK)
489 +  state = FLAC__stream_encoder_init_stream (flacenc->encoder,
490 +    gst_flac_enc_write_callback,
491 +    gst_flac_enc_seek_callback,
492 +    gst_flac_enc_tell_callback,
493 +    NULL,
494 +    flacenc);
495 +  if (state != FLAC__STREAM_ENCODER_INIT_STATUS_OK)
496      goto failed_to_initialize;
497  
498    gst_object_unref (flacenc);
499 @@ -453,9 +449,9 @@
500  
501  #define DO_UPDATE(name, val, str)                                               \
502    G_STMT_START {                                                                \
503 -    if (FLAC__seekable_stream_encoder_get_##name (flacenc->encoder) !=          \
504 +    if (FLAC__stream_encoder_get_##name (flacenc->encoder) !=                   \
505          flacenc_params[quality].val) {                                          \
506 -      FLAC__seekable_stream_encoder_set_##name (flacenc->encoder,               \
507 +      FLAC__stream_encoder_set_##name (flacenc->encoder,                        \
508            flacenc_params[quality].val);                                         \
509        g_object_notify (G_OBJECT (flacenc), str);                                \
510      }                                                                           \
511 @@ -490,8 +486,8 @@
512    return TRUE;
513  }
514  
515 -static FLAC__SeekableStreamEncoderSeekStatus
516 -gst_flac_enc_seek_callback (const FLAC__SeekableStreamEncoder * encoder,
517 +static FLAC__StreamEncoderSeekStatus
518 +gst_flac_enc_seek_callback (const FLAC__StreamEncoder * encoder,
519      FLAC__uint64 absolute_byte_offset, void *client_data)
520  {
521    GstFlacEnc *flacenc;
522 @@ -501,7 +497,7 @@
523    flacenc = GST_FLAC_ENC (client_data);
524  
525    if (flacenc->stopped)
526 -    return FLAC__SEEKABLE_STREAM_ENCODER_SEEK_STATUS_OK;
527 +    return FLAC__STREAM_ENCODER_SEEK_STATUS_OK;
528  
529    event = gst_event_new_new_segment (TRUE, 1.0, GST_FORMAT_BYTES,
530        absolute_byte_offset, GST_BUFFER_OFFSET_NONE, 0);
531 @@ -525,11 +521,11 @@
532  
533    flacenc->offset = absolute_byte_offset;
534  
535 -  return FLAC__SEEKABLE_STREAM_ENCODER_SEEK_STATUS_OK;
536 +  return FLAC__STREAM_ENCODER_SEEK_STATUS_OK;
537  }
538  
539  static FLAC__StreamEncoderWriteStatus
540 -gst_flac_enc_write_callback (const FLAC__SeekableStreamEncoder * encoder,
541 +gst_flac_enc_write_callback (const FLAC__StreamEncoder * encoder,
542      const FLAC__byte buffer[], unsigned bytes,
543      unsigned samples, unsigned current_frame, void *client_data)
544  {
545 @@ -577,15 +573,15 @@
546    return FLAC__STREAM_ENCODER_WRITE_STATUS_OK;
547  }
548  
549 -static FLAC__SeekableStreamEncoderTellStatus
550 -gst_flac_enc_tell_callback (const FLAC__SeekableStreamEncoder * encoder,
551 +static FLAC__StreamEncoderTellStatus
552 +gst_flac_enc_tell_callback (const FLAC__StreamEncoder * encoder,
553      FLAC__uint64 * absolute_byte_offset, void *client_data)
554  {
555    GstFlacEnc *flacenc = GST_FLAC_ENC (client_data);
556  
557    *absolute_byte_offset = flacenc->offset;
558  
559 -  return FLAC__SEEKABLE_STREAM_ENCODER_TELL_STATUS_OK;
560 +  return FLAC__STREAM_ENCODER_TELL_STATUS_OK;
561  }
562  
563  static gboolean
564 @@ -629,7 +625,7 @@
565        break;
566      }
567      case GST_EVENT_EOS:
568 -      FLAC__seekable_stream_encoder_finish (flacenc->encoder);
569 +      FLAC__stream_encoder_finish (flacenc->encoder);
570        ret = gst_pad_event_default (pad, event);
571        break;
572      case GST_EVENT_TAG:
573 @@ -686,7 +682,7 @@
574  
575    gst_buffer_unref (buffer);
576  
577 -  res = FLAC__seekable_stream_encoder_process_interleaved (flacenc->encoder,
578 +  res = FLAC__stream_encoder_process_interleaved (flacenc->encoder,
579        (const FLAC__int32 *) data, samples / flacenc->channels);
580  
581    g_free (data);
582 @@ -712,51 +708,51 @@
583        gst_flac_enc_update_quality (this, g_value_get_enum (value));
584        break;
585      case PROP_STREAMABLE_SUBSET:
586 -      FLAC__seekable_stream_encoder_set_streamable_subset (this->encoder,
587 +      FLAC__stream_encoder_set_streamable_subset (this->encoder,
588            g_value_get_boolean (value));
589        break;
590      case PROP_MID_SIDE_STEREO:
591 -      FLAC__seekable_stream_encoder_set_do_mid_side_stereo (this->encoder,
592 +      FLAC__stream_encoder_set_do_mid_side_stereo (this->encoder,
593            g_value_get_boolean (value));
594        break;
595      case PROP_LOOSE_MID_SIDE_STEREO:
596 -      FLAC__seekable_stream_encoder_set_loose_mid_side_stereo (this->encoder,
597 +      FLAC__stream_encoder_set_loose_mid_side_stereo (this->encoder,
598            g_value_get_boolean (value));
599        break;
600      case PROP_BLOCKSIZE:
601 -      FLAC__seekable_stream_encoder_set_blocksize (this->encoder,
602 +      FLAC__stream_encoder_set_blocksize (this->encoder,
603            g_value_get_uint (value));
604        break;
605      case PROP_MAX_LPC_ORDER:
606 -      FLAC__seekable_stream_encoder_set_max_lpc_order (this->encoder,
607 +      FLAC__stream_encoder_set_max_lpc_order (this->encoder,
608            g_value_get_uint (value));
609        break;
610      case PROP_QLP_COEFF_PRECISION:
611 -      FLAC__seekable_stream_encoder_set_qlp_coeff_precision (this->encoder,
612 +      FLAC__stream_encoder_set_qlp_coeff_precision (this->encoder,
613            g_value_get_uint (value));
614        break;
615      case PROP_QLP_COEFF_PREC_SEARCH:
616 -      FLAC__seekable_stream_encoder_set_do_qlp_coeff_prec_search (this->encoder,
617 +      FLAC__stream_encoder_set_do_qlp_coeff_prec_search (this->encoder,
618            g_value_get_boolean (value));
619        break;
620      case PROP_ESCAPE_CODING:
621 -      FLAC__seekable_stream_encoder_set_do_escape_coding (this->encoder,
622 +      FLAC__stream_encoder_set_do_escape_coding (this->encoder,
623            g_value_get_boolean (value));
624        break;
625      case PROP_EXHAUSTIVE_MODEL_SEARCH:
626 -      FLAC__seekable_stream_encoder_set_do_exhaustive_model_search (this->
627 +      FLAC__stream_encoder_set_do_exhaustive_model_search (this->
628            encoder, g_value_get_boolean (value));
629        break;
630      case PROP_MIN_RESIDUAL_PARTITION_ORDER:
631 -      FLAC__seekable_stream_encoder_set_min_residual_partition_order (this->
632 +      FLAC__stream_encoder_set_min_residual_partition_order (this->
633            encoder, g_value_get_uint (value));
634        break;
635      case PROP_MAX_RESIDUAL_PARTITION_ORDER:
636 -      FLAC__seekable_stream_encoder_set_max_residual_partition_order (this->
637 +      FLAC__stream_encoder_set_max_residual_partition_order (this->
638            encoder, g_value_get_uint (value));
639        break;
640      case PROP_RICE_PARAMETER_SEARCH_DIST:
641 -      FLAC__seekable_stream_encoder_set_rice_parameter_search_dist (this->
642 +      FLAC__stream_encoder_set_rice_parameter_search_dist (this->
643            encoder, g_value_get_uint (value));
644        break;
645      default:
646 @@ -781,57 +777,57 @@
647        break;
648      case PROP_STREAMABLE_SUBSET:
649        g_value_set_boolean (value,
650 -          FLAC__seekable_stream_encoder_get_streamable_subset (this->encoder));
651 +          FLAC__stream_encoder_get_streamable_subset (this->encoder));
652        break;
653      case PROP_MID_SIDE_STEREO:
654        g_value_set_boolean (value,
655 -          FLAC__seekable_stream_encoder_get_do_mid_side_stereo (this->encoder));
656 +          FLAC__stream_encoder_get_do_mid_side_stereo (this->encoder));
657        break;
658      case PROP_LOOSE_MID_SIDE_STEREO:
659        g_value_set_boolean (value,
660 -          FLAC__seekable_stream_encoder_get_loose_mid_side_stereo (this->
661 +          FLAC__stream_encoder_get_loose_mid_side_stereo (this->
662                encoder));
663        break;
664      case PROP_BLOCKSIZE:
665        g_value_set_uint (value,
666 -          FLAC__seekable_stream_encoder_get_blocksize (this->encoder));
667 +          FLAC__stream_encoder_get_blocksize (this->encoder));
668        break;
669      case PROP_MAX_LPC_ORDER:
670        g_value_set_uint (value,
671 -          FLAC__seekable_stream_encoder_get_max_lpc_order (this->encoder));
672 +          FLAC__stream_encoder_get_max_lpc_order (this->encoder));
673        break;
674      case PROP_QLP_COEFF_PRECISION:
675        g_value_set_uint (value,
676 -          FLAC__seekable_stream_encoder_get_qlp_coeff_precision (this->
677 +          FLAC__stream_encoder_get_qlp_coeff_precision (this->
678                encoder));
679        break;
680      case PROP_QLP_COEFF_PREC_SEARCH:
681        g_value_set_boolean (value,
682 -          FLAC__seekable_stream_encoder_get_do_qlp_coeff_prec_search (this->
683 +          FLAC__stream_encoder_get_do_qlp_coeff_prec_search (this->
684                encoder));
685        break;
686      case PROP_ESCAPE_CODING:
687        g_value_set_boolean (value,
688 -          FLAC__seekable_stream_encoder_get_do_escape_coding (this->encoder));
689 +          FLAC__stream_encoder_get_do_escape_coding (this->encoder));
690        break;
691      case PROP_EXHAUSTIVE_MODEL_SEARCH:
692        g_value_set_boolean (value,
693 -          FLAC__seekable_stream_encoder_get_do_exhaustive_model_search (this->
694 +          FLAC__stream_encoder_get_do_exhaustive_model_search (this->
695                encoder));
696        break;
697      case PROP_MIN_RESIDUAL_PARTITION_ORDER:
698        g_value_set_uint (value,
699 -          FLAC__seekable_stream_encoder_get_min_residual_partition_order (this->
700 +          FLAC__stream_encoder_get_min_residual_partition_order (this->
701                encoder));
702        break;
703      case PROP_MAX_RESIDUAL_PARTITION_ORDER:
704        g_value_set_uint (value,
705 -          FLAC__seekable_stream_encoder_get_max_residual_partition_order (this->
706 +          FLAC__stream_encoder_get_max_residual_partition_order (this->
707                encoder));
708        break;
709      case PROP_RICE_PARAMETER_SEARCH_DIST:
710        g_value_set_uint (value,
711 -          FLAC__seekable_stream_encoder_get_rice_parameter_search_dist (this->
712 +          FLAC__stream_encoder_get_rice_parameter_search_dist (this->
713                encoder));
714        break;
715      default:
716 @@ -864,10 +860,10 @@
717      case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
718        break;
719      case GST_STATE_CHANGE_PAUSED_TO_READY:
720 -      if (FLAC__seekable_stream_encoder_get_state (flacenc->encoder) !=
721 +      if (FLAC__stream_encoder_get_state (flacenc->encoder) !=
722            FLAC__STREAM_ENCODER_UNINITIALIZED) {
723          flacenc->stopped = TRUE;
724 -        FLAC__seekable_stream_encoder_finish (flacenc->encoder);
725 +        FLAC__stream_encoder_finish (flacenc->encoder);
726        }
727        flacenc->offset = 0;
728        flacenc->samples_written = 0;
This page took 0.189774 seconds and 2 git commands to generate.