mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-04-10 08:21:03 -04:00
gst: add rate control to the sink
Track the elapsed time between buffers and try to keep the buffer fill level constant by changing the rate of the stream. See #4374
This commit is contained in:
parent
22f0b858b1
commit
9419a12e74
5 changed files with 66 additions and 7 deletions
|
|
@ -11,6 +11,7 @@
|
|||
#include "gstpipewirecore.h"
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include <spa/utils/dll.h>
|
||||
#include <pipewire/pipewire.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
|
@ -29,6 +30,13 @@ struct _GstPipeWireStream {
|
|||
GstPipeWirePool *pool;
|
||||
GstClock *clock;
|
||||
|
||||
guint64 position;
|
||||
struct spa_dll dll;
|
||||
double err_avg, err_var, err_wdw;
|
||||
guint64 last_ts;
|
||||
guint64 base_buffer_ts;
|
||||
guint64 base_ts;
|
||||
|
||||
/* the actual pw stream */
|
||||
struct pw_stream *pwstream;
|
||||
struct spa_hook pwstream_listener;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue