mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-05-02 06:46:36 -04:00
Revert "pipewiresrc: Use clock time difference to update last_buffer time"
This reverts commit efd1526423.
This commit is contained in:
parent
43b19e7668
commit
1b4de00654
2 changed files with 6 additions and 29 deletions
|
|
@ -531,7 +531,6 @@ gst_pipewire_src_init (GstPipeWireSrc * src)
|
||||||
src->autoconnect = DEFAULT_AUTOCONNECT;
|
src->autoconnect = DEFAULT_AUTOCONNECT;
|
||||||
src->min_latency = 0;
|
src->min_latency = 0;
|
||||||
src->max_latency = GST_CLOCK_TIME_NONE;
|
src->max_latency = GST_CLOCK_TIME_NONE;
|
||||||
src->last_buffer_clock_time = GST_CLOCK_TIME_NONE;
|
|
||||||
src->n_buffers = 0;
|
src->n_buffers = 0;
|
||||||
src->flushing_on_remove_buffer = FALSE;
|
src->flushing_on_remove_buffer = FALSE;
|
||||||
src->on_disconnect = DEFAULT_ON_DISCONNECT;
|
src->on_disconnect = DEFAULT_ON_DISCONNECT;
|
||||||
|
|
@ -1615,21 +1614,12 @@ gst_pipewire_src_create (GstPushSrc * psrc, GstBuffer ** buffer)
|
||||||
GST_LOG_OBJECT (pwsrc, "popped buffer %p", buf);
|
GST_LOG_OBJECT (pwsrc, "popped buffer %p", buf);
|
||||||
if (buf != NULL) {
|
if (buf != NULL) {
|
||||||
if (pwsrc->resend_last || pwsrc->keepalive_time > 0) {
|
if (pwsrc->resend_last || pwsrc->keepalive_time > 0) {
|
||||||
GstClock *clock;
|
|
||||||
GstBuffer *old;
|
GstBuffer *old;
|
||||||
|
|
||||||
old = pwsrc->last_buffer;
|
old = pwsrc->last_buffer;
|
||||||
pwsrc->last_buffer = gst_buffer_copy (buf);
|
pwsrc->last_buffer = gst_buffer_copy (buf);
|
||||||
gst_buffer_unref (old);
|
gst_buffer_unref (old);
|
||||||
gst_buffer_add_parent_buffer_meta (pwsrc->last_buffer, buf);
|
gst_buffer_add_parent_buffer_meta (pwsrc->last_buffer, buf);
|
||||||
|
|
||||||
clock = gst_element_get_clock (GST_ELEMENT_CAST (pwsrc));
|
|
||||||
if (clock != NULL) {
|
|
||||||
pwsrc->last_buffer_clock_time = gst_clock_get_time (clock);
|
|
||||||
gst_object_unref (clock);
|
|
||||||
} else {
|
|
||||||
pwsrc->last_buffer_clock_time = GST_CLOCK_TIME_NONE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -1655,33 +1645,21 @@ gst_pipewire_src_create (GstPushSrc * psrc, GstBuffer ** buffer)
|
||||||
|
|
||||||
if (update_time) {
|
if (update_time) {
|
||||||
GstClock *clock;
|
GstClock *clock;
|
||||||
GstClockTime current_clock_time;
|
GstClockTime pts, dts;
|
||||||
|
|
||||||
clock = gst_element_get_clock (GST_ELEMENT_CAST (pwsrc));
|
clock = gst_element_get_clock (GST_ELEMENT_CAST (pwsrc));
|
||||||
if (clock != NULL) {
|
if (clock != NULL) {
|
||||||
current_clock_time = gst_clock_get_time (clock);
|
pts = dts = gst_clock_get_time (clock);
|
||||||
gst_object_unref (clock);
|
gst_object_unref (clock);
|
||||||
} else {
|
} else {
|
||||||
current_clock_time = GST_CLOCK_TIME_NONE;
|
pts = dts = GST_CLOCK_TIME_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GST_CLOCK_TIME_IS_VALID (current_clock_time) &&
|
GST_BUFFER_PTS (*buffer) = pts;
|
||||||
GST_CLOCK_TIME_IS_VALID (pwsrc->last_buffer_clock_time) &&
|
GST_BUFFER_DTS (*buffer) = dts;
|
||||||
GST_CLOCK_TIME_IS_VALID (GST_BUFFER_PTS (*buffer)) &&
|
|
||||||
GST_CLOCK_TIME_IS_VALID (GST_BUFFER_DTS (*buffer))) {
|
|
||||||
GstClockTime diff;
|
|
||||||
|
|
||||||
diff = current_clock_time - pwsrc->last_buffer_clock_time;
|
|
||||||
|
|
||||||
GST_BUFFER_PTS (*buffer) += diff;
|
|
||||||
GST_BUFFER_DTS (*buffer) += diff;
|
|
||||||
} else {
|
|
||||||
GST_BUFFER_PTS (*buffer) = GST_BUFFER_DTS (*buffer) = current_clock_time;
|
|
||||||
}
|
|
||||||
|
|
||||||
GST_LOG_OBJECT (pwsrc, "Sending keepalive buffer pts/dts: %" GST_TIME_FORMAT
|
GST_LOG_OBJECT (pwsrc, "Sending keepalive buffer pts/dts: %" GST_TIME_FORMAT
|
||||||
" (%" G_GUINT64_FORMAT ")", GST_TIME_ARGS (current_clock_time),
|
" (%" G_GUINT64_FORMAT ")", GST_TIME_ARGS (pts), pts);
|
||||||
current_clock_time);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return GST_FLOW_OK;
|
return GST_FLOW_OK;
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,6 @@ struct _GstPipeWireSrc {
|
||||||
GstClockTime max_latency;
|
GstClockTime max_latency;
|
||||||
|
|
||||||
GstBuffer *last_buffer;
|
GstBuffer *last_buffer;
|
||||||
GstClockTime last_buffer_clock_time;
|
|
||||||
|
|
||||||
enum spa_meta_videotransform_value transform_value;
|
enum spa_meta_videotransform_value transform_value;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue