summaryrefslogtreecommitdiffstats
path: root/ext/swfdec
diff options
context:
space:
mode:
authorDavid Schleef <ds@schleef.org>2004-01-02 07:09:23 +0000
committerDavid Schleef <ds@schleef.org>2004-01-02 07:09:23 +0000
commitab8b69675431e3623eac1ecaee91ad80a0786048 (patch)
treee02bdfe53325126a1f8dfe3e8eecea00e64b2111 /ext/swfdec
parent9e9bd20111b288df5012b8965ab392a550ccde08 (diff)
downloadgst-plugins-bad-ab8b69675431e3623eac1ecaee91ad80a0786048.tar.gz
gst-plugins-bad-ab8b69675431e3623eac1ecaee91ad80a0786048.tar.bz2
gst-plugins-bad-ab8b69675431e3623eac1ecaee91ad80a0786048.zip
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/swfdec')
-rw-r--r--ext/swfdec/gstswfdec.c38
1 files changed, 12 insertions, 26 deletions
diff --git a/ext/swfdec/gstswfdec.c b/ext/swfdec/gstswfdec.c
index 6e42c4fa..a7837ede 100644
--- a/ext/swfdec/gstswfdec.c
+++ b/ext/swfdec/gstswfdec.c
@@ -158,27 +158,6 @@ gst_swfdec_class_init(GstSwfdecClass *klass)
gstelement_class->change_state = gst_swfdec_change_state;
}
-static GstCaps *gst_swfdec_videosrc_getcaps(GstPad *pad)
-{
- GstSwfdec *swfdec;
- GstCaps *caps;
-
- swfdec = GST_SWFDEC (gst_pad_get_parent (pad));
-
- caps = gst_caps_copy (gst_pad_template_get_caps (
- gst_static_pad_template_get (&video_template_factory)));
-
- if (swfdec->height) {
- gst_caps_set_simple (caps,
- "framerate", G_TYPE_DOUBLE, swfdec->frame_rate,
- "height",G_TYPE_INT,swfdec->height,
- "width",G_TYPE_INT,swfdec->width,
- NULL);
- }
-
- return caps;
-}
-
static void
gst_swfdec_loop(GstElement *element)
{
@@ -217,14 +196,22 @@ gst_swfdec_loop(GstElement *element)
}
if(ret==SWF_CHANGE){
+ GstCaps *caps;
+
swfdec_decoder_get_image_size(swfdec->state,
&swfdec->width, &swfdec->height);
swfdec_decoder_get_rate(swfdec->state, &swfdec->rate);
swfdec->interval = GST_SECOND / swfdec->rate;
- GST_DEBUG_CAPS ("caps", gst_swfdec_videosrc_getcaps(swfdec->videopad));
- gst_pad_try_set_caps(swfdec->videopad,
- gst_swfdec_videosrc_getcaps(swfdec->videopad));
+ caps = gst_caps_copy (gst_pad_get_pad_template_caps (
+ swfdec->videopad));
+ gst_caps_set_simple (caps,
+ "framerate", G_TYPE_DOUBLE, (double)swfdec->frame_rate,
+ "height",G_TYPE_INT,swfdec->height,
+ "width",G_TYPE_INT,swfdec->width,
+ NULL);
+ gst_pad_set_explicit_caps(swfdec->videopad, caps);
+
return;
}
@@ -280,8 +267,7 @@ gst_swfdec_init (GstSwfdec *swfdec)
"video_00");
gst_pad_set_query_function (swfdec->videopad,
GST_DEBUG_FUNCPTR (gst_swfdec_src_query));
- gst_pad_set_getcaps_function (swfdec->videopad,
- GST_DEBUG_FUNCPTR (gst_swfdec_videosrc_getcaps));
+ gst_pad_use_explicit_caps (swfdec->videopad);
gst_element_add_pad(GST_ELEMENT(swfdec), swfdec->videopad);
swfdec->audiopad = gst_pad_new_from_template(