mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
gst: increase buffers in sink
This commit is contained in:
parent
0347a753c9
commit
34334b6ea3
1 changed files with 10 additions and 3 deletions
|
|
@ -56,6 +56,8 @@ GST_DEBUG_CATEGORY_STATIC (pipewire_sink_debug);
|
|||
|
||||
#define DEFAULT_PROP_MODE GST_PIPEWIRE_SINK_MODE_DEFAULT
|
||||
|
||||
#define MIN_BUFFERS 8u
|
||||
|
||||
enum
|
||||
{
|
||||
PROP_0,
|
||||
|
|
@ -248,8 +250,10 @@ pool_activated (GstPipeWirePool *pool, GstPipeWireSink *sink)
|
|||
|
||||
spa_pod_builder_add (&b,
|
||||
SPA_PARAM_BUFFERS_stride, SPA_POD_CHOICE_RANGE_Int(0, 0, INT32_MAX),
|
||||
SPA_PARAM_BUFFERS_buffers, SPA_POD_CHOICE_RANGE_Int(SPA_MAX(4u, min_buffers),
|
||||
SPA_MAX(2u, min_buffers), max_buffers ? max_buffers : INT32_MAX),
|
||||
SPA_PARAM_BUFFERS_buffers, SPA_POD_CHOICE_RANGE_Int(
|
||||
SPA_MAX(MIN_BUFFERS, min_buffers),
|
||||
SPA_MAX(MIN_BUFFERS, min_buffers),
|
||||
max_buffers ? max_buffers : INT32_MAX),
|
||||
SPA_PARAM_BUFFERS_align, SPA_POD_Int(16),
|
||||
0);
|
||||
port_params[0] = spa_pod_builder_pop (&b, &f);
|
||||
|
|
@ -583,13 +587,14 @@ gst_pipewire_sink_render (GstBaseSink * bsink, GstBuffer * buffer)
|
|||
if (buffer->pool != GST_BUFFER_POOL_CAST (pwsink->pool)) {
|
||||
GstBuffer *b = NULL;
|
||||
GstMapInfo info = { 0, };
|
||||
GstBufferPoolAcquireParams params = { 0, };
|
||||
|
||||
pw_thread_loop_unlock (pwsink->core->loop);
|
||||
|
||||
if (!gst_buffer_pool_is_active (GST_BUFFER_POOL_CAST (pwsink->pool)))
|
||||
gst_buffer_pool_set_active (GST_BUFFER_POOL_CAST (pwsink->pool), TRUE);
|
||||
|
||||
if ((res = gst_buffer_pool_acquire_buffer (GST_BUFFER_POOL_CAST (pwsink->pool), &b, NULL)) != GST_FLOW_OK)
|
||||
if ((res = gst_buffer_pool_acquire_buffer (GST_BUFFER_POOL_CAST (pwsink->pool), &b, ¶ms)) != GST_FLOW_OK)
|
||||
goto done;
|
||||
|
||||
gst_buffer_map (b, &info, GST_MAP_WRITE);
|
||||
|
|
@ -755,6 +760,7 @@ gst_pipewire_sink_change_state (GstElement * element, GstStateChange transition)
|
|||
pw_thread_loop_lock (this->core->loop);
|
||||
pw_stream_set_active(this->stream, false);
|
||||
pw_thread_loop_unlock (this->core->loop);
|
||||
gst_buffer_pool_set_flushing(GST_BUFFER_POOL_CAST(this->pool), TRUE);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
@ -766,6 +772,7 @@ gst_pipewire_sink_change_state (GstElement * element, GstStateChange transition)
|
|||
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
|
||||
break;
|
||||
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
||||
gst_buffer_pool_set_active(GST_BUFFER_POOL_CAST(this->pool), FALSE);
|
||||
break;
|
||||
case GST_STATE_CHANGE_READY_TO_NULL:
|
||||
gst_pipewire_sink_close (this);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue