bufferpool: make the default behaviour to wait

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.
This commit is contained in:
Wim Taymans 2011-06-03 12:40:56 +02:00
parent f06acc7bf7
commit 89121c18e5
2 changed files with 3 additions and 3 deletions

View 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;

View 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;