/GstBuffer/GstData/ in the API where you can pass events. Fix the plugins to deal with that. Fixes #113488.

Original commit message from CVS:
/GstBuffer/GstData/ in the API where you can pass events. Fix the plugins to deal with that. Fixes #113488.
This commit is contained in:
Andy Wingo 2003-10-08 16:08:10 +00:00
parent 02aca4e525
commit 6300f2611c
16 changed files with 56 additions and 50 deletions

2
common

@ -1 +1 @@
Subproject commit b7abb510aa14e8692df39ea8c2c758e37d8a8d8a
Subproject commit e903f88a7388f0b463204ea1f960a4ace840175b

View file

@ -351,7 +351,7 @@ gst_a52dec_push (GstPad * srcpad, int flags, sample_t * _samples, gint64 timesta
GST_BUFFER_TIMESTAMP (buf) = timestamp;
float_to_int (samples, (int16_t *) GST_BUFFER_DATA (buf), flags);
gst_pad_push (srcpad, buf);
gst_pad_push (srcpad, GST_DATA (buf));
return 0;
}

View file

@ -123,7 +123,7 @@ static void dvdnavsrc_init (DVDNavSrc *dvdnavsrc);
static void dvdnavsrc_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
static void dvdnavsrc_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
static GstBuffer * dvdnavsrc_get (GstPad *pad);
static GstData * dvdnavsrc_get (GstPad *pad);
/*static GstBuffer * dvdnavsrc_get_region (GstPad *pad,gulong offset,gulong size); */
static gboolean dvdnavsrc_event (GstPad *pad, GstEvent *event);
static const GstEventMask*
@ -831,7 +831,7 @@ dvdnavsrc_print_event (DVDNavSrc *src, guint8 *data, int event, int len)
}
}
static GstBuffer *
static GstData *
dvdnavsrc_get (GstPad *pad)
{
DVDNavSrc *src;

View file

@ -118,7 +118,7 @@ static void dvdreadsrc_init (DVDReadSrc *dvdreadsrc);
static void dvdreadsrc_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
static void dvdreadsrc_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
/*static GstBuffer * dvdreadsrc_get (GstPad *pad); */
/*static GstData * dvdreadsrc_get (GstPad *pad); */
static void dvdreadsrc_loop (GstElement *element);
/*static GstBuffer * dvdreadsrc_get_region (GstPad *pad,gulong offset,gulong size); */
@ -543,7 +543,7 @@ dvdreadsrc_loop (GstElement *element)
}
GST_BUFFER_SIZE(buf) = cur_output_size * DVD_VIDEO_LB_LEN;
gst_pad_push(priv->srcpad, buf);
gst_pad_push(priv->srcpad, GST_DATA (buf));
priv->cur_pack = next_vobu;
}
}
@ -671,7 +671,7 @@ _read(DVDReadSrcPrivate *priv, int angle, int new_seek, GstBuffer *buf)
return 0;
}
static GstBuffer *
static GstData *
dvdreadsrc_get (GstPad *pad)
{
DVDReadSrc *dvdreadsrc;

View file

@ -196,7 +196,7 @@ static void gst_lame_set_property (GObject *object, guint prop_id,
const GValue *value, GParamSpec *pspec);
static void gst_lame_get_property (GObject *object, guint prop_id,
GValue *value, GParamSpec *pspec);
static void gst_lame_chain (GstPad *pad, GstBuffer *buf);
static void gst_lame_chain (GstPad *pad, GstData *_data);
static gboolean gst_lame_setup (GstLame *lame);
static GstElementStateReturn gst_lame_change_state (GstElement *element);
@ -715,8 +715,9 @@ gst_lame_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec
}
static void
gst_lame_chain (GstPad *pad, GstBuffer *buf)
gst_lame_chain (GstPad *pad, GstData *_data)
{
GstBuffer *buf = GST_BUFFER (_data);
GstLame *lame;
GstBuffer *outbuf;
gchar *mp3_data = NULL;
@ -803,7 +804,7 @@ gst_lame_chain (GstPad *pad, GstBuffer *buf)
GST_BUFFER_OFFSET (outbuf) = lame->last_offs;
GST_BUFFER_DURATION (outbuf) = lame->last_duration;
gst_pad_push (lame->srcpad,outbuf);
gst_pad_push (lame->srcpad,GST_DATA (outbuf));
lame->last_ts = GST_CLOCK_TIME_NONE;
}
@ -812,7 +813,7 @@ gst_lame_chain (GstPad *pad, GstBuffer *buf)
}
if (eos) {
gst_pad_push (lame->srcpad, GST_BUFFER (gst_event_new (GST_EVENT_EOS)));
gst_pad_push (lame->srcpad, GST_DATA (gst_event_new (GST_EVENT_EOS))));
gst_element_set_eos (GST_ELEMENT (lame));
}
}

