emotion: correctly setup the pipeline for non standard colorspace.
authorcedric <cedric>
Tue, 30 Aug 2011 14:05:49 +0000 (14:05 +0000)
committercedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 30 Aug 2011 14:05:49 +0000 (14:05 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/emotion@62986 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/modules/gstreamer/emotion_sink.c

index 219da46..a43d6c3 100644 (file)
@@ -186,23 +186,16 @@ gboolean evas_video_sink_set_caps(GstBaseSink *bsink, GstCaps *caps)
    GstStructure *structure;
    GstVideoFormat format;
    guint32 fourcc;
-   int width;
-   int height;
 
    sink = EVAS_VIDEO_SINK(bsink);
    priv = sink->priv;
 
-   if (!gst_video_format_parse_caps(caps, &format, &width, &height))
-     {
-        ERR("Unable to parse caps.");
-        return FALSE;
-     }
-
-   priv->width = width;
-   priv->height = height;
-
    structure = gst_caps_get_structure(caps, 0);
 
+   if (!((gst_structure_get_int(structure, "width", &priv->width)
+         && gst_structure_get_int(structure, "height", &priv->height))))
+     goto test_format;
+
    if (gst_structure_get_fourcc(structure, "format", &fourcc))
      {
         switch (fourcc)
@@ -235,6 +228,12 @@ gboolean evas_video_sink_set_caps(GstBaseSink *bsink, GstCaps *caps)
    else
      {
      test_format:
+        if (!gst_video_format_parse_caps(caps, &format, &priv->width, &priv->height))
+          {
+             ERR("Unable to parse caps.");
+             return FALSE;
+          }
+
         switch (format)
           {
            case GST_VIDEO_FORMAT_BGR: priv->eformat = EVAS_COLORSPACE_ARGB8888;