[gst-devel] xvideosink disable_xv=1

Joshua N Pritikin vishnu at pobox.com
Tue Jul 22 20:51:09 CEST 2003


Hacking xvideosink to work with the attached patch just exposes
bugs in colorspace.  Ugh.

-- 
Victory to the Divine Mother!!         after all,
  http://sahajayoga.org                  http://why-compete.org
-------------- next part --------------
--- xvideosink.c	Wed Jul 23 09:18:08 2003
+++ xvideosink.c-head	Wed Jul 23 09:10:25 2003
@@ -313,9 +313,6 @@
   xvideosink = GST_XVIDEOSINK (gst_pad_get_parent (pad));
 
   if (!xvideosink->bufferpool) {
-    GST_DEBUG ("xvideosink: creating %s bufferpool",
-	(xvideosink->image_format->type == GST_TYPE_XIMAGE) ? "XImage" : "XvImage");
-
     xvideosink->bufferpool = gst_buffer_pool_new (
 		    NULL,		/* free */
 		    NULL,		/* copy */
@@ -361,16 +358,18 @@
   int i;
   GstImageFormat *image_format;
 
+  g_warning ("%s", __FUNCTION__);
+
   xvideosink = GST_XVIDEOSINK (gst_pad_get_parent (pad));
 
   /* we are not going to act on variable caps */
   if (!GST_CAPS_IS_FIXED (caps))
     return GST_PAD_LINK_DELAYED;
 
-  if (GST_CAPS_IS_CHAINED (caps))
-    return GST_PAD_LINK_DELAYED;
+  /*  if (GST_CAPS_IS_CHAINED (caps))
+      return GST_PAD_LINK_DELAYED;*/
 
-  GST_DEBUG ("sinkconnect %s", gst_caps_to_string(caps));
+  g_warning ("sinkconnect %s", gst_caps_to_string(caps));
 
   image_format = NULL;
   icaps = NULL;
@@ -391,10 +390,11 @@
     GST_DEBUG ("no format found");
     return GST_PAD_LINK_REFUSED;
   }
+  g_assert (image_format);
 
   gst_caps_unref(icaps);
 
-  GST_DEBUG ("using format %d",i);
+  g_warning ("using format %d",i);
   xvideosink->image_format = image_format;
 
   gst_caps_get_int (caps, "width", &xvideosink->width);
@@ -462,16 +462,17 @@
       image_format = g_ptr_array_index(image_formats, i);
       caps = gst_caps_append(caps, gst_caps_copy(image_format->caps));
     }
-  }else{
-    caps = gst_caps_append(
-	GST_CAPS_NEW ( "videosink_rgbsink", "video/x-raw-rgb",
-	  "framerate", GST_PROPS_FLOAT_RANGE(0, G_MAXFLOAT),
-	  "width", GST_PROPS_INT_RANGE(0, G_MAXINT),
-	  "height", GST_PROPS_INT_RANGE(0, G_MAXINT)),
-	GST_CAPS_NEW ( "videosink_yuvsink", "video/x-raw-yuv",
-	  "framerate", GST_PROPS_FLOAT_RANGE(0, G_MAXFLOAT),
-	  "width", GST_PROPS_INT_RANGE(0, G_MAXINT),
-	  "height", GST_PROPS_INT_RANGE(0, G_MAXINT)));
+  } else {
+    caps = GST_CAPS_NEW ( "videosink_rgbsink", "video/x-raw-rgb",
+			  "framerate", GST_PROPS_FLOAT_RANGE(0, G_MAXFLOAT),
+			  "width", GST_PROPS_INT_RANGE(0, G_MAXINT),
+			  "height", GST_PROPS_INT_RANGE(0, G_MAXINT));
+    if (!xvideosink->disable_xv)
+      caps = gst_caps_append (caps,
+	     GST_CAPS_NEW ( "videosink_yuvsink", "video/x-raw-yuv",
+			    "framerate", GST_PROPS_FLOAT_RANGE(0, G_MAXFLOAT),
+			    "width", GST_PROPS_INT_RANGE(0, G_MAXINT),
+			    "height", GST_PROPS_INT_RANGE(0, G_MAXINT)));
   }
 
   GST_DEBUG ("getcaps returning %s",gst_caps_to_string(caps));


More information about the gstreamer-devel mailing list