mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-04 13:32:29 +00:00
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:
parent
f06acc7bf7
commit
89121c18e5
2 changed files with 3 additions and 3 deletions
|
@ -578,7 +578,7 @@ default_acquire_buffer (GstBufferPool * pool, GstBuffer ** buffer,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check if we need to wait */
|
/* 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");
|
GST_LOG_OBJECT (pool, "no more buffers");
|
||||||
result = GST_FLOW_UNEXPECTED;
|
result = GST_FLOW_UNEXPECTED;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -54,7 +54,7 @@ typedef struct _GstBufferPoolClass GstBufferPoolClass;
|
||||||
* GstBufferPoolFlags:
|
* GstBufferPoolFlags:
|
||||||
* @GST_BUFFER_POOL_FLAG_NONE: no flags
|
* @GST_BUFFER_POOL_FLAG_NONE: no flags
|
||||||
* @GST_BUFFER_POOL_FLAG_KEY_UNIT: buffer is keyframe
|
* @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
|
* @GST_BUFFER_POOL_FLAG_DISCONT: buffer is discont
|
||||||
*
|
*
|
||||||
* Additional flags to control the allocation of a buffer
|
* Additional flags to control the allocation of a buffer
|
||||||
|
@ -62,7 +62,7 @@ typedef struct _GstBufferPoolClass GstBufferPoolClass;
|
||||||
typedef enum {
|
typedef enum {
|
||||||
GST_BUFFER_POOL_FLAG_NONE = 0,
|
GST_BUFFER_POOL_FLAG_NONE = 0,
|
||||||
GST_BUFFER_POOL_FLAG_KEY_UNIT = (1 << 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_DISCONT = (1 << 2),
|
||||||
GST_BUFFER_POOL_FLAG_LAST = (1 << 16),
|
GST_BUFFER_POOL_FLAG_LAST = (1 << 16),
|
||||||
} GstBufferPoolFlags;
|
} GstBufferPoolFlags;
|
||||||
|
|
Loading…
Reference in a new issue