bufferpool: make the default behaviour to wait
authorWim Taymans <wim.taymans@collabora.co.uk>
Fri, 3 Jun 2011 10:40:56 +0000 (12:40 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Fri, 3 Jun 2011 10:40:56 +0000 (12:40 +0200)
The most common case is to not specify any flags when doing the allocation. Make
the allocation from a pool with a maximum amount of buffers block by default for
this reason.

gst/gstbufferpool.c
gst/gstbufferpool.h

index 58f2a4f..f804309 100644 (file)
@@ -578,7 +578,7 @@ default_acquire_buffer (GstBufferPool * pool, GstBuffer ** buffer,
     }
 
     /* check if we need to wait */
-    if (params && !(params->flags & GST_BUFFER_POOL_FLAG_WAIT)) {
+    if (params && (params->flags & GST_BUFFER_POOL_FLAG_DONTWAIT)) {
       GST_LOG_OBJECT (pool, "no more buffers");
       result = GST_FLOW_UNEXPECTED;
       break;
index 50c5c63..7b5e8af 100644 (file)
@@ -54,7 +54,7 @@ typedef struct _GstBufferPoolClass GstBufferPoolClass;
  * GstBufferPoolFlags:
  * @GST_BUFFER_POOL_FLAG_NONE: no flags
  * @GST_BUFFER_POOL_FLAG_KEY_UNIT: buffer is keyframe
- * @GST_BUFFER_POOL_FLAG_WAIT: wait for buffer
+ * @GST_BUFFER_POOL_FLAG_DONTWAIT: don't wait for buffer
  * @GST_BUFFER_POOL_FLAG_DISCONT: buffer is discont
  *
  * Additional flags to control the allocation of a buffer
@@ -62,7 +62,7 @@ typedef struct _GstBufferPoolClass GstBufferPoolClass;
 typedef enum {
   GST_BUFFER_POOL_FLAG_NONE     = 0,
   GST_BUFFER_POOL_FLAG_KEY_UNIT = (1 << 0),
-  GST_BUFFER_POOL_FLAG_WAIT     = (1 << 1),
+  GST_BUFFER_POOL_FLAG_DONTWAIT   = (1 << 1),
   GST_BUFFER_POOL_FLAG_DISCONT  = (1 << 2),
   GST_BUFFER_POOL_FLAG_LAST     = (1 << 16),
 } GstBufferPoolFlags;