From 86a4117f7e2eaefa67c7f826d50b709d50258431 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Mon, 12 Jan 2004 03:40:18 +0000 Subject: [PATCH] Remove all usage of gst_pad_get_caps(), and replace it with gst_pad_get_allowed_caps() or gst_pad_get_negotiated_cap(). Original commit message from CVS: Remove all usage of gst_pad_get_caps(), and replace it with gst_pad_get_allowed_caps() or gst_pad_get_negotiated_cap(). --- ChangeLog | 18 ++++++++++++++++++ ext/gdk_pixbuf/gstgdkanimation.c | 2 +- ext/gdk_pixbuf/gstgdkpixbuf.c | 8 ++++++-- ext/gdk_pixbuf/gstgdkpixbuf.h | 2 ++ gst/videofilter/gstvideofilter.c | 2 +- 5 files changed, 28 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1be20b9de6..1457ec2b60 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +2004-01-11 David Schleef + + * ext/alsa/gstalsasrc.c: (gst_alsa_src_set_caps): + * ext/faac/gstfaac.c: (gst_faac_sinkconnect): + * ext/gdk_pixbuf/gstgdkanimation.c: + (gst_gdk_animation_iter_create_pixbuf): + * ext/gdk_pixbuf/gstgdkpixbuf.c: (gst_gdk_pixbuf_sink_link), + (gst_gdk_pixbuf_chain): + * ext/gdk_pixbuf/gstgdkpixbuf.h: + * ext/jack/gstjack.c: (gst_jack_change_state): + * ext/xvid/gstxviddec.c: (gst_xviddec_sink_link): + * gst-libs/gst/play/gstplay.c: (gst_play_get_sink_element): + * gst-libs/gst/play/play.c: (gst_play_get_sink_element): + * gst/videofilter/gstvideofilter.c: + (gst_videofilter_set_output_size): + Remove all usage of gst_pad_get_caps(), and replace it with + gst_pad_get_allowed_caps() or gst_pad_get_negotiated_cap(). + 2004-01-11 David Schleef * configure.ac: diff --git a/ext/gdk_pixbuf/gstgdkanimation.c b/ext/gdk_pixbuf/gstgdkanimation.c index 934653c6cc..78e92216c5 100644 --- a/ext/gdk_pixbuf/gstgdkanimation.c +++ b/ext/gdk_pixbuf/gstgdkanimation.c @@ -370,7 +370,7 @@ gst_gdk_animation_iter_create_pixbuf (GstGdkAnimationIter *iter) g_assert (fakesink); pad = gst_element_get_pad (fakesink, "sink"); g_assert (pad); - caps = gst_pad_get_caps (pad); + caps = gst_pad_get_negotiated_caps (pad); g_assert (caps); g_assert (GST_CAPS_IS_FIXED (caps)); g_assert (gst_caps_has_fixed_property (caps, "bpp") && diff --git a/ext/gdk_pixbuf/gstgdkpixbuf.c b/ext/gdk_pixbuf/gstgdkpixbuf.c index 10aea2ac8c..05821887d7 100644 --- a/ext/gdk_pixbuf/gstgdkpixbuf.c +++ b/ext/gdk_pixbuf/gstgdkpixbuf.c @@ -109,6 +109,10 @@ gst_gdk_pixbuf_sink_link (GstPad *pad, const GstCaps *caps) g_return_val_if_fail (GST_IS_GDK_PIXBUF (filter), GST_PAD_LINK_REFUSED); + filter->framerate = 0.0; + gst_structure_get_double (gst_caps_get_structure (caps, 0), "framerate", + &filter->framerate); + return GST_PAD_LINK_OK; } @@ -300,11 +304,11 @@ gst_gdk_pixbuf_chain (GstPad *pad, GstData *_data) filter->rowstride = gdk_pixbuf_get_rowstride(pixbuf); filter->image_size = filter->rowstride * filter->height; - caps = gst_pad_get_caps(filter->srcpad); + caps = gst_caps_copy (gst_pad_get_pad_template_caps (filter->srcpad)); gst_caps_set_simple (caps, "width", G_TYPE_INT, filter->width, "height", G_TYPE_INT, filter->height, - "framerate", G_TYPE_DOUBLE, 0., NULL); + "framerate", G_TYPE_DOUBLE, filter->framerate, NULL); gst_pad_set_explicit_caps (filter->srcpad, caps); } diff --git a/ext/gdk_pixbuf/gstgdkpixbuf.h b/ext/gdk_pixbuf/gstgdkpixbuf.h index 336c1e51af..62e11aac64 100644 --- a/ext/gdk_pixbuf/gstgdkpixbuf.h +++ b/ext/gdk_pixbuf/gstgdkpixbuf.h @@ -55,6 +55,8 @@ struct _GstGdkPixbuf int height; int rowstride; unsigned int image_size; + + double framerate; }; struct _GstGdkPixbufClass diff --git a/gst/videofilter/gstvideofilter.c b/gst/videofilter/gstvideofilter.c index d26014d984..7ef18e4a94 100644 --- a/gst/videofilter/gstvideofilter.c +++ b/gst/videofilter/gstvideofilter.c @@ -411,7 +411,7 @@ void gst_videofilter_set_output_size(GstVideofilter *videofilter, videofilter->to_buf_size = (videofilter->to_width * videofilter->to_height * videofilter->format->bpp)/8; - srccaps = gst_caps_copy(gst_pad_get_caps(videofilter->srcpad)); + srccaps = gst_caps_copy (gst_pad_get_negotiated_caps(videofilter->srcpad)); structure = gst_caps_get_structure (srccaps, 0); gst_structure_set (structure, "width", G_TYPE_INT, width,