View file

@ -171,7 +171,7 @@ static gboolean gst_mad_convert_src (GstPad *pad, GstFormat src_format,
gint64 src_value, GstFormat
*dest_format, gint64 *dest_value);
static void gst_mad_chain (GstPad *pad, GstBuffer *buffer);
static void gst_mad_chain (GstPad *pad, GstData *_data);
static GstElementStateReturn
gst_mad_change_state (GstElement *element);
@ -1065,7 +1065,7 @@ gst_mad_handle_event (GstPad *pad, GstBuffer *buffer)
{
discont = gst_event_new_discontinuous (FALSE, GST_FORMAT_TIME,
time, NULL);
gst_pad_push (mad->srcpad, GST_BUFFER (discont));
gst_pad_push (mad->srcpad, GST_DATA (discont));
}
break;
}
@ -1094,8 +1094,9 @@ gst_mad_check_restart (GstMad *mad)
}
static void
gst_mad_chain (GstPad *pad, GstBuffer *buffer)
gst_mad_chain (GstPad *pad, GstData *_data)
{
GstBuffer *buffer = GST_BUFFER (_data);
GstMad *mad;
gchar *data;
glong size;
@ -1317,7 +1318,7 @@ gst_mad_chain (GstPad *pad, GstBuffer *buffer)
}
}
gst_pad_push (mad->srcpad, outbuffer);
gst_pad_push (mad->srcpad, GST_DATA (outbuffer));
}
mad->total_samples += nsamples;

View file

@ -145,7 +145,7 @@ static gboolean gst_mpeg2dec_convert_src (GstPad *pad, GstFormat src_format, g
static GstElementStateReturn
gst_mpeg2dec_change_state (GstElement *element);
static void gst_mpeg2dec_chain (GstPad *pad, GstBuffer *buffer);
static void gst_mpeg2dec_chain (GstPad *pad, GstData *_data);
static GstElementClass *parent_class = NULL;
/*static guint gst_mpeg2dec_signals[LAST_SIGNAL] = { 0 };*/
@ -438,8 +438,9 @@ gst_mpeg2dec_flush_decoder (GstMpeg2dec *mpeg2dec)
}
static void
gst_mpeg2dec_chain (GstPad *pad, GstBuffer *buf)
gst_mpeg2dec_chain (GstPad *pad, GstData *_data)
{
GstBuffer *buf = GST_BUFFER (_data);
GstMpeg2dec *mpeg2dec = GST_MPEG2DEC (gst_pad_get_parent (pad));
guint32 size;
guint8 *data, *end;
@ -649,7 +650,7 @@ gst_mpeg2dec_chain (GstPad *pad, GstBuffer *buf)
else {
/* TODO set correct offset here based on frame number */
GST_BUFFER_DURATION (outbuf) = mpeg2dec->frame_period;
gst_pad_push (mpeg2dec->srcpad, outbuf);
gst_pad_push (mpeg2dec->srcpad, GST_DATA (outbuf));
}
}
if (info->discard_fbuf && info->discard_fbuf->id) {
@ -685,7 +686,7 @@ gst_mpeg2dec_chain (GstPad *pad, GstBuffer *buf)
memcpy (GST_BUFFER_DATA (udbuf), info->user_data, info->user_data_len);
gst_pad_push (mpeg2dec->userdatapad, udbuf);
gst_pad_push (mpeg2dec->userdatapad, GST_DATA (udbuf));
}
}
}

View file

