From b2ce3aab96f924c4d7f5fcbdad2a78682f4ce4ee Mon Sep 17 00:00:00 2001 From: Carl-Anton Ingmarsson Date: Sun, 5 Sep 2010 16:30:05 +0200 Subject: [PATCH] vdpauvideopostprocess: set new framerate on output caps instead of input caps It's not allowed to change the caps provided by the setcaps function. https://bugzilla.gnome.org/show_bug.cgi?id=628326 --- sys/vdpau/gstvdpvideopostprocess.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/sys/vdpau/gstvdpvideopostprocess.c b/sys/vdpau/gstvdpvideopostprocess.c index adaabf4bc3..1091c0e8c4 100644 --- a/sys/vdpau/gstvdpvideopostprocess.c +++ b/sys/vdpau/gstvdpvideopostprocess.c @@ -39,7 +39,7 @@ */ #ifdef HAVE_CONFIG_H -# include +#include #endif #include @@ -501,7 +501,6 @@ gst_vdp_vpp_sink_setcaps (GstPad * pad, GstCaps * caps) } } - structure = gst_caps_get_structure (video_caps, 0); if (!gst_structure_get_int (structure, "width", &vpp->width) || !gst_structure_get_int (structure, "height", &vpp->height) || @@ -522,19 +521,6 @@ gst_vdp_vpp_sink_setcaps (GstPad * pad, GstCaps * caps) } else vpp->got_par = FALSE; - if (gst_vdp_vpp_is_interlaced (vpp)) { - gint fps_n, fps_d; - - if (gst_structure_get_fraction (structure, "framerate", &fps_n, &fps_d)) { - gst_fraction_double (&fps_n, &fps_d); - gst_structure_set (structure, "framerate", GST_TYPE_FRACTION, fps_n, - fps_d, NULL); - vpp->field_duration = gst_util_uint64_scale (GST_SECOND, fps_d, fps_n); - } - - gst_structure_remove_field (structure, "interlaced"); - } - allowed_caps = gst_pad_get_allowed_caps (vpp->srcpad); if (G_UNLIKELY (!allowed_caps)) goto allowed_caps_error; @@ -554,6 +540,20 @@ gst_vdp_vpp_sink_setcaps (GstPad * pad, GstCaps * caps) gst_pad_fixate_caps (vpp->srcpad, src_caps); + + if (gst_vdp_vpp_is_interlaced (vpp)) { + gint fps_n, fps_d; + + if (gst_structure_get_fraction (structure, "framerate", &fps_n, &fps_d)) { + gst_fraction_double (&fps_n, &fps_d); + gst_caps_set_simple (src_caps, "framerate", GST_TYPE_FRACTION, fps_n, + fps_d, NULL); + vpp->field_duration = gst_util_uint64_scale (GST_SECOND, fps_d, fps_n); + } + + gst_caps_set_simple (src_caps, "interlaced", G_TYPE_BOOLEAN, FALSE, NULL); + } + GST_DEBUG ("src_caps: %" GST_PTR_FORMAT, src_caps); res = gst_pad_set_caps (vpp->srcpad, src_caps);