Skip to content

Commit 2fff660

Browse files
dpinophiln
authored andcommitted
[CMake] Update libvpx sources after 271863@main
https://bugs.webkit.org/show_bug.cgi?id=265864 Reviewed by Philippe Normand. WebKitGTK and WPE build was broken after the update, it's necessary to update the CMake sources as well as other source files due to API changes. * Source/ThirdParty/libwebrtc/CMakeLists.txt: * Source/WebCore/platform/mediastream/libwebrtc/gstreamer/GStreamerVideoDecoderFactory.cpp: * Source/WebCore/platform/mediastream/libwebrtc/gstreamer/GStreamerVideoEncoderFactory.cpp: (WebCore::GStreamerVideoEncoderFactory::CreateVideoEncoder): Canonical link: https://commits.webkit.org/272416@main
1 parent 0021568 commit 2fff660

3 files changed

Lines changed: 15 additions & 7 deletions

File tree

Source/ThirdParty/libwebrtc/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1881,6 +1881,14 @@ set(webrtc_SOURCES
18811881
Source/webrtc/video/video_stream_buffer_controller.cc
18821882
Source/webrtc/video/video_stream_decoder2.cc
18831883
Source/webrtc/video/video_stream_encoder.cc
1884+
Source/webrtc/modules/rtp_rtcp/source/flexfec_03_header_reader_writer.cc
1885+
Source/webrtc/p2p/base/stun_dictionary.cc
1886+
Source/webrtc/rtc_base/async_dns_resolver.cc
1887+
Source/webrtc/rtc_base/bitrate_tracker.cc
1888+
Source/webrtc/rtc_base/frequency_tracker.cc
1889+
Source/webrtc/rtc_base/network/received_packet.cc
1890+
Source/webrtc/rtc_tools/video_encoder/encoded_image_file_writer.cc
1891+
Source/webrtc/rtc_tools/video_encoder/video_encoder.cc
18841892

18851893
$<TARGET_OBJECTS:libsrtp>
18861894
)

Source/WebCore/platform/mediastream/libwebrtc/gstreamer/GStreamerVideoDecoderFactory.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,15 +237,15 @@ class GStreamerWebRTCVideoDecoder : public webrtc::VideoDecoder {
237237
if (!GST_CLOCK_TIME_IS_VALID(m_firstBufferPts)) {
238238
GRefPtr<GstPad> srcpad = adoptGRef(gst_element_get_static_pad(m_src, "src"));
239239
m_firstBufferPts = (static_cast<guint64>(renderTimeMs)) * GST_MSECOND;
240-
m_firstBufferDts = (static_cast<guint64>(inputImage.Timestamp())) * GST_MSECOND;
240+
m_firstBufferDts = (static_cast<guint64>(inputImage.RtpTimestamp())) * GST_MSECOND;
241241
}
242242

243243
// FIXME- Use a GstBufferPool.
244244
auto buffer = adoptGRef(gstBufferNewWrappedFast(fastMemDup(inputImage.data(), inputImage.size()),
245245
inputImage.size()));
246-
GST_BUFFER_DTS(buffer.get()) = (static_cast<guint64>(inputImage.Timestamp()) * GST_MSECOND) - m_firstBufferDts;
246+
GST_BUFFER_DTS(buffer.get()) = (static_cast<guint64>(inputImage.RtpTimestamp()) * GST_MSECOND) - m_firstBufferDts;
247247
GST_BUFFER_PTS(buffer.get()) = (static_cast<guint64>(renderTimeMs) * GST_MSECOND) - m_firstBufferPts;
248-
InputTimestamps timestamps = { inputImage.Timestamp(), renderTimeMs };
248+
InputTimestamps timestamps = { inputImage.RtpTimestamp(), renderTimeMs };
249249
m_dtsPtsMap[GST_BUFFER_PTS(buffer.get())] = timestamps;
250250

251251
GST_LOG_OBJECT(pipeline(), "%" G_GINT64_FORMAT " Decoding: %" GST_PTR_FORMAT, renderTimeMs, buffer.get());

Source/WebCore/platform/mediastream/libwebrtc/gstreamer/GStreamerVideoEncoderFactory.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,9 +268,9 @@ class GStreamerVideoEncoder : public webrtc::VideoEncoder {
268268
m_encodedFrame._encodedHeight = resolution->height();
269269
m_encodedFrame._frameType = GST_BUFFER_FLAG_IS_SET(encodedBuffer, GST_BUFFER_FLAG_DELTA_UNIT) ? webrtc::VideoFrameType::kVideoFrameDelta : webrtc::VideoFrameType::kVideoFrameKey;
270270
m_encodedFrame.capture_time_ms_ = frame.render_time_ms();
271-
m_encodedFrame.SetTimestamp(frame.timestamp());
271+
m_encodedFrame.SetRtpTimestamp(frame.timestamp());
272272

273-
GST_LOG_OBJECT(m_pipeline.get(), "Got buffer capture_time_ms: %" G_GINT64_FORMAT " _timestamp: %u", m_encodedFrame.capture_time_ms_, m_encodedFrame.Timestamp());
273+
GST_LOG_OBJECT(m_pipeline.get(), "Got buffer capture_time_ms: %" G_GINT64_FORMAT " _timestamp: %u", m_encodedFrame.capture_time_ms_, m_encodedFrame.RtpTimestamp());
274274

275275
webrtc::CodecSpecificInfo codecInfo;
276276
PopulateCodecSpecific(&codecInfo, encodedBuffer);
@@ -385,7 +385,7 @@ std::unique_ptr<webrtc::VideoEncoder> GStreamerVideoEncoderFactory::CreateVideoE
385385
// bad UX in WPE/GTK browsers. So for now we prefer to use LibWebRTC's VPx encoders.
386386
if (format.name == cricket::kVp9CodecName) {
387387
GST_INFO("Using VP9 Encoder from LibWebRTC.");
388-
return webrtc::VP9Encoder::Create(cricket::VideoCodec(format));
388+
return webrtc::VP9Encoder::Create(cricket::CreateVideoCodec(format));
389389
}
390390

391391
if (format.name == cricket::kVp8CodecName) {
@@ -396,7 +396,7 @@ std::unique_ptr<webrtc::VideoEncoder> GStreamerVideoEncoderFactory::CreateVideoE
396396
if (format.name == cricket::kH264CodecName) {
397397
#if WEBKIT_LIBWEBRTC_OPENH264_ENCODER
398398
GST_INFO("Using OpenH264 libwebrtc encoder.");
399-
return webrtc::H264Encoder::Create(cricket::VideoCodec(format));
399+
return webrtc::H264Encoder::Create(cricket::CreateVideoCodec(format));
400400
#else
401401
GST_INFO("Using H264 GStreamer encoder.");
402402
return makeUnique<GStreamerH264Encoder>(format);

0 commit comments

Comments
 (0)