diff options
Diffstat (limited to 'gst')
-rw-r--r-- | gst/mpeg1videoparse/gstmp1videoparse.c | 7 | ||||
-rw-r--r-- | gst/mpegaudioparse/gstmpegaudioparse.c | 6 | ||||
-rw-r--r-- | gst/qtdemux/qtdemux.c | 60 |
3 files changed, 7 insertions, 66 deletions
diff --git a/gst/mpeg1videoparse/gstmp1videoparse.c b/gst/mpeg1videoparse/gstmp1videoparse.c index 1cdefbb1..645392ba 100644 --- a/gst/mpeg1videoparse/gstmp1videoparse.c +++ b/gst/mpeg1videoparse/gstmp1videoparse.c @@ -151,6 +151,7 @@ gst_mp1videoparse_init (Mp1VideoParse *mp1videoparse) mp1videoparse->srcpad = gst_pad_new_from_template ( gst_static_pad_template_get (&src_factory), "src"); gst_element_add_pad(GST_ELEMENT(mp1videoparse),mp1videoparse->srcpad); + gst_pad_use_explicit_caps (mp1videoparse->srcpad); mp1videoparse->partialbuf = NULL; mp1videoparse->need_resync = FALSE; @@ -209,11 +210,7 @@ mp1videoparse_parse_seq (Mp1VideoParse *mp1videoparse, GstBuffer *buf) GST_DEBUG_CAPS ("New mpeg1videoparse caps", caps); - if (gst_pad_try_set_caps (mp1videoparse->srcpad, caps) <= 0) { - gst_element_error (GST_ELEMENT (mp1videoparse), - "mp1videoparse: failed to negotiate a new format"); - return; - } + gst_pad_set_explicit_caps (mp1videoparse->srcpad, caps); } } diff --git a/gst/mpegaudioparse/gstmpegaudioparse.c b/gst/mpegaudioparse/gstmpegaudioparse.c index 9b13019d..9363dfe6 100644 --- a/gst/mpegaudioparse/gstmpegaudioparse.c +++ b/gst/mpegaudioparse/gstmpegaudioparse.c @@ -290,6 +290,7 @@ gst_mp3parse_init (GstMPEGAudioParse *mp3parse) mp3parse->srcpad = gst_pad_new_from_template( gst_static_pad_template_get (&mp3_src_template), "src"); gst_element_add_pad(GST_ELEMENT(mp3parse),mp3parse->srcpad); + gst_pad_use_explicit_caps (mp3parse->srcpad); /*gst_pad_set_type_id(mp3parse->srcpad, mp3frametype); */ mp3parse->partialbuf = NULL; @@ -465,10 +466,7 @@ bpf_from_header (GstMPEGAudioParse *parse, unsigned long header) bitrate != parse->bit_rate) { GstCaps *caps = mp3_caps_create (layer, channels, bitrate, rate); - if (gst_pad_try_set_caps(parse->srcpad, caps) <= 0) { - gst_element_error (GST_ELEMENT (parse), - "mp3parse: failed to negotiate format with next element"); - } + gst_pad_set_explicit_caps(parse->srcpad, caps); parse->channels = channels; parse->layer = layer; diff --git a/gst/qtdemux/qtdemux.c b/gst/qtdemux/qtdemux.c index 659c968b..4361dd24 100644 --- a/gst/qtdemux/qtdemux.c +++ b/gst/qtdemux/qtdemux.c @@ -504,7 +504,7 @@ static void gst_qtdemux_loop_header (GstElement *element) gst_caps_set_simple (stream->caps, "framerate", G_TYPE_DOUBLE, fps, NULL); stream->fps = fps; - gst_pad_try_set_caps(stream->pad, stream->caps); + gst_pad_set_explicit_caps(stream->pad, stream->caps); } } @@ -522,52 +522,6 @@ static void gst_qtdemux_loop_header (GstElement *element) } -static GstCaps *gst_qtdemux_src_getcaps(GstPad *pad) -{ - GstQTDemux *qtdemux; - QtDemuxStream *stream; - - GST_DEBUG ("gst_qtdemux_src_getcaps"); - - qtdemux = GST_QTDEMUX(gst_pad_get_parent(pad)); - - g_return_val_if_fail(GST_IS_QTDEMUX(qtdemux), NULL); - - stream = GST_PAD_ELEMENT_PRIVATE (pad); - return gst_caps_copy(stream->caps); -} - -#if 0 -/* This function doesn't do anything useful, but might be useful later */ -static GstPadLinkReturn -gst_qtdemux_src_link(GstPad *pad, GstCaps *caps) -{ - GstQTDemux *qtdemux; - QtDemuxStream *stream; - int i; - - GST_DEBUG ("gst_qtdemux_src_link"); - - qtdemux = GST_QTDEMUX(gst_pad_get_parent(pad)); - - GST_DEBUG ("looking for pad %p in qtdemux %p", pad, qtdemux); - g_return_val_if_fail(GST_IS_QTDEMUX(qtdemux), GST_PAD_LINK_REFUSED); - - GST_DEBUG ("n_streams is %d", qtdemux->n_streams); - for(i=0;i<qtdemux->n_streams;i++){ - stream = qtdemux->streams[i]; - GST_DEBUG ("pad[%d] is %p", i, stream->pad); - if(stream->pad == pad){ - return GST_PAD_LINK_OK; - } - } - - GST_DEBUG ("Couldn't find stream cooresponding to pad\n"); - - return GST_PAD_LINK_REFUSED; -} -#endif - void gst_qtdemux_add_stream(GstQTDemux *qtdemux, QtDemuxStream *stream) { if(stream->subtype == GST_MAKE_FOURCC('v','i','d','e')){ @@ -594,10 +548,7 @@ void gst_qtdemux_add_stream(GstQTDemux *qtdemux, QtDemuxStream *stream) qtdemux->n_audio_streams++; } - gst_pad_set_getcaps_function(stream->pad, gst_qtdemux_src_getcaps); -#ifdef unused - gst_pad_set_link_function(stream->pad, gst_qtdemux_src_link); -#endif + gst_pad_use_explicit_caps (stream->pad); GST_PAD_ELEMENT_PRIVATE(stream->pad) = stream; qtdemux->streams[qtdemux->n_streams] = stream; @@ -607,12 +558,7 @@ void gst_qtdemux_add_stream(GstQTDemux *qtdemux, QtDemuxStream *stream) GST_DEBUG ("adding pad %p to qtdemux %p", stream->pad, qtdemux); gst_element_add_pad(GST_ELEMENT (qtdemux), stream->pad); - /* Note: we need to have everything set up before calling try_set_caps */ - if(stream->caps){ - GST_DEBUG_CAPS ("setting caps",stream->caps); - - gst_pad_try_set_caps(stream->pad, stream->caps); - } + gst_pad_set_explicit_caps(stream->pad, stream->caps); } |