@ -120,7 +120,7 @@ static void gst_ac3parse_class_init (GstAc3ParseClass *klass);
static void gst_ac3parse_init (GstAc3Parse *ac3parse);
static void gst_ac3parse_chain (GstPad *pad,
GstBuffer *buf);
GstData *data);
static void gst_ac3parse_set_property (GObject *object,
guint prop_id,
@ -198,8 +198,9 @@ gst_ac3parse_init (GstAc3Parse *ac3parse)
}
static void
gst_ac3parse_chain (GstPad *pad, GstBuffer *buf)
gst_ac3parse_chain (GstPad *pad, GstData *_data)
{
GstBuffer *buf = GST_BUFFER (_data);
GstAc3Parse *ac3parse;
guchar *data;
glong size,offset = 0;
@ -346,7 +347,7 @@ gst_ac3parse_chain (GstPad *pad, GstBuffer *buf)
offset += bpf;
if (ac3parse->skip == 0 && GST_PAD_IS_LINKED(ac3parse->srcpad)) {
GST_DEBUG ("ac3parse: pushing buffer of %d bytes",GST_BUFFER_SIZE(outbuf));
gst_pad_push(ac3parse->srcpad,outbuf);
gst_pad_push(ac3parse->srcpad,GST_DATA (outbuf));
}
else {
GST_DEBUG ("ac3parse: skipping buffer of %d bytes",GST_BUFFER_SIZE(outbuf));

View file

@ -970,7 +970,7 @@ gst_asf_demux_process_chunk (GstASFDemux *asf_demux,
GST_DEBUG ("Sending strem %d of size %d", stream->id , segment_info->chunk_size);
GST_INFO ( "Pushing pad");
gst_pad_push (stream->pad, stream->payload);
gst_pad_push (stream->pad, GST_DATA (stream->payload));
}
stream->frag_offset = 0;
@ -1020,7 +1020,7 @@ gst_asf_demux_handle_sink_event (GstASFDemux *asf_demux)
asf_demux->last_seek, stream->delay, asf_demux->last_seek + stream->delay);
discont = gst_event_new_discontinuous (FALSE, GST_FORMAT_TIME,
asf_demux->last_seek + stream->delay , NULL);
gst_pad_push (stream->pad, GST_BUFFER (discont));
gst_pad_push (stream->pad, GST_DATA (discont));
}
}
break;

View file

@ -698,7 +698,7 @@ gst_asfmux_fill_queue (GstAsfMux *asfmux)
stream->connected == TRUE &&
GST_PAD_IS_USABLE (stream->pad) &&
stream->eos == FALSE) {
buffer = gst_pad_pull (stream->pad);
buffer = GST_BUFFER (gst_pad_pull (stream->pad));
if (GST_IS_EVENT (buffer)) {
gst_asfmux_handle_event (stream->pad, GST_EVENT (buffer));
} else {
@ -843,7 +843,7 @@ static void
gst_asfmux_put_flush (GstAsfMux *asfmux)
{
gst_pad_push (asfmux->srcpad,
GST_BUFFER (gst_event_new_flush ()));
GST_DATA (gst_event_new_flush ()));
}
/* write an asf chunk (only used in streaming case) */
@ -1114,7 +1114,7 @@ gst_asfmux_file_start (GstAsfMux *asfmux,
gst_asfmux_put_byte (header, 1); /* ??? */
gst_asfmux_put_byte (header, 1); /* ??? */
gst_pad_push (asfmux->srcpad, header);
gst_pad_push (asfmux->srcpad, GST_DATA (header));
asfmux->write_header = FALSE;
}
@ -1126,7 +1126,7 @@ gst_asfmux_file_stop (GstAsfMux *asfmux)
GstBuffer *footer = gst_buffer_new_and_alloc (16);
GST_BUFFER_SIZE (footer) = 0;
gst_asfmux_put_chunk (footer, asfmux, 0x4524, 0, 0); /* end of stream */
gst_pad_push (asfmux->srcpad, footer);
gst_pad_push (asfmux->srcpad, GST_DATA (footer));
} else if (gst_asfmux_can_seek (asfmux)) {
/* rewrite an updated header */
guint64 filesize;
@ -1135,10 +1135,10 @@ gst_asfmux_file_stop (GstAsfMux *asfmux)
gst_pad_query (asfmux->srcpad, GST_QUERY_POSITION,
&fmt, &filesize);
event = gst_event_new_seek (GST_SEEK_METHOD_SET | GST_FORMAT_BYTES, 0);
gst_pad_push (asfmux->srcpad, GST_BUFFER (event));
gst_pad_push (asfmux->srcpad, GST_DATA (event));
gst_asfmux_file_start (asfmux, filesize, filesize - asfmux->data_offset);
event = gst_event_new_seek (GST_SEEK_METHOD_SET | GST_FORMAT_BYTES, filesize);
gst_pad_push (asfmux->srcpad, GST_BUFFER (event));
gst_pad_push (asfmux->srcpad, GST_DATA (event));
}
gst_asfmux_put_flush (asfmux);
@ -1235,8 +1235,8 @@ gst_asfmux_packet_flush (GstAsfMux *asfmux)
GST_BUFFER_SIZE (packet) = GST_ASF_PACKET_SIZE - header_size;
/* send packet over */
gst_pad_push (asfmux->srcpad, header);
gst_pad_push (asfmux->srcpad, packet);
gst_pad_push (asfmux->srcpad, GST_DATA (header));
gst_pad_push (asfmux->srcpad, GST_DATA (packet));
gst_asfmux_put_flush (asfmux);
asfmux->num_packets++;
asfmux->packet_frames = 0;
@ -1302,7 +1302,7 @@ gst_asfmux_do_one_buffer (GstAsfMux *asfmux)
/* simply finish off the file and send EOS */
gst_asfmux_file_stop (asfmux);
gst_pad_push (asfmux->srcpad,
GST_BUFFER (gst_event_new (GST_EVENT_EOS)));
GST_DATA (gst_event_new (GST_EVENT_EOS)));
gst_element_set_eos (GST_ELEMENT(asfmux));
return FALSE;
}

