Skip to content

Commit

Permalink
[GStreamer][LibWebRTC] Timestamp handling improvements in video decod…
Browse files Browse the repository at this point in the history
…er factory

https://bugs.webkit.org/show_bug.cgi?id=273757

Reviewed by Xabier Rodriguez-Calvar.

The buffers injected into the parser pipeline are now timestamped by appsrc. The RTP timestamps are
required by the LibWebRTC generic decoder in order to match parsed frames with input buffers, so
they are attached on each buffers using a reference timestamp meta.

* Source/WebCore/platform/mediastream/libwebrtc/gstreamer/GStreamerVideoDecoderFactory.cpp:
(WebCore::GStreamerWebRTCVideoDecoder::GStreamerWebRTCVideoDecoder):
(WebCore::GStreamerWebRTCVideoDecoder::pullSample):
* Source/WebCore/platform/mediastream/libwebrtc/gstreamer/GStreamerVideoFrameLibWebRTC.cpp:
(WebCore::ensureDebugCategoryIsRegistered):
(WebCore::convertGStreamerSampleToLibWebRTCVideoFrame):
(WebCore::GStreamerVideoFrameLibWebRTC::ToI420):
* Source/WebCore/platform/mediastream/libwebrtc/gstreamer/GStreamerVideoFrameLibWebRTC.h:

Canonical link: https://commits.webkit.org/278447@main
  • Loading branch information
philn authored and suresh-khurdiya-infosys committed Dec 10, 2024
1 parent 443076f commit d15a167
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ class GStreamerWebRTCVideoDecoder : public webrtc::VideoDecoder {
gst_buffer_add_reference_timestamp_meta(buffer.get(), m_rtpTimestampCaps.get(), inputImage.RtpTimestamp(), GST_CLOCK_TIME_NONE);

auto sample = adoptGRef(gst_sample_new(buffer.get(), m_caps.get(), nullptr, nullptr));
switch (gst_app_src_push_sample(GST_APP_SRC(m_src), sample.get())) {

switch (gst_app_src_push_sample(GST_APP_SRC(m_src), sample.get())) {
case GST_FLOW_OK:
break;
case GST_FLOW_FLUSHING:
Expand Down

0 comments on commit d15a167

Please sign in to comment.