mirror of
https://gitlab.freedesktop.org/wayland/weston
synced 2024-10-04 20:12:38 +00:00
pipewire-[backend|plugin]: Add timestamps to buffers
In Pipewire and Gstreamer terminology Weston is a "live" source (as we do not explicitly set PW_KEY_STREAM_IS_LIVE to false). Such sources, be it compositors, cameras or microphones, usually set the current system time as timestamps on buffers in order to make life easier for consumers. Thus let's do so as well. This notably helps when recording using `gstpipewiresrc` with the `keepalive-time` property set. Signed-off-by: Robert Mader <robert.mader@collabora.com>
This commit is contained in:
parent
34400d7d16
commit
445ff6728b
|
@ -597,7 +597,10 @@ pipewire_submit_buffer(struct pipewire_output *output,
|
|||
|
||||
if ((h = spa_buffer_find_meta_data(spa_buffer, SPA_META_Header,
|
||||
sizeof(struct spa_meta_header)))) {
|
||||
h->pts = -1;
|
||||
struct timespec ts;
|
||||
|
||||
clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||
h->pts = SPA_TIMESPEC_TO_NSEC(&ts);
|
||||
h->flags = 0;
|
||||
h->seq = output->seq;
|
||||
h->dts_offset = 0;
|
||||
|
|
|
@ -192,7 +192,10 @@ pipewire_output_handle_frame(struct pipewire_output *output, int fd,
|
|||
|
||||
if ((h = spa_buffer_find_meta_data(spa_buffer, SPA_META_Header,
|
||||
sizeof(struct spa_meta_header)))) {
|
||||
h->pts = -1;
|
||||
struct timespec ts;
|
||||
|
||||
clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||
h->pts = SPA_TIMESPEC_TO_NSEC(&ts);
|
||||
h->flags = 0;
|
||||
h->seq = output->seq++;
|
||||
h->dts_offset = 0;
|
||||
|
|
Loading…
Reference in a new issue