View file

@ -97,7 +97,7 @@ static GstPadTemplate *sink_temp, *src_temp;
static void gst_mp3parse_class_init (GstMPEGAudioParseClass *klass);
static void gst_mp3parse_init (GstMPEGAudioParse *mp3parse);
static void gst_mp3parse_chain (GstPad *pad,GstBuffer *buf);
static void gst_mp3parse_chain (GstPad *pad,GstData *_data);
static long bpf_from_header (GstMPEGAudioParse *parse, unsigned long header);
static int head_check (unsigned long head);
@ -384,8 +384,9 @@ gst_mp3parse_init (GstMPEGAudioParse *mp3parse)
}
static void
gst_mp3parse_chain (GstPad *pad, GstBuffer *buf)
gst_mp3parse_chain (GstPad *pad, GstData *_data)
{
GstBuffer *buf = GST_BUFFER (_data);
GstMPEGAudioParse *mp3parse;
guchar *data;
glong size,offset = 0;
@ -498,7 +499,7 @@ gst_mp3parse_chain (GstPad *pad, GstBuffer *buf)
GST_BUFFER_DURATION(outbuf) = 8 * (GST_SECOND/1000) * GST_BUFFER_SIZE(outbuf) / mp3parse->bit_rate;
if (GST_PAD_CAPS (mp3parse->srcpad) != NULL) {
gst_pad_push(mp3parse->srcpad,outbuf);
gst_pad_push(mp3parse->srcpad,GST_DATA (outbuf));
} else {
GST_DEBUG ("No capsnego yet, delaying buffer push");
gst_buffer_unref (outbuf);

View file

@ -304,7 +304,7 @@ gst_mpeg_demux_handle_discont (GstMPEGParse *mpeg_parse)
discont = gst_event_new_discontinuous (FALSE, GST_FORMAT_TIME,
current_time, NULL);
gst_pad_push (mpeg_demux->video_stream[i]->pad, GST_BUFFER (discont));
gst_pad_push (mpeg_demux->video_stream[i]->pad, GST_DATA (discont));
}
if (mpeg_demux->audio_stream[i] &&
GST_PAD_IS_USABLE (mpeg_demux->audio_stream[i]->pad))
@ -314,7 +314,7 @@ gst_mpeg_demux_handle_discont (GstMPEGParse *mpeg_parse)
discont = gst_event_new_discontinuous (FALSE, GST_FORMAT_TIME,
current_time, NULL);
gst_pad_push (mpeg_demux->audio_stream[i]->pad, GST_BUFFER (discont));
gst_pad_push (mpeg_demux->audio_stream[i]->pad, GST_DATA (discont));
}
}
}
@ -509,7 +509,7 @@ gst_mpeg_demux_parse_syshead (GstMPEGParse *mpeg_parse, GstBuffer *buffer)
event = gst_event_new_discontinuous (FALSE, GST_FORMAT_TIME,
MPEGTIME_TO_GSTTIME (time), NULL);
gst_pad_push (*outpad, GST_BUFFER (event));
gst_pad_push (*outpad, GST_DATA (event));
}
}
else {
@ -710,7 +710,7 @@ done:
GST_DEBUG ("pushing buffer of len %d id %d, ts %" G_GINT64_FORMAT,
datalen, id, GST_BUFFER_TIMESTAMP (outbuf));
gst_pad_push (outpad, outbuf);
gst_pad_push (outpad, GST_DATA (outbuf));
}
return TRUE;
@ -1004,7 +1004,7 @@ gst_mpeg_demux_parse_pes (GstMPEGParse *mpeg_parse, GstBuffer *buffer)
GST_BUFFER_TIMESTAMP (outbuf) = timestamp;
GST_BUFFER_OFFSET (outbuf) = GST_BUFFER_OFFSET (buffer) + headerlen + 4;
gst_pad_push(*outpad,outbuf);
gst_pad_push(*outpad, GST_DATA (outbuf));
}
}

