From 18e6e4edece67383b8424fb4f4dff9d381dbe41f Mon Sep 17 00:00:00 2001 From: Song Bing Date: Mon, 8 Jun 2015 17:06:22 +0800 Subject: [PATCH 04/26] glfilter: Lost frame rate info when fixate caps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lost frame rate info when fixate caps. It will cause down stream element fail, such avimux. Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=750545] --- gst-libs/gst/gl/gstglfilter.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/gl/gstglfilter.c b/gst-libs/gst/gl/gstglfilter.c index e702a1e..2be7eb3 100644 --- a/gst-libs/gst/gl/gstglfilter.c +++ b/gst-libs/gst/gl/gstglfilter.c @@ -237,7 +237,8 @@ gst_gl_filter_fixate_caps (GstBaseTransform * bt, GstPadDirection direction, GstCaps * caps, GstCaps * othercaps) { GstStructure *ins, *outs; - const GValue *from_par, *to_par; + const GValue *from_par, *to_par, *from_fps; + gint framerate_num, framerate_den; GValue fpar = { 0, }, tpar = { 0,}; @@ -250,6 +251,16 @@ gst_gl_filter_fixate_caps (GstBaseTransform * bt, ins = gst_caps_get_structure (caps, 0); outs = gst_caps_get_structure (othercaps, 0); + /* replace frame rate */ + from_fps = gst_structure_get_value (ins, "framerate"); + if (from_fps) { + gst_structure_set_value (outs, "framerate", from_fps); + } else { + if (gst_structure_get_fraction (ins, "framerate", &framerate_num, &framerate_den)) + gst_structure_set (outs, "framerate", GST_TYPE_FRACTION, framerate_num, framerate_den, + NULL); + } + from_par = gst_structure_get_value (ins, "pixel-aspect-ratio"); to_par = gst_structure_get_value (outs, "pixel-aspect-ratio"); -- 1.9.1