From 11c39abc9a99d5fcb0070988ffe0d773d9780875 Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Tue, 22 Nov 2005 22:21:37 +0000 Subject: More fractional framerate conversions Original commit message from CVS: * ext/cairo/gsttextoverlay.c: (gst_text_overlay_init), (gst_text_overlay_setcaps), (gst_text_overlay_collected): * ext/cairo/gsttextoverlay.h: * ext/gdk_pixbuf/gstgdkpixbuf.c: (gst_gdk_pixbuf_sink_link): * ext/gdk_pixbuf/gstgdkpixbuf.h: * ext/libpng/gstpngdec.c: (gst_pngdec_init), (gst_pngdec_caps_create_and_set): * ext/libpng/gstpngdec.h: * ext/libpng/gstpngenc.c: (gst_pngenc_setcaps): * gst/alpha/gstalphacolor.c: (gst_alpha_color_set_caps): * gst/avi/gstavimux.c: (gst_avimux_init), (gst_avimux_vidsinkconnect): * gst/flx/gstflxdec.c: (gst_flxdec_chain): * gst/goom/gstgoom.c: (gst_goom_init), (gst_goom_src_setcaps), (gst_goom_src_negotiate), (gst_goom_chain): * gst/goom/gstgoom.h: * gst/matroska/matroska-demux.c: (gst_matroska_demux_video_caps): * gst/matroska/matroska-mux.c: (gst_matroska_mux_video_pad_setcaps): * sys/osxvideo/osxvideosink.h: * sys/osxvideo/osxvideosink.m: More fractional framerate conversions --- ext/gdk_pixbuf/gstgdkpixbuf.c | 10 +++++++--- ext/gdk_pixbuf/gstgdkpixbuf.h | 3 ++- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'ext/gdk_pixbuf') diff --git a/ext/gdk_pixbuf/gstgdkpixbuf.c b/ext/gdk_pixbuf/gstgdkpixbuf.c index 5846b18e..9a602ea8 100644 --- a/ext/gdk_pixbuf/gstgdkpixbuf.c +++ b/ext/gdk_pixbuf/gstgdkpixbuf.c @@ -107,14 +107,18 @@ static GstPadLinkReturn gst_gdk_pixbuf_sink_link (GstPad * pad, const GstCaps * caps) { GstGdkPixbuf *filter; + const GValue *fps; filter = GST_GDK_PIXBUF (gst_pad_get_parent (pad)); g_return_val_if_fail (filter != NULL, GST_PAD_LINK_REFUSED); g_return_val_if_fail (GST_IS_GDK_PIXBUF (filter), GST_PAD_LINK_REFUSED); - filter->framerate = 1.0; - gst_structure_get_double (gst_caps_get_structure (caps, 0), "framerate", - &filter->framerate); + fps = gst_structure_get_value (gst_caps_get_structure (caps, 0), "framerate"); + if (fps != NULL && GST_VALUE_HOLDS_FRACTION (fps)) { + filter->fps_n = gst_value_get_fraction_numerator (fps); + filter->fps_d = gst_value_get_fraction_denominator (fps); + } else + return GST_PAD_LINK_REFUSED; return GST_PAD_LINK_OK; } diff --git a/ext/gdk_pixbuf/gstgdkpixbuf.h b/ext/gdk_pixbuf/gstgdkpixbuf.h index dc308cc7..4a1f9a3d 100644 --- a/ext/gdk_pixbuf/gstgdkpixbuf.h +++ b/ext/gdk_pixbuf/gstgdkpixbuf.h @@ -56,7 +56,8 @@ struct _GstGdkPixbuf int rowstride; unsigned int image_size; - double framerate; + gint fps_n; + gint fps_d; }; struct _GstGdkPixbufClass -- cgit