x[v]imagesink: remove size check
authorWim Taymans <wim.taymans@collabora.co.uk>
Wed, 22 Feb 2012 14:25:03 +0000 (15:25 +0100)
committerWim Taymans <wim.taymans@collabora.co.uk>
Wed, 22 Feb 2012 14:25:03 +0000 (15:25 +0100)
We can't to a size check like that, the strides might be different and the copy
will then take care of that just fine.

sys/ximage/ximagesink.c
sys/xvimage/xvimagesink.c

index f08eccb..3a1faee 100644 (file)
@@ -1322,9 +1322,6 @@ gst_ximagesink_show_frame (GstVideoSink * vsink, GstBuffer * buf)
     if (res != GST_FLOW_OK)
       goto no_buffer;
 
-    if (gst_buffer_get_size (to_put) < gst_buffer_get_size (buf))
-      goto wrong_size;
-
     GST_CAT_LOG_OBJECT (GST_CAT_PERFORMANCE, ximagesink,
         "slow copy into bufferpool buffer %p", to_put);
 
@@ -1365,16 +1362,6 @@ no_buffer:
     GST_WARNING_OBJECT (ximagesink, "could not create image");
     return res;
   }
-wrong_size:
-  {
-    GST_ELEMENT_ERROR (ximagesink, RESOURCE, WRITE,
-        ("Failed to create output image buffer"),
-        ("XServer allocated buffer size did not match input buffer %"
-            G_GSIZE_FORMAT " - %" G_GSIZE_FORMAT, gst_buffer_get_size (to_put),
-            gst_buffer_get_size (buf)));
-    res = GST_FLOW_ERROR;
-    goto done;
-  }
 invalid_buffer:
   {
     /* No Window available to put our image into */
index 523b736..e223f0c 100644 (file)
@@ -1832,9 +1832,6 @@ gst_xvimagesink_show_frame (GstVideoSink * vsink, GstBuffer * buf)
     if (res != GST_FLOW_OK)
       goto no_buffer;
 
-    if (gst_buffer_get_size (to_put) < gst_buffer_get_size (buf))
-      goto wrong_size;
-
     GST_CAT_LOG_OBJECT (GST_CAT_PERFORMANCE, xvimagesink,
         "slow copy into bufferpool buffer %p", to_put);
 
@@ -1875,16 +1872,6 @@ no_buffer:
     GST_WARNING_OBJECT (xvimagesink, "could not create image");
     return res;
   }
-wrong_size:
-  {
-    GST_ELEMENT_ERROR (xvimagesink, RESOURCE, WRITE,
-        ("Failed to create output image buffer"),
-        ("XServer allocated buffer size did not match input buffer %"
-            G_GSIZE_FORMAT " - %" G_GSIZE_FORMAT, gst_buffer_get_size (to_put),
-            gst_buffer_get_size (buf)));
-    res = GST_FLOW_ERROR;
-    goto done;
-  }
 invalid_buffer:
   {
     /* No Window available to put our image into */