mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
update to 1.0.2-1.0.3 API, unref events
Original commit message from CVS: update to 1.0.2-1.0.3 API, unref events
This commit is contained in:
parent
eebc284b13
commit
f45e753969
2 changed files with 14 additions and 12 deletions
|
@ -74,10 +74,10 @@ static FLAC__bool gst_flacdec_eof (const FLAC__SeekableStreamDecoder *decoder
|
||||||
void *client_data);
|
void *client_data);
|
||||||
static FLAC__StreamDecoderWriteStatus
|
static FLAC__StreamDecoderWriteStatus
|
||||||
gst_flacdec_write (const FLAC__SeekableStreamDecoder *decoder,
|
gst_flacdec_write (const FLAC__SeekableStreamDecoder *decoder,
|
||||||
const FLAC__Frame *frame, const FLAC__int32 *buffer[],
|
const FLAC__Frame *frame, const FLAC__int32 * const buffer[],
|
||||||
void *client_data);
|
void *client_data);
|
||||||
static void gst_flacdec_metadata_callback (const FLAC__SeekableStreamDecoder *decoder,
|
static void gst_flacdec_metadata_callback (const FLAC__SeekableStreamDecoder *decoder,
|
||||||
const FLAC__StreamMetaData *metadata,
|
const FLAC__StreamMetadata *metadata,
|
||||||
void *client_data);
|
void *client_data);
|
||||||
static void gst_flacdec_error_callback (const FLAC__SeekableStreamDecoder *decoder,
|
static void gst_flacdec_error_callback (const FLAC__SeekableStreamDecoder *decoder,
|
||||||
FLAC__StreamDecoderErrorStatus status,
|
FLAC__StreamDecoderErrorStatus status,
|
||||||
|
@ -152,7 +152,7 @@ gst_flacdec_init (FlacDec *flacdec)
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_flacdec_metadata_callback (const FLAC__SeekableStreamDecoder *decoder,
|
gst_flacdec_metadata_callback (const FLAC__SeekableStreamDecoder *decoder,
|
||||||
const FLAC__StreamMetaData *metadata, void *client_data)
|
const FLAC__StreamMetadata *metadata, void *client_data)
|
||||||
{
|
{
|
||||||
FlacDec *flacdec;
|
FlacDec *flacdec;
|
||||||
|
|
||||||
|
@ -171,13 +171,13 @@ gst_flacdec_error_callback (const FLAC__SeekableStreamDecoder *decoder,
|
||||||
flacdec = GST_FLACDEC (client_data);
|
flacdec = GST_FLACDEC (client_data);
|
||||||
|
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case FLAC__STREAM_DECODER_ERROR_LOST_SYNC:
|
case FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC:
|
||||||
error = "lost sync";
|
error = "lost sync";
|
||||||
break;
|
break;
|
||||||
case FLAC__STREAM_DECODER_ERROR_BAD_HEADER:
|
case FLAC__STREAM_DECODER_ERROR_STATUS_BAD_HEADER:
|
||||||
error = "bad header";
|
error = "bad header";
|
||||||
break;
|
break;
|
||||||
case FLAC__STREAM_DECODER_ERROR_FRAME_CRC_MISMATCH:
|
case FLAC__STREAM_DECODER_ERROR_STATUS_FRAME_CRC_MISMATCH:
|
||||||
error = "CRC mismatch";
|
error = "CRC mismatch";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -271,6 +271,7 @@ gst_flacdec_read (const FLAC__SeekableStreamDecoder *decoder, FLAC__byte buffer[
|
||||||
GST_DEBUG (0, "eos");
|
GST_DEBUG (0, "eos");
|
||||||
flacdec->eos = TRUE;
|
flacdec->eos = TRUE;
|
||||||
if (avail == 0) {
|
if (avail == 0) {
|
||||||
|
gst_event_unref (event);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -279,7 +280,7 @@ gst_flacdec_read (const FLAC__SeekableStreamDecoder *decoder, FLAC__byte buffer[
|
||||||
|
|
||||||
/* we are not yet sending the discont, we'll do that in the next write operation */
|
/* we are not yet sending the discont, we'll do that in the next write operation */
|
||||||
flacdec->need_discont = TRUE;
|
flacdec->need_discont = TRUE;
|
||||||
gst_event_free (event);
|
gst_event_unref (event);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
gst_pad_event_default (flacdec->sinkpad, event);
|
gst_pad_event_default (flacdec->sinkpad, event);
|
||||||
|
@ -301,7 +302,7 @@ gst_flacdec_read (const FLAC__SeekableStreamDecoder *decoder, FLAC__byte buffer[
|
||||||
|
|
||||||
static FLAC__StreamDecoderWriteStatus
|
static FLAC__StreamDecoderWriteStatus
|
||||||
gst_flacdec_write (const FLAC__SeekableStreamDecoder *decoder, const FLAC__Frame *frame,
|
gst_flacdec_write (const FLAC__SeekableStreamDecoder *decoder, const FLAC__Frame *frame,
|
||||||
const FLAC__int32 *buffer[], void *client_data)
|
const FLAC__int32 * const buffer[], void *client_data)
|
||||||
{
|
{
|
||||||
FlacDec *flacdec;
|
FlacDec *flacdec;
|
||||||
GstBuffer *outbuf;
|
GstBuffer *outbuf;
|
||||||
|
@ -383,14 +384,14 @@ gst_flacdec_write (const FLAC__SeekableStreamDecoder *decoder, const FLAC__Frame
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
g_warning ("flacdec: invalid depth %d found\n", depth);
|
g_warning ("flacdec: invalid depth %d found\n", depth);
|
||||||
return FLAC__STREAM_DECODER_WRITE_ABORT;
|
return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
|
||||||
}
|
}
|
||||||
|
|
||||||
flacdec->total_samples += samples;
|
flacdec->total_samples += samples;
|
||||||
|
|
||||||
gst_pad_push (flacdec->srcpad, outbuf);
|
gst_pad_push (flacdec->srcpad, outbuf);
|
||||||
|
|
||||||
return FLAC__STREAM_DECODER_WRITE_CONTINUE;
|
return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -554,6 +555,7 @@ gst_flacdec_src_event (GstPad *pad, GstEvent *event)
|
||||||
res = FALSE;
|
res = FALSE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
gst_event_unref (event);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ static void gst_flacenc_get_property (GObject *object, guint prop_id,
|
||||||
static FLAC__StreamEncoderWriteStatus
|
static FLAC__StreamEncoderWriteStatus
|
||||||
gst_flacenc_write_callback (const FLAC__StreamEncoder *encoder, const FLAC__byte buffer[], unsigned bytes,
|
gst_flacenc_write_callback (const FLAC__StreamEncoder *encoder, const FLAC__byte buffer[], unsigned bytes,
|
||||||
unsigned samples, unsigned current_frame, void *client_data);
|
unsigned samples, unsigned current_frame, void *client_data);
|
||||||
static void gst_flacenc_metadata_callback (const FLAC__StreamEncoder *encoder, const FLAC__StreamMetaData *metadata,
|
static void gst_flacenc_metadata_callback (const FLAC__StreamEncoder *encoder, const FLAC__StreamMetadata *metadata,
|
||||||
void *client_data);
|
void *client_data);
|
||||||
|
|
||||||
static GstElementClass *parent_class = NULL;
|
static GstElementClass *parent_class = NULL;
|
||||||
|
@ -170,7 +170,7 @@ gst_flacenc_write_callback (const FLAC__StreamEncoder *encoder, const FLAC__byte
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_flacenc_metadata_callback (const FLAC__StreamEncoder *encoder, const FLAC__StreamMetaData *metadata, void *client_data)
|
gst_flacenc_metadata_callback (const FLAC__StreamEncoder *encoder, const FLAC__StreamMetadata *metadata, void *client_data)
|
||||||
{
|
{
|
||||||
GstEvent *event;
|
GstEvent *event;
|
||||||
FlacEnc *flacenc;
|
FlacEnc *flacenc;
|
||||||
|
|
Loading…
Reference in a new issue