[gst-cvs] gst-openmax: videodec: handle empty framerate

Felipe Contreras felipec at kemper.freedesktop.org
Sat Nov 14 06:13:46 PST 2009


Module: gst-openmax
Branch: omap
Commit: a99ec1af314ab512bd0b077f6fdbb1da336a713d
URL:    http://cgit.freedesktop.org/gstreamer/gst-openmax/commit/?id=a99ec1af314ab512bd0b077f6fdbb1da336a713d

Author: Felipe Contreras <felipe.contreras at gmail.com>
Date:   Fri Mar 20 15:40:10 2009 +0200

videodec: handle empty framerate

Apparently sometimes we don't get it.

Signed-off-by: Felipe Contreras <felipe.contreras at gmail.com>

---

 omx/gstomx_base_videodec.c |   21 ++++++++++++++-------
 1 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/omx/gstomx_base_videodec.c b/omx/gstomx_base_videodec.c
index 95cf701..5cebc4b 100644
--- a/omx/gstomx_base_videodec.c
+++ b/omx/gstomx_base_videodec.c
@@ -137,14 +137,21 @@ settings_changed_cb (GOmxCore *core)
 
     {
         GstCaps *new_caps;
+        GstStructure *struc;
+
+        new_caps = gst_caps_new_empty ();
+        struc = gst_structure_new ("video/x-raw-yuv",
+                                   "width", G_TYPE_INT, width,
+                                   "height", G_TYPE_INT, height,
+                                   "format", GST_TYPE_FOURCC, format,
+                                   NULL);
+
+        if (self->framerate_denom != 0)
+            gst_structure_set (struc, "framerate", GST_TYPE_FRACTION,
+                               self->framerate_num, self->framerate_denom,
+                               NULL);
 
-        new_caps = gst_caps_new_simple ("video/x-raw-yuv",
-                                        "width", G_TYPE_INT, width,
-                                        "height", G_TYPE_INT, height,
-                                        "framerate", GST_TYPE_FRACTION,
-                                        self->framerate_num, self->framerate_denom,
-                                        "format", GST_TYPE_FOURCC, format,
-                                        NULL);
+        gst_caps_append_structure (new_caps, struc);
 
         GST_INFO_OBJECT (omx_base, "caps are: %" GST_PTR_FORMAT, new_caps);
         gst_pad_set_caps (omx_base->srcpad, new_caps);





More information about the Gstreamer-commits mailing list