srtbasesrc: Use GstBaseSrc's timestamp impl.

... instead of doing it ourselves. Otherwise, we should add more
logic here (such as checking GstClock and etc) which was already provided by
GstBaseSrc.

https://bugzilla.gnome.org/show_bug.cgi?id=796842
This commit is contained in:
Seungha Yang 2018-07-27 13:23:43 +09:00 committed by Olivier Crête
parent 728b116fdb
commit f46af953c1
3 changed files with 6 additions and 24 deletions

View file

@ -221,6 +221,8 @@ gst_srt_base_src_init (GstSRTBaseSrc * self)
gst_srt_base_src_uri_set_uri (GST_URI_HANDLER (self), SRT_DEFAULT_URI, NULL);
gst_base_src_set_format (GST_BASE_SRC (self), GST_FORMAT_TIME);
gst_base_src_set_live (GST_BASE_SRC (self), TRUE);
gst_base_src_set_do_timestamp (GST_BASE_SRC (self), TRUE);
self->latency = SRT_DEFAULT_LATENCY;
self->key_length = SRT_DEFAULT_KEY_LENGTH;
}

View file

@ -210,20 +210,10 @@ gst_srt_client_src_fill (GstPushSrc * src, GstBuffer * outbuf)
goto out;
}
GST_BUFFER_PTS (outbuf) =
gst_clock_get_time (GST_ELEMENT_CLOCK (src)) -
GST_ELEMENT_CAST (src)->base_time;
gst_buffer_resize (outbuf, 0, recv_len);
GST_LOG_OBJECT (src,
"filled buffer from _get of size %" G_GSIZE_FORMAT ", ts %"
GST_TIME_FORMAT ", dur %" GST_TIME_FORMAT
", offset %" G_GINT64_FORMAT ", offset_end %" G_GINT64_FORMAT,
gst_buffer_get_size (outbuf),
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (outbuf)),
GST_TIME_ARGS (GST_BUFFER_DURATION (outbuf)),
GST_BUFFER_OFFSET (outbuf), GST_BUFFER_OFFSET_END (outbuf));
GST_LOG_OBJECT (src, "filled buffer from _get of size %" G_GSIZE_FORMAT,
gst_buffer_get_size (outbuf));
out:
return ret;

View file

@ -235,20 +235,10 @@ gst_srt_server_src_fill (GstPushSrc * src, GstBuffer * outbuf)
goto out;
}
GST_BUFFER_PTS (outbuf) =
gst_clock_get_time (GST_ELEMENT_CLOCK (src)) -
GST_ELEMENT_CAST (src)->base_time;
gst_buffer_resize (outbuf, 0, recv_len);
GST_LOG_OBJECT (src,
"filled buffer from _get of size %" G_GSIZE_FORMAT ", ts %"
GST_TIME_FORMAT ", dur %" GST_TIME_FORMAT
", offset %" G_GINT64_FORMAT ", offset_end %" G_GINT64_FORMAT,
gst_buffer_get_size (outbuf),
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (outbuf)),
GST_TIME_ARGS (GST_BUFFER_DURATION (outbuf)),
GST_BUFFER_OFFSET (outbuf), GST_BUFFER_OFFSET_END (outbuf));
GST_LOG_OBJECT (src, "filled buffer from _get of size %" G_GSIZE_FORMAT,
gst_buffer_get_size (outbuf));
out:
return ret;