View file

@ -285,7 +285,7 @@ gst_mpeg_parse_send_data (GstMPEGParse *mpeg_parse, GstData *data, GstClockTime
GST_DEBUG ("current_scr %" G_GINT64_FORMAT, time);
if (GST_PAD_IS_USABLE (mpeg_parse->srcpad))
gst_pad_push (mpeg_parse->srcpad, GST_BUFFER (data));
gst_pad_push (mpeg_parse->srcpad, GST_DATA (data));
else
gst_data_unref (data);
}
@ -300,7 +300,7 @@ gst_mpeg_parse_handle_discont (GstMPEGParse *mpeg_parse)
MPEGTIME_TO_GSTTIME (mpeg_parse->current_scr), NULL);
if (GST_PAD_IS_USABLE (mpeg_parse->srcpad))
gst_pad_push (mpeg_parse->srcpad, GST_BUFFER (event));
gst_pad_push (mpeg_parse->srcpad, GST_DATA (event));
else
gst_event_unref (event);
}

View file

@ -158,7 +158,7 @@ static void
gst_rfc2250_enc_new_buffer (GstRFC2250Enc *enc)
{
if (enc->packet) {
gst_pad_push (enc->srcpad, enc->packet);
gst_pad_push (enc->srcpad, GST_DATA (enc->packet));
}
enc->packet = gst_buffer_new ();
enc->flags = 0;
@ -263,7 +263,7 @@ gst_rfc2250_enc_loop (GstElement *element)
}
else {
if (enc->packet) {
gst_pad_push (enc->srcpad, enc->packet);
gst_pad_push (enc->srcpad, GST_DATA (enc->packet));
enc->packet = NULL;
enc->flags = 0;
enc->remaining = enc->MTU;

View file

@ -416,7 +416,7 @@ static void gst_rmdemux_loop (GstElement *element)
for(i=0;i<rmdemux->n_streams;i++){
GstPad *pad = rmdemux->streams[i]->pad;
if(pad){
gst_pad_push(pad, GST_BUFFER(gst_event_new(GST_EVENT_EOS)));
gst_pad_push(pad, GST_DATA(gst_event_new(GST_EVENT_EOS)));
}
}
@ -465,7 +465,7 @@ static void gst_rmdemux_loop (GstElement *element)
stream = gst_rmdemux_get_stream_by_id(rmdemux, id);
if(stream->pad){
gst_pad_push(stream->pad, buffer);
gst_pad_push(stream->pad, GST_DATA (buffer));
}
rmdemux->chunk_index++;

View file

@ -129,7 +129,7 @@ static void gst_synaesthesia_set_property (GObject *object, guint prop_id,
static void gst_synaesthesia_get_property (GObject *object, guint prop_id,
GValue *value, GParamSpec *pspec);
static void gst_synaesthesia_chain (GstPad *pad, GstBuffer *buf);
static void gst_synaesthesia_chain (GstPad *pad, GstData *_data);
static GstElementStateReturn
gst_synaesthesia_change_state (GstElement *element);
@ -225,8 +225,9 @@ gst_synaesthesia_sinkconnect (GstPad *pad, GstCaps *caps)
}
static void
gst_synaesthesia_chain (GstPad *pad, GstBuffer *bufin)
gst_synaesthesia_chain (GstPad *pad, GstData *_data)
{
GstBuffer *bufin = GST_BUFFER (_data);
GstSynaesthesia *synaesthesia;
GstBuffer *bufout;
guint32 samples_in;
@ -308,7 +309,7 @@ gst_synaesthesia_chain (GstPad *pad, GstBuffer *bufin)
synaesthesia->next_time += GST_SECOND / synaesthesia->fps;
gst_pad_push (synaesthesia->srcpad, bufout);
gst_pad_push (synaesthesia->srcpad, GST_DATA (bufout));
gst_buffer_unref (bufin);