diff options
author | David Schleef <ds@schleef.org> | 2004-01-02 07:09:23 +0000 |
---|---|---|
committer | David Schleef <ds@schleef.org> | 2004-01-02 07:09:23 +0000 |
commit | 6c1b114eed9ec1bf3ffea9a63294e927e29cc2b8 (patch) | |
tree | 3c29572d6b4db945275248591c33c116864eeca5 /ext | |
parent | 39a338d51c31e3e77a4f00cbcf415c5822762ed0 (diff) |
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.
Diffstat (limited to 'ext')
-rw-r--r-- | ext/esd/esdmon.c | 4 | ||||
-rw-r--r-- | ext/flac/gstflacdec.c | 3 | ||||
-rw-r--r-- | ext/gdk_pixbuf/gstgdkpixbuf.c | 3 | ||||
-rw-r--r-- | ext/jpeg/gstjpegdec.c | 12 | ||||
-rw-r--r-- | ext/mikmod/gstmikmod.c | 3 | ||||
-rw-r--r-- | ext/speex/gstspeexdec.c | 3 |
6 files changed, 19 insertions, 9 deletions
diff --git a/ext/esd/esdmon.c b/ext/esd/esdmon.c index e2a91ed4..394220e4 100644 --- a/ext/esd/esdmon.c +++ b/ext/esd/esdmon.c @@ -200,6 +200,7 @@ gst_esdmon_init(GTypeInstance *instance, gpointer g_class) gst_element_class_get_pad_template (GST_ELEMENT_GET_CLASS (esdmon), "src"), "src"); gst_pad_set_get_function(esdmon->srcpad, gst_esdmon_get); + gst_pad_use_explicit_caps (esdmon->srcpad); gst_element_add_pad(GST_ELEMENT(esdmon), esdmon->srcpad); esdmon->fd = -1; @@ -256,8 +257,7 @@ gst_esdmon_get (GstPad *pad) if (!GST_PAD_CAPS (pad)) { gint sign = (esdmon->depth == 8 ? FALSE : TRUE); /* set caps on src pad */ - /* FIXME: do this dynamically */ - if (gst_pad_try_set_caps (esdmon->srcpad, + if (gst_pad_set_explicit_caps (esdmon->srcpad, gst_caps_new_simple ("audio/x-raw-int", "endianness", G_TYPE_INT, G_BYTE_ORDER, "signed", G_TYPE_BOOLEAN, sign, diff --git a/ext/flac/gstflacdec.c b/ext/flac/gstflacdec.c index 62b39bbc..5b893d66 100644 --- a/ext/flac/gstflacdec.c +++ b/ext/flac/gstflacdec.c @@ -190,6 +190,7 @@ gst_flacdec_init (FlacDec *flacdec) gst_pad_set_query_function (flacdec->srcpad, gst_flacdec_src_query); gst_pad_set_event_mask_function (flacdec->srcpad, gst_flacdec_get_src_event_masks); gst_pad_set_event_function (flacdec->srcpad, gst_flacdec_src_event); + gst_pad_use_explicit_caps (flacdec->srcpad); flacdec->decoder = FLAC__seekable_stream_decoder_new (); flacdec->total_samples = 0; @@ -473,7 +474,7 @@ gst_flacdec_write (const FLAC__SeekableStreamDecoder *decoder, } if (!GST_PAD_CAPS (flacdec->srcpad)) { - gst_pad_try_set_caps (flacdec->srcpad, + gst_pad_set_explicit_caps (flacdec->srcpad, gst_caps_new_simple ("audio/x-raw-int", "endianness", G_TYPE_INT, G_BYTE_ORDER, "signed", G_TYPE_BOOLEAN, TRUE, diff --git a/ext/gdk_pixbuf/gstgdkpixbuf.c b/ext/gdk_pixbuf/gstgdkpixbuf.c index 1034de65..f85a7bf9 100644 --- a/ext/gdk_pixbuf/gstgdkpixbuf.c +++ b/ext/gdk_pixbuf/gstgdkpixbuf.c @@ -228,6 +228,7 @@ gst_gdk_pixbuf_init (GstGdkPixbuf *filter) gst_pad_set_getcaps_function (filter->sinkpad, gst_gdk_pixbuf_sink_getcaps); filter->srcpad = gst_pad_new_from_template ( gst_static_pad_template_get( &gst_gdk_pixbuf_src_template), "src"); + gst_pad_use_explicit_caps (filter->srcpad); gst_element_add_pad (GST_ELEMENT (filter), filter->sinkpad); gst_element_add_pad (GST_ELEMENT (filter), filter->srcpad); @@ -278,7 +279,7 @@ gst_gdk_pixbuf_chain (GstPad *pad, GstData *_data) "height", G_TYPE_INT, filter->height, "framerate", G_TYPE_DOUBLE, 0., NULL); - gst_pad_try_set_caps(filter->srcpad, caps); + gst_pad_set_explicit_caps (filter->srcpad, caps); } outbuf = gst_buffer_new(); diff --git a/ext/jpeg/gstjpegdec.c b/ext/jpeg/gstjpegdec.c index 9c9af750..1598f008 100644 --- a/ext/jpeg/gstjpegdec.c +++ b/ext/jpeg/gstjpegdec.c @@ -167,6 +167,7 @@ gst_jpegdec_init (GstJpegDec *jpegdec) gst_pad_set_chain_function(jpegdec->sinkpad,gst_jpegdec_chain); gst_pad_set_link_function(jpegdec->sinkpad, gst_jpegdec_link); jpegdec->srcpad = gst_pad_new_from_template (jpegdec_src_template, "src"); + gst_pad_use_explicit_caps (jpegdec->srcpad); gst_element_add_pad(GST_ELEMENT(jpegdec),jpegdec->srcpad); /* initialize the jpegdec decoder state */ @@ -201,6 +202,7 @@ gst_jpegdec_link (GstPad *pad, const GstCaps *caps) { GstJpegDec *jpegdec = GST_JPEGDEC (gst_pad_get_parent (pad)); GstStructure *structure; + GstCaps *srccaps; structure = gst_caps_get_structure (caps, 0); @@ -208,14 +210,18 @@ gst_jpegdec_link (GstPad *pad, const GstCaps *caps) gst_structure_get_int (structure, "width", &jpegdec->width); gst_structure_get_int (structure, "height", &jpegdec->height); - caps = gst_caps_new_simple ("video/x-raw-yuv", + srccaps = gst_caps_new_simple ("video/x-raw-yuv", "format", GST_TYPE_FOURCC, GST_MAKE_FOURCC ('I','4','2','0'), "width", G_TYPE_INT, jpegdec->width, "height", G_TYPE_INT, jpegdec->height, "framerate", G_TYPE_DOUBLE, jpegdec->fps, NULL); - return gst_pad_try_set_caps (jpegdec->srcpad, caps); + /* at this point, we're pretty sure that this will be the output + * format, so we'll set it. */ + gst_pad_set_explicit_caps (jpegdec->srcpad, srccaps); + + return GST_PAD_LINK_OK; } /* shamelessly ripped from jpegutils.c in mjpegtools */ @@ -404,7 +410,7 @@ gst_jpegdec_chain (GstPad *pad, GstData *_data) jpegdec->line[2] = g_realloc(jpegdec->line[2], height*sizeof(char*)); jpegdec->height = height; - gst_pad_try_set_caps (jpegdec->srcpad, + gst_pad_set_explicit_caps (jpegdec->srcpad, gst_caps_new_simple ("video/x-raw-yuv", "format", GST_TYPE_FOURCC, GST_MAKE_FOURCC ('I','4','2','0'), "width", G_TYPE_INT, width, diff --git a/ext/mikmod/gstmikmod.c b/ext/mikmod/gstmikmod.c index d624f49e..7720fbee 100644 --- a/ext/mikmod/gstmikmod.c +++ b/ext/mikmod/gstmikmod.c @@ -188,6 +188,7 @@ gst_mikmod_init (GstMikMod *filter) gst_static_pad_template_get (&mikmod_sink_factory),"sink"); filter->srcpad = gst_pad_new_from_template( gst_static_pad_template_get (&mikmod_src_factory),"src"); + gst_pad_use_explicit_caps (filter->srcpad); gst_element_add_pad(GST_ELEMENT(filter),filter->sinkpad); gst_element_add_pad(GST_ELEMENT(filter),filter->srcpad); @@ -226,7 +227,7 @@ gst_mikmod_negotiate (GstMikMod *mikmod) sign = FALSE; } - return gst_pad_try_set_caps (mikmod->srcpad, + return gst_pad_set_explicit_caps (mikmod->srcpad, gst_caps_new_simple ( "audio/x-raw-int", "endianness", G_TYPE_INT, G_BYTE_ORDER, "signed", G_TYPE_BOOLEAN, sign, diff --git a/ext/speex/gstspeexdec.c b/ext/speex/gstspeexdec.c index 5e249a73..a5ab788e 100644 --- a/ext/speex/gstspeexdec.c +++ b/ext/speex/gstspeexdec.c @@ -138,6 +138,7 @@ gst_speexdec_init (GstSpeexDec *speexdec) gst_pad_set_link_function (speexdec->sinkpad, gst_speexdec_sinkconnect); speexdec->srcpad = gst_pad_new_from_template (speexdec_src_template, "src"); + gst_pad_use_explicit_caps (speexdec->srcpad); gst_element_add_pad (GST_ELEMENT (speexdec), speexdec->srcpad); } @@ -154,7 +155,7 @@ gst_speexdec_sinkconnect (GstPad *pad, const GstCaps *caps) structure = gst_caps_get_structure (caps, 0); gst_structure_get_int (structure, "rate", &rate); - if (gst_pad_try_set_caps (speexdec->srcpad, + if (gst_pad_set_explicit_caps (speexdec->srcpad, gst_caps_new_simple ("audio/x-raw-int", "endianness", G_TYPE_INT, G_BYTE_ORDER, "signed", G_TYPE_BOOLEAN, TRUE, |