Diff
Modified: trunk/LayoutTests/ChangeLog (270189 => 270190)
--- trunk/LayoutTests/ChangeLog 2020-11-27 11:21:36 UTC (rev 270189)
+++ trunk/LayoutTests/ChangeLog 2020-11-27 11:57:39 UTC (rev 270190)
@@ -1,3 +1,16 @@
+2020-11-27 Víctor Manuel Jáquez Leal <[email protected]>
+
+ REGRESSION(r269642) [GStreamer][WebRTC] Unexpected results after update to M87
+ https://bugs.webkit.org/show_bug.cgi?id=218787
+
+ Reviewed by Philippe Normand.
+
+ Update expectations with fixed tests.
+ Also fixed a typo.
+
+ * platform/glib/TestExpectations:
+ * platform/gtk/TestExpectations:
+
2020-11-27 Philippe Normand <[email protected]>
Unreviewed, GLib webaudio gardening
Modified: trunk/LayoutTests/platform/glib/TestExpectations (270189 => 270190)
--- trunk/LayoutTests/platform/glib/TestExpectations 2020-11-27 11:21:36 UTC (rev 270189)
+++ trunk/LayoutTests/platform/glib/TestExpectations 2020-11-27 11:57:39 UTC (rev 270190)
@@ -861,9 +861,6 @@
webkit.org/b/194611 http/wpt/webrtc/getUserMedia-processSwapping.html [ Failure ]
-webkit.org/b/198830 webkit.org/b/211765 webkit.org/b/218787 [ Release ] webrtc/video-autoplay.html [ Pass Timeout Crash Failure ]
-webkit.org/b/218787 [ Debug ] webrtc/video-autoplay.html [ Failure ]
-
webkit.org/b/201267 webrtc/video-h264.html [ Failure ]
webkit.org/b/212809 webrtc/datachannel/gather-candidates-networkprocess-crash.html [ Timeout Pass ]
@@ -895,28 +892,6 @@
webkit.org/b/218221 webrtc/vp9-profile2.html [ Failure ]
-# Failures after libwebrtc M87 update
-webkit.org/b/218787 webrtc/direction-change.html [ Crash ]
-webkit.org/b/218787 webrtc/h264-packetization-mode.html [ Crash ]
-webkit.org/b/218787 webrtc/connection-state.html [ Failure ]
-webkit.org/b/218787 webrtc/createOfferAnswer.html [ Failure ]
-webkit.org/b/218787 webrtc/disable-encryption.html [ Failure ]
-webkit.org/b/218787 webrtc/ephemeral-certificates-and-cnames.html [ Failure ]
-webkit.org/b/218787 webrtc/libwebrtc/setLocalDescriptionCrash.html [ Failure ]
-webkit.org/b/218787 webrtc/msection-recycling.html [ Failure ]
-webkit.org/b/218787 webrtc/multi-audio.html [ Failure ]
-webkit.org/b/218787 webrtc/release-after-getting-track.html [ Failure ]
-webkit.org/b/218787 webrtc/remove-track.html [ Failure ]
-webkit.org/b/218787 webrtc/utf8-sdp.html [ Failure ]
-webkit.org/b/218787 webrtc/video-mediastreamtrack-stats.html [ Failure ]
-webkit.org/b/218787 webrtc/video-receivers.html [ Failure ]
-webkit.org/b/218787 webrtc/video-replace-track-to-null.html [ Failure ]
-webkit.org/b/218787 webrtc/video-stats.html [ Failure ]
-webkit.org/b/218787 fast/mediastream/RTCPeerConnection-statsSelector.html [ Timeout ]
-webkit.org/b/218787 webrtc/concurrentVideoPlayback.html [ Timeout ]
-webkit.org/b/218787 webrtc/ice-candidate-sdpMLineIndex.html [ Timeout ]
-webkit.org/b/218787 http/wpt/webrtc/webrtc-transform.html [ Failure ]
-
webkit.org/b/219066 webrtc/audio-sframe.html [ Failure ]
#////////////////////////////////////////////////////////////////////////////////////////
@@ -938,7 +913,7 @@
webkit.org/b/200301 storage/websql/test-authorizer.html [ Failure ]
#////////////////////////////////////////////////////////////////////////////////////////
-# End of WebRTC-related bugs
+# End of WebSQL-related bugs
#////////////////////////////////////////////////////////////////////////////////////////
Modified: trunk/LayoutTests/platform/gtk/TestExpectations (270189 => 270190)
--- trunk/LayoutTests/platform/gtk/TestExpectations 2020-11-27 11:21:36 UTC (rev 270189)
+++ trunk/LayoutTests/platform/gtk/TestExpectations 2020-11-27 11:57:39 UTC (rev 270190)
@@ -1461,9 +1461,6 @@
webkit.org/b/198830 [ Release ] media/track/audio-track-add-remove.html [ Pass Crash ]
webkit.org/b/198830 [ Release ] webrtc/getUserMedia-webaudio-autoplay.html [ Pass Crash ]
-webkit.org/b/198830 [ Release ] webrtc/video-autoplay4.html [ Pass Crash ]
-webkit.org/b/198830 [ Release ] webrtc/video-getParameters.html [ Pass Crash Failure ]
-webkit.org/b/218787 [ Debug ] webrtc/video-getParameters.html [ Failure ]
webkit.org/b/198830 [ Release ] imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/event_playing.html [ Pass Crash ]
Modified: trunk/Source/WebCore/ChangeLog (270189 => 270190)
--- trunk/Source/WebCore/ChangeLog 2020-11-27 11:21:36 UTC (rev 270189)
+++ trunk/Source/WebCore/ChangeLog 2020-11-27 11:57:39 UTC (rev 270190)
@@ -1,3 +1,32 @@
+2020-11-27 Víctor Manuel Jáquez Leal <[email protected]>
+
+ REGRESSION(r269642) [GStreamer][WebRTC] Unexpected results after update to M87
+ https://bugs.webkit.org/show_bug.cgi?id=218787
+
+ Reviewed by Philippe Normand.
+
+ Describe more specifically the H264 SDP. It uses a hardcoded list with the minimun
+ requirement: ConstrainedBaseline and Baseline profiles which are supported by the video
+ decoders used in GStreamer.
+
+ No new tests required.
+
+ * platform/GStreamer.cmake:
+ * platform/mediastream/libwebrtc/GStreamerVideoCommon.cpp: Added.
+ (WebCore::createH264Format):
+ (WebCore::gstreamerSupportedH264Codecs):
+ * platform/mediastream/libwebrtc/GStreamerVideoCommon.h: Added.
+ * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp: Removed unused headers.
+ (WebCore::GStreamerVideoDecoder::AddDecoderIfSupported): Pass argument by reference.
+ (WebCore::GStreamerVideoDecoder::ConfigureSupportedDecoder): Instead of a single SDP returns
+ a vector of them.
+ * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp: Removed unused headers.
+ (WebCore::GStreamerVideoEncoder::AddCodecIfSupported): Pass argument by reference.
+ (WebCore::GStreamerVideoEncoder::ConfigureSupportedCodec): Instead of a single SDP returns
+ a vector of them and remove the unused argument.
+ (WebCore::GStreamerVideoEncoderFactory::GetSupportedFormats const):
+ * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.h: Fixed a typo.
+
2020-11-27 Philippe Normand <[email protected]>
Unreviewed, clang build fix after r270185
Modified: trunk/Source/WebCore/platform/GStreamer.cmake (270189 => 270190)
--- trunk/Source/WebCore/platform/GStreamer.cmake 2020-11-27 11:21:36 UTC (rev 270189)
+++ trunk/Source/WebCore/platform/GStreamer.cmake 2020-11-27 11:57:39 UTC (rev 270190)
@@ -40,6 +40,7 @@
platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp
platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp
+ platform/mediastream/libwebrtc/GStreamerVideoCommon.cpp
platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp
platform/mediastream/libwebrtc/GStreamerVideoEncoder.cpp
platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp
Added: trunk/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoCommon.cpp (0 => 270190)
--- trunk/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoCommon.cpp (rev 0)
+++ trunk/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoCommon.cpp 2020-11-27 11:57:39 UTC (rev 270190)
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2020 Metrological Group B.V.
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * aint with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+
+#if ENABLE(VIDEO) && ENABLE(MEDIA_STREAM) && USE(LIBWEBRTC) && USE(GSTREAMER)
+#include "GStreamerVideoCommon.h"
+
+#include "absl/types/optional.h"
+#include "webrtc/media/base/codec.h"
+#include "webrtc/media/base/h264_profile_level_id.h"
+
+namespace WebCore {
+
+static webrtc::SdpVideoFormat createH264Format(webrtc::H264::Profile profile, webrtc::H264::Level level, const std::string& packetizationMode)
+{
+ const auto profileString = webrtc::H264::ProfileLevelIdToString(webrtc::H264::ProfileLevelId(profile, level));
+
+ return webrtc::SdpVideoFormat(cricket::kH264CodecName,
+ { { cricket::kH264FmtpProfileLevelId, *profileString },
+ { cricket::kH264FmtpLevelAsymmetryAllowed, "1" },
+ { cricket::kH264FmtpPacketizationMode, packetizationMode } });
+}
+
+std::vector<webrtc::SdpVideoFormat> gstreamerSupportedH264Codecs()
+{
+ // @TODO Create from encoder src pad caps template
+ //
+ // We only support encoding Constrained Baseline Profile (CBP), but the decoder supports more
+ // profiles. We can list all profiles here that are supported by the decoder and that are also
+ // supersets of CBP, i.e. the decoder for that profile is required to be able to decode
+ // CBP. This means we can encode and send CBP even though we negotiated a potentially higher
+ // profile. See the H264 spec for more information.
+ //
+ // We support both packetization modes 0 (mandatory) and 1 (optional, preferred).
+ return { createH264Format(webrtc::H264::kProfileBaseline, webrtc::H264::kLevel3_1, "1"),
+ createH264Format(webrtc::H264::kProfileBaseline, webrtc::H264::kLevel3_1, "0"),
+ createH264Format(webrtc::H264::kProfileConstrainedBaseline, webrtc::H264::kLevel3_1, "1"),
+ createH264Format(webrtc::H264::kProfileConstrainedBaseline, webrtc::H264::kLevel3_1, "0"), };
+}
+
+} // namespace WebCore
+
+#endif
Copied: trunk/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoCommon.h (from rev 270189, trunk/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.h) (0 => 270190)
--- trunk/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoCommon.h (rev 0)
+++ trunk/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoCommon.h 2020-11-27 11:57:39 UTC (rev 270190)
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2020 Metrological Group B.V.
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * aint with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#pragma once
+
+#if ENABLE(VIDEO) && ENABLE(MEDIA_STREAM) && USE(LIBWEBRTC) && USE(GSTREAMER)
+
+#include "LibWebRTCMacros.h"
+#include "api/video_codecs/sdp_video_format.h"
+#include <vector>
+
+namespace WebCore {
+
+std::vector<webrtc::SdpVideoFormat> gstreamerSupportedH264Codecs();
+
+} // namespace WebCore
+
+#endif
Modified: trunk/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp (270189 => 270190)
--- trunk/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp 2020-11-27 11:21:36 UTC (rev 270189)
+++ trunk/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp 2020-11-27 11:57:39 UTC (rev 270190)
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2018 Metrological Group B.V.
- * Copyright (C) 2018 Igalia S.L. All rights reserved.
+ * Copyright (C) 2018,2020 Metrological Group B.V.
+ * Copyright (C) 2018,2020 Igalia S.L. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -23,10 +23,8 @@
#if ENABLE(VIDEO) && ENABLE(MEDIA_STREAM) && USE(LIBWEBRTC) && USE(GSTREAMER)
#include "GStreamerVideoDecoderFactory.h"
+#include "GStreamerVideoCommon.h"
#include "GStreamerVideoFrameLibWebRTC.h"
-#include "webrtc/common_video/h264/h264_common.h"
-#include "webrtc/common_video/h264/profile_level_id.h"
-#include "webrtc/media/base/codec.h"
#include "webrtc/modules/video_coding/codecs/h264/include/h264.h"
#include "webrtc/modules/video_coding/codecs/vp8/include/vp8.h"
#include "webrtc/modules/video_coding/codecs/vp8/libvpx_vp8_decoder.h"
@@ -282,18 +280,17 @@
return m_caps.get();
}
- void AddDecoderIfSupported(std::vector<webrtc::SdpVideoFormat> codecList)
+ void AddDecoderIfSupported(std::vector<webrtc::SdpVideoFormat>& codecList)
{
if (HasGstDecoder()) {
- webrtc::SdpVideoFormat format = ConfigureSupportedDecoder();
-
- codecList.push_back(format);
+ auto formats = ConfigureSupportedDecoder();
+ codecList.insert(codecList.end(), formats.begin(), formats.end());
}
}
- virtual webrtc::SdpVideoFormat ConfigureSupportedDecoder()
+ virtual std::vector<webrtc::SdpVideoFormat> ConfigureSupportedDecoder()
{
- return webrtc::SdpVideoFormat(Name());
+ return { webrtc::SdpVideoFormat(Name()) };
}
static GRefPtr<GstElementFactory> GstDecoderFactory(const char *capsStr)
@@ -370,6 +367,11 @@
const gchar* Caps() final { return "video/x-h264"; }
const gchar* Name() final { return cricket::kH264CodecName; }
webrtc::VideoCodecType CodecType() final { return webrtc::kVideoCodecH264; }
+
+ std::vector<webrtc::SdpVideoFormat> ConfigureSupportedDecoder() final
+ {
+ return gstreamerSupportedH264Codecs();
+ }
};
class VP8Decoder : public GStreamerVideoDecoder {
Modified: trunk/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp (270189 => 270190)
--- trunk/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp 2020-11-27 11:21:36 UTC (rev 270189)
+++ trunk/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp 2020-11-27 11:57:39 UTC (rev 270190)
@@ -23,11 +23,10 @@
#if ENABLE(VIDEO) && ENABLE(MEDIA_STREAM) && USE(LIBWEBRTC) && USE(GSTREAMER)
#include "GStreamerVideoEncoderFactory.h"
+#include "GStreamerVideoCommon.h"
#include "GStreamerVideoEncoder.h"
#include "GStreamerVideoFrameLibWebRTC.h"
#include "webrtc/common_video/h264/h264_common.h"
-#include "webrtc/common_video/h264/profile_level_id.h"
-#include "webrtc/media/base/codec.h"
#include "webrtc/modules/video_coding/codecs/h264/include/h264.h"
#include "webrtc/modules/video_coding/codecs/vp8/include/vp8.h"
#include "webrtc/modules/video_coding/codecs/vp8/libvpx_vp8_encoder.h"
@@ -326,12 +325,11 @@
return webrtcencoder;
}
- void AddCodecIfSupported(std::vector<webrtc::SdpVideoFormat>* supportedFormats)
+ void AddCodecIfSupported(std::vector<webrtc::SdpVideoFormat>& supportedFormats)
{
if (auto encoder = createEncoder()) {
- webrtc::SdpVideoFormat format = ConfigureSupportedCodec(encoder.get());
-
- supportedFormats->push_back(format);
+ auto formats = ConfigureSupportedCodec();
+ supportedFormats.insert(supportedFormats.end(), formats.begin(), formats.end());
}
}
@@ -340,9 +338,9 @@
return nullptr;
}
- virtual webrtc::SdpVideoFormat ConfigureSupportedCodec(GstElement*)
+ virtual std::vector<webrtc::SdpVideoFormat> ConfigureSupportedCodec()
{
- return webrtc::SdpVideoFormat(Name());
+ return { webrtc::SdpVideoFormat(Name()) };
}
virtual webrtc::VideoCodecType CodecType() = 0;
@@ -392,13 +390,9 @@
return codecSettings->H264().keyFrameInterval;
}
- webrtc::SdpVideoFormat ConfigureSupportedCodec(GstElement*) final
+ std::vector<webrtc::SdpVideoFormat> ConfigureSupportedCodec() final
{
- // TODO- Create from encoder src pad caps template
- return webrtc::SdpVideoFormat(cricket::kH264CodecName,
- { { cricket::kH264FmtpProfileLevelId, cricket::kH264ProfileLevelConstrainedBaseline },
- { cricket::kH264FmtpLevelAsymmetryAllowed, "1" },
- { cricket::kH264FmtpPacketizationMode, "1" } });
+ return gstreamerSupportedH264Codecs();
}
const gchar* Caps() final { return "video/x-h264"; }
@@ -477,7 +471,7 @@
std::vector<webrtc::SdpVideoFormat> supportedCodecs;
supportedCodecs.push_back(webrtc::SdpVideoFormat(cricket::kVp8CodecName));
- GStreamerH264Encoder().AddCodecIfSupported(&supportedCodecs);
+ GStreamerH264Encoder().AddCodecIfSupported(supportedCodecs);
return supportedCodecs;
}
Modified: trunk/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.h (270189 => 270190)
--- trunk/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.h 2020-11-27 11:21:36 UTC (rev 270189)
+++ trunk/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.h 2020-11-27 11:57:39 UTC (rev 270190)
@@ -37,7 +37,7 @@
std::unique_ptr<webrtc::VideoEncoder> CreateVideoEncoder(const webrtc::SdpVideoFormat&) final;
CodecInfo QueryVideoEncoder(const webrtc::SdpVideoFormat&) const override
{
- GST_FIXME("Detect wether the decoder is HW accelerated");
+ GST_FIXME("Detect whether the decoder is HW accelerated");
return { false };
}