Convert elements to use gst_pad_use_explicit_caps() where appropriate.

Original commit message from CVS:
Convert elements to use gst_pad_use_explicit_caps() where appropriate.
This commit is contained in:
David Schleef 2004-01-02 07:09:22 +00:00
parent 274b241a38
commit 7ccfa2dac7
3 changed files with 61 additions and 8 deletions

View file

@ -1,3 +1,55 @@
2004-01-01 David Schleef <ds@schleef.org>
Convert elements to use gst_pad_use_explicit_caps() where
appropriate:
* ext/a52dec/gsta52dec.c: (gst_a52dec_init), (gst_a52dec_reneg):
* ext/audiofile/gstafparse.c: (gst_afparse_init),
(gst_afparse_open_file):
* ext/audiofile/gstafsrc.c: (gst_afsrc_init),
(gst_afsrc_open_file):
* ext/esd/esdmon.c: (gst_esdmon_init), (gst_esdmon_get):
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_init),
(gst_ffmpegdec_chain):
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_loop):
* ext/flac/gstflacdec.c: (gst_flacdec_init), (gst_flacdec_write):
* ext/gdk_pixbuf/gstgdkpixbuf.c: (gst_gdk_pixbuf_init),
(gst_gdk_pixbuf_chain):
* ext/jpeg/gstjpegdec.c: (gst_jpegdec_init), (gst_jpegdec_link),
(gst_jpegdec_chain):
* ext/mad/gstmad.c: (gst_mad_init), (gst_mad_chain):
* ext/mikmod/gstmikmod.c: (gst_mikmod_init),
(gst_mikmod_negotiate):
* ext/mpeg2dec/gstmpeg2dec.c: (gst_mpeg2dec_init),
(gst_mpeg2dec_negotiate_format):
* ext/mpeg2enc/gstmpeg2enc.cc:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_push):
* ext/speex/gstspeexdec.c: (gst_speexdec_init),
(gst_speexdec_sinkconnect):
* ext/swfdec/gstswfdec.c: (gst_swfdec_loop), (gst_swfdec_init):
* ext/vorbis/vorbisfile.c: (gst_vorbisfile_init),
(gst_vorbisfile_new_link):
* gst/ac3parse/gstac3parse.c: (gst_ac3parse_init),
(gst_ac3parse_chain):
* gst/asfdemux/gstasfdemux.c: (gst_asf_demux_add_audio_stream),
(gst_asf_demux_setup_pad):
* gst/auparse/gstauparse.c: (gst_auparse_init),
(gst_auparse_chain):
* gst/id3/gstid3types.c: (gst_id3types_loop):
* gst/matroska/matroska-demux.c: (gst_matroska_demux_add_stream):
* gst/mpeg1videoparse/gstmp1videoparse.c: (gst_mp1videoparse_init),
(mp1videoparse_parse_seq):
* gst/mpegaudioparse/gstmpegaudioparse.c: (gst_mp3parse_init),
(bpf_from_header):
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_parse_syshead),
(gst_mpeg_demux_parse_pes), (gst_mpeg_demux_lpcm_set_caps):
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_init),
(gst_mpeg_parse_send_data):
* gst/qtdemux/qtdemux.c: (gst_qtdemux_loop_header),
(gst_qtdemux_add_stream):
* gst/realmedia/rmdemux.c: (gst_rmdemux_add_stream):
* gst/wavparse/gstwavparse.c: (gst_wavparse_init),
(gst_wavparse_parse_fmt):
2004-01-01 Ronald Bultje <rbultje@ronald.bitfreak.net>
* configure.ac:

View file

@ -437,6 +437,11 @@ gst_ogg_pad_push (GstOggDemux *ogg, GstOggPad *pad)
GstCaps *caps = gst_ogg_type_find (&packet);
gchar *name = g_strdup_printf ("serial %d", pad->serial);
if (caps == NULL) {
gst_element_error (GST_ELEMENT (ogg),
"couldn't determine stream type from media");
return;
}
pad->pad = gst_pad_new_from_template (
gst_static_pad_template_get (&ogg_demux_src_template_factory),
name);
@ -445,8 +450,8 @@ gst_ogg_pad_push (GstOggDemux *ogg, GstOggPad *pad)
gst_pad_set_event_mask_function (pad->pad, GST_DEBUG_FUNCPTR (gst_ogg_demux_get_event_masks));
gst_pad_set_query_function (pad->pad, GST_DEBUG_FUNCPTR (gst_ogg_demux_src_query));
gst_pad_set_query_type_function (pad->pad, GST_DEBUG_FUNCPTR (gst_ogg_demux_get_query_types));
if (caps)
g_assert (gst_pad_try_set_caps (pad->pad, caps) >= GST_PAD_LINK_OK);
gst_pad_use_explicit_caps (pad->pad);
gst_pad_set_explicit_caps (pad->pad, caps);
gst_pad_set_active (pad->pad, TRUE);
gst_element_add_pad (GST_ELEMENT (ogg), pad->pad);
}

View file

@ -270,6 +270,7 @@ gst_vorbisfile_init (VorbisFile * vorbisfile)
gst_vorbisfile_get_event_masks);
gst_pad_set_event_function (vorbisfile->srcpad, gst_vorbisfile_src_event);
gst_pad_set_convert_function (vorbisfile->srcpad, gst_vorbisfile_src_convert);
gst_pad_use_explicit_caps (vorbisfile->srcpad);
vorbisfile->total_bytes = 0;
vorbisfile->offset = 0;
@ -525,12 +526,7 @@ gst_vorbisfile_new_link (VorbisFile *vorbisfile, gint link)
"channels", G_TYPE_INT, vi->channels,
NULL);
if (gst_pad_try_set_caps (vorbisfile->srcpad, caps) <= 0) {
res = FALSE;
}
gst_caps_free (caps);
return res;
return gst_pad_set_explicit_caps (vorbisfile->srcpad, caps);
}
static void