Title: [275551] trunk
Revision
275551
Author
[email protected]
Date
2021-04-06 14:08:53 -0700 (Tue, 06 Apr 2021)

Log Message

REGRESSION(r275275): Broke some build configs lacking openh264
https://bugs.webkit.org/show_bug.cgi?id=224244

Unreviewed, manual revert of r275275 and r275409.

Patch by Philippe Normand <[email protected]> on 2021-04-06

.:

* Source/CMakeLists.txt:
* Source/cmake/GStreamerChecks.cmake:

Source/ThirdParty/libwebrtc:

* CMakeLists.txt:
* LibWebRTCWebKitMacros.h.in: Removed.
* Source/webrtc/modules/video_coding/codecs/h264/h264.cc:
* Source/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.cc:
* Source/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.h:
* cmake/FindOpenh264.cmake: Removed.

Source/WebCore:

* platform/mediastream/libwebrtc/GStreamerVideoCommon.cpp:
(WebCore::gstreamerSupportedH264Codecs):
(WebCore::supportedH264Formats): Deleted.
* platform/mediastream/libwebrtc/GStreamerVideoCommon.h:
* platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp:
* platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
(WebCore::GStreamerVideoEncoderFactory::CreateVideoEncoder):
(WebCore::GStreamerVideoEncoderFactory::GetSupportedFormats const):

Modified Paths

Removed Paths

Diff

Modified: trunk/ChangeLog (275550 => 275551)


--- trunk/ChangeLog	2021-04-06 21:05:53 UTC (rev 275550)
+++ trunk/ChangeLog	2021-04-06 21:08:53 UTC (rev 275551)
@@ -1,3 +1,13 @@
+2021-04-06  Philippe Normand  <[email protected]>
+
+        REGRESSION(r275275): Broke some build configs lacking openh264
+        https://bugs.webkit.org/show_bug.cgi?id=224244
+
+        Unreviewed, manual revert of r275275 and r275409.
+
+        * Source/CMakeLists.txt:
+        * Source/cmake/GStreamerChecks.cmake:
+
 2021-04-06  Mark Lam  <[email protected]>
 
         Speculative build fix for Windows port.

Modified: trunk/Source/CMakeLists.txt (275550 => 275551)


--- trunk/Source/CMakeLists.txt	2021-04-06 21:05:53 UTC (rev 275550)
+++ trunk/Source/CMakeLists.txt	2021-04-06 21:08:53 UTC (rev 275551)
@@ -27,7 +27,6 @@
 
 if (USE_LIBWEBRTC)
     add_subdirectory(ThirdParty/libwebrtc)
-    include_directories(${CMAKE_CURRENT_BINARY_DIR}/ThirdParty/libwebrtc)
 endif ()
 
 if (ENABLE_WEBINSPECTORUI)

Modified: trunk/Source/ThirdParty/libwebrtc/CMakeLists.txt (275550 => 275551)


--- trunk/Source/ThirdParty/libwebrtc/CMakeLists.txt	2021-04-06 21:05:53 UTC (rev 275550)
+++ trunk/Source/ThirdParty/libwebrtc/CMakeLists.txt	2021-04-06 21:08:53 UTC (rev 275551)
@@ -1377,9 +1377,6 @@
     )
 endif()
 
-
-configure_file(LibWebRTCWebKitMacros.h.in LibWebRTCWebKitMacros.h @ONLY)
-
 if (APPLE)
     list(APPEND webrtc_SOURCES
         Source/webrtc/sdk/objc/components/video_codec/RTCVideoDecoderH265.mm
@@ -1530,16 +1527,6 @@
         Source/third_party/opus/src/include/opus_types.h
         DESTINATION ${libwebrtc_PRIVATE_HEADERS_DIR})
 else ()
-    find_package(Openh264)
-    if (NOT Openh264_FOUND)
-        message(WARNING "openh264 is not found, not building support.")
-        set(WEBKIT_LIBWEBRTC_OPENH264_ENCODER 0)
-    else()
-        list(APPEND webrtc_SOURCES
-            Source/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.cc
-        )
-        set(WEBKIT_LIBWEBRTC_OPENH264_ENCODER 1)
-    endif ()
 
     list(APPEND webrtc_SOURCES
         Source/third_party/boringssl/src/crypto/cpu-aarch64-linux.c
@@ -1635,7 +1622,6 @@
   WEBRTC_OPUS_SUPPORT_120MS_PTIME=0
   WEBRTC_OPUS_VARIABLE_COMPLEXITY=0
   WEBRTC_USE_BUILTIN_OPUS=1
-  WEBRTC_USE_H264=1
   WEBRTC_POSIX
   WEBRTC_USE_BUILTIN_ISAC_FIX=1
   WEBRTC_USE_BUILTIN_ISAC_FLOAT=0
@@ -1712,9 +1698,6 @@
     target_link_libraries(webrtc ${LIBVPX_LIBRARY})
     target_link_libraries(webrtc ${LIBEVENT_LIBRARY})
     target_link_libraries(webrtc ${LIBOPUS_LIBRARY})
-    if (Openh264_FOUND)
-        target_link_libraries(webrtc ${Openh264_LIBRARY})
-    endif ()
 endif ()
 
 target_include_directories(webrtc ${webrtc_INCLUDE_DIRECTORIES})

Modified: trunk/Source/ThirdParty/libwebrtc/ChangeLog (275550 => 275551)


--- trunk/Source/ThirdParty/libwebrtc/ChangeLog	2021-04-06 21:05:53 UTC (rev 275550)
+++ trunk/Source/ThirdParty/libwebrtc/ChangeLog	2021-04-06 21:08:53 UTC (rev 275551)
@@ -1,3 +1,17 @@
+2021-04-06  Philippe Normand  <[email protected]>
+
+        REGRESSION(r275275): Broke some build configs lacking openh264
+        https://bugs.webkit.org/show_bug.cgi?id=224244
+
+        Unreviewed, manual revert of r275275 and r275409.
+
+        * CMakeLists.txt:
+        * LibWebRTCWebKitMacros.h.in: Removed.
+        * Source/webrtc/modules/video_coding/codecs/h264/h264.cc:
+        * Source/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.cc:
+        * Source/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.h:
+        * cmake/FindOpenh264.cmake: Removed.
+
 2021-04-05  Alex Christensen  <[email protected]>
 
         Resurrect Mac CMake build

Deleted: trunk/Source/ThirdParty/libwebrtc/LibWebRTCWebKitMacros.h.in (275550 => 275551)


--- trunk/Source/ThirdParty/libwebrtc/LibWebRTCWebKitMacros.h.in	2021-04-06 21:05:53 UTC (rev 275550)
+++ trunk/Source/ThirdParty/libwebrtc/LibWebRTCWebKitMacros.h.in	2021-04-06 21:08:53 UTC (rev 275551)
@@ -1 +0,0 @@
-#cmakedefine01 WEBKIT_LIBWEBRTC_OPENH264_ENCODER

Modified: trunk/Source/ThirdParty/libwebrtc/Source/webrtc/modules/video_coding/codecs/h264/h264.cc (275550 => 275551)


--- trunk/Source/ThirdParty/libwebrtc/Source/webrtc/modules/video_coding/codecs/h264/h264.cc	2021-04-06 21:05:53 UTC (rev 275550)
+++ trunk/Source/ThirdParty/libwebrtc/Source/webrtc/modules/video_coding/codecs/h264/h264.cc	2021-04-06 21:08:53 UTC (rev 275551)
@@ -19,9 +19,7 @@
 #include "media/base/media_constants.h"
 
 #if defined(WEBRTC_USE_H264)
-#if !defined(WEBRTC_WEBKIT_BUILD)
 #include "modules/video_coding/codecs/h264/h264_decoder_impl.h"
-#endif
 #include "modules/video_coding/codecs/h264/h264_encoder_impl.h"
 #endif
 
@@ -105,7 +103,7 @@
 
 std::unique_ptr<H264Decoder> H264Decoder::Create() {
   RTC_DCHECK(H264Decoder::IsSupported());
-#if defined(WEBRTC_USE_H264) && !defined(WEBRTC_WEBKIT_BUILD)
+#if defined(WEBRTC_USE_H264)
   RTC_CHECK(g_rtc_use_h264);
   RTC_LOG(LS_INFO) << "Creating H264DecoderImpl.";
   return std::make_unique<H264DecoderImpl>();

Modified: trunk/Source/ThirdParty/libwebrtc/Source/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.cc (275550 => 275551)


--- trunk/Source/ThirdParty/libwebrtc/Source/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.cc	2021-04-06 21:05:53 UTC (rev 275550)
+++ trunk/Source/ThirdParty/libwebrtc/Source/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.cc	2021-04-06 21:08:53 UTC (rev 275551)
@@ -29,18 +29,10 @@
 #include "system_wrappers/include/metrics.h"
 #include "third_party/libyuv/include/libyuv/convert.h"
 #include "third_party/libyuv/include/libyuv/scale.h"
-
-#ifdef WEBRTC_WEBKIT_BUILD
-#include "wels/codec_api.h"
-#include "wels/codec_app_def.h"
-#include "wels/codec_def.h"
-#include "wels/codec_ver.h"
-#else
 #include "third_party/openh264/src/codec/api/svc/codec_api.h"
 #include "third_party/openh264/src/codec/api/svc/codec_app_def.h"
 #include "third_party/openh264/src/codec/api/svc/codec_def.h"
 #include "third_party/openh264/src/codec/api/svc/codec_ver.h"
-#endif
 
 namespace webrtc {
 

Modified: trunk/Source/ThirdParty/libwebrtc/Source/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.h (275550 => 275551)


--- trunk/Source/ThirdParty/libwebrtc/Source/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.h	2021-04-06 21:05:53 UTC (rev 275550)
+++ trunk/Source/ThirdParty/libwebrtc/Source/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.h	2021-04-06 21:08:53 UTC (rev 275551)
@@ -29,12 +29,7 @@
 #include "common_video/h264/h264_bitstream_parser.h"
 #include "modules/video_coding/codecs/h264/include/h264.h"
 #include "modules/video_coding/utility/quality_scaler.h"
-
-#ifdef WEBRTC_WEBKIT_BUILD
-#include "wels/codec_app_def.h"
-#else
 #include "third_party/openh264/src/codec/api/svc/codec_app_def.h"
-#endif
 
 class ISVCEncoder;
 

Deleted: trunk/Source/ThirdParty/libwebrtc/cmake/FindOpenh264.cmake (275550 => 275551)


--- trunk/Source/ThirdParty/libwebrtc/cmake/FindOpenh264.cmake	2021-04-06 21:05:53 UTC (rev 275550)
+++ trunk/Source/ThirdParty/libwebrtc/cmake/FindOpenh264.cmake	2021-04-06 21:08:53 UTC (rev 275551)
@@ -1,105 +0,0 @@
-# Copyright (C) 2020 Sony Interactive Entertainment Inc.
-# Copyright (C) 2021 Igalia S.L.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
-# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-# THE POSSIBILITY OF SUCH DAMAGE.
-
-#[=======================================================================[.rst:
-FindOpenh264
---------------
-
-Find Openh264 headers and libraries.
-
-Imported Targets
-^^^^^^^^^^^^^^^^
-
-``Openh264::libopenh264``
-  The libopenh264 library, if found.
-
-Result Variables
-^^^^^^^^^^^^^^^^
-
-This will define the following variables in your project:
-
-``Openh264_FOUND``
-  true if (the requested version of) Openh264 is available.
-``Openh264_VERSION``
-  the version of Openh264.
-``Openh264_LIBRARIES``
-  the libraries to link against to use Openh264.
-``Openh264_INCLUDE_DIRS``
-  where to find the Openh264 headers.
-
-#]=======================================================================]
-
-find_package(PkgConfig QUIET)
-pkg_check_modules(PC_Openh264 QUIET openh264)
-set(Openh264_VERSION ${PC_Openh264_VERSION})
-
-find_path(Openh264_INCLUDE_DIR
-    NAMES wels/codec_api.h
-    HINTS ${PC_Openh264_INCLUDEDIR} ${PC_Openh264_INCLUDE_DIRS}
-)
-
-find_library(Openh264_LIBRARY
-    NAMES ${Openh264_NAMES} openh264
-    HINTS ${PC_Openh264_LIBDIR} ${PC_Openh264_LIBRARY_DIRS}
-)
-
-if (Openh264_INCLUDE_DIR AND NOT Openh264_VERSION)
-    if (EXISTS "${Openh264_INCLUDE_DIR}/wels/codec_ver.h")
-        file(READ "${Openh264_INCLUDE_DIR}/wels/codec_ver.h" Openh264_VERSION_CONTENT)
-
-        string(REGEX MATCH "#[ \t]*define[ \t]+OPENH264_MAJOR[ \t]+\\(([0-9]+)\\)" _dummy "${Openh264_VERSION_CONTENT}")
-        set(Openh264_VERSION_MAJOR "${CMAKE_MATCH_1}")
-
-        string(REGEX MATCH "#[ \t]*define[ \t]+OPENH264_MINOR[ \t]+\\(([0-9]+)\\)" _dummy "${Openh264_VERSION_CONTENT}")
-        set(Openh264_VERSION_MINOR "${CMAKE_MATCH_1}")
-
-        string(REGEX MATCH "#[ \t]*define[ \t]+OPENH264_REVISION[ \t]+\\(([0-9]+)\\)" _dummy "${Openh264_VERSION_CONTENT}")
-        set(Openh264_VERSION_REVISION "${CMAKE_MATCH_1}")
-
-        set(Openh264_VERSION "${Openh264_VERSION_MAJOR}.${Openh264_VERSION_MINOR}.${Openh264_VERSION_REVISION}")
-    endif ()
-endif ()
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(Openh264
-    FOUND_VAR Openh264_FOUND
-    REQUIRED_VARS Openh264_LIBRARY Openh264_INCLUDE_DIR
-    VERSION_VAR Openh264_VERSION
-)
-
-if (Openh264_LIBRARY AND NOT TARGET Openh264::libopenh264)
-    add_library(Openh264::libopenh264 UNKNOWN IMPORTED GLOBAL)
-    set_target_properties(Openh264::libopenh264 PROPERTIES
-        IMPORTED_LOCATION "${Openh264_LIBRARY}"
-        INTERFACE_COMPILE_OPTIONS "${Openh264_COMPILE_OPTIONS}"
-        INTERFACE_INCLUDE_DIRECTORIES "${Openh264_INCLUDE_DIR}"
-    )
-endif ()
-
-mark_as_advanced(Openh264_INCLUDE_DIR Openh264_LIBRARY)
-
-if (Openh264_FOUND)
-    set(Openh264_LIBRARIES ${Openh264_LIBRARY})
-    set(Openh264_INCLUDE_DIRS ${Openh264_INCLUDE_DIR})
-endif ()

Modified: trunk/Source/WebCore/ChangeLog (275550 => 275551)


--- trunk/Source/WebCore/ChangeLog	2021-04-06 21:05:53 UTC (rev 275550)
+++ trunk/Source/WebCore/ChangeLog	2021-04-06 21:08:53 UTC (rev 275551)
@@ -1,3 +1,19 @@
+2021-04-06  Philippe Normand  <[email protected]>
+
+        REGRESSION(r275275): Broke some build configs lacking openh264
+        https://bugs.webkit.org/show_bug.cgi?id=224244
+
+        Unreviewed, manual revert of r275275 and r275409.
+
+        * platform/mediastream/libwebrtc/GStreamerVideoCommon.cpp:
+        (WebCore::gstreamerSupportedH264Codecs):
+        (WebCore::supportedH264Formats): Deleted.
+        * platform/mediastream/libwebrtc/GStreamerVideoCommon.h:
+        * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp:
+        * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
+        (WebCore::GStreamerVideoEncoderFactory::CreateVideoEncoder):
+        (WebCore::GStreamerVideoEncoderFactory::GetSupportedFormats const):
+
 2021-04-06  Simon Fraser  <[email protected]>
 
         Shrink some IndexedDB-related classes

Modified: trunk/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoCommon.cpp (275550 => 275551)


--- trunk/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoCommon.cpp	2021-04-06 21:05:53 UTC (rev 275550)
+++ trunk/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoCommon.cpp	2021-04-06 21:08:53 UTC (rev 275551)
@@ -39,7 +39,7 @@
             { cricket::kH264FmtpPacketizationMode, packetizationMode } });
 }
 
-std::vector<webrtc::SdpVideoFormat> supportedH264Formats()
+std::vector<webrtc::SdpVideoFormat> gstreamerSupportedH264Codecs()
 {
     // @TODO Create from encoder src pad caps template
     //

Modified: trunk/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoCommon.h (275550 => 275551)


--- trunk/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoCommon.h	2021-04-06 21:05:53 UTC (rev 275550)
+++ trunk/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoCommon.h	2021-04-06 21:08:53 UTC (rev 275551)
@@ -28,7 +28,7 @@
 
 namespace WebCore {
 
-std::vector<webrtc::SdpVideoFormat> supportedH264Formats();
+std::vector<webrtc::SdpVideoFormat> gstreamerSupportedH264Codecs();
 
 } // namespace WebCore
 

Modified: trunk/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp (275550 => 275551)


--- trunk/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp	2021-04-06 21:05:53 UTC (rev 275550)
+++ trunk/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp	2021-04-06 21:08:53 UTC (rev 275551)
@@ -362,7 +362,7 @@
 
     std::vector<webrtc::SdpVideoFormat> ConfigureSupportedDecoder() final
     {
-        return supportedH264Formats();
+        return gstreamerSupportedH264Codecs();
     }
 };
 

Modified: trunk/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp (275550 => 275551)


--- trunk/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp	2021-04-06 21:05:53 UTC (rev 275550)
+++ trunk/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp	2021-04-06 21:08:53 UTC (rev 275551)
@@ -26,7 +26,6 @@
 #include "GStreamerVideoCommon.h"
 #include "GStreamerVideoEncoder.h"
 #include "GStreamerVideoFrameLibWebRTC.h"
-#include "LibWebRTCWebKitMacros.h"
 #include "webrtc/common_video/h264/h264_common.h"
 #include "webrtc/modules/video_coding/codecs/h264/include/h264.h"
 #include "webrtc/modules/video_coding/codecs/vp8/include/vp8.h"
@@ -375,7 +374,7 @@
 
     std::vector<webrtc::SdpVideoFormat> ConfigureSupportedCodec() final
     {
-        return supportedH264Formats();
+        return gstreamerSupportedH264Codecs();
     }
 
     const gchar* Caps() final { return "video/x-h264"; }
@@ -433,15 +432,8 @@
         return makeUniqueWithoutFastMallocCheck<webrtc::LibvpxVp8Encoder>(webrtc::LibvpxInterface::CreateEncoder(), webrtc::VP8Encoder::Settings());
     }
 
-    if (format.name == cricket::kH264CodecName) {
-#if WEBKIT_LIBWEBRTC_OPENH264_ENCODER
-        GST_INFO("Using OpenH264 libwebrtc encoder.");
-        return webrtc::H264Encoder::Create(cricket::VideoCodec(format));
-#else
-        GST_INFO("Using H264 GStreamer encoder.");
+    if (format.name == cricket::kH264CodecName)
         return makeUnique<GStreamerH264Encoder>(format);
-#endif
-    }
 
     return nullptr;
 }
@@ -464,14 +456,7 @@
     std::vector<webrtc::SdpVideoFormat> supportedCodecs;
 
     supportedCodecs.push_back(webrtc::SdpVideoFormat(cricket::kVp8CodecName));
-
-    // If OpenH264 is present, prefer it over the GStreamer encoders (x264enc, usually).
-#if WEBKIT_LIBWEBRTC_OPENH264_ENCODER
-    auto formats = supportedH264Formats();
-    supportedCodecs.insert(supportedCodecs.end(), formats.begin(), formats.end());
-#else
     GStreamerH264Encoder().AddCodecIfSupported(supportedCodecs);
-#endif
 
     return supportedCodecs;
 }

Modified: trunk/Source/cmake/GStreamerChecks.cmake (275550 => 275551)


--- trunk/Source/cmake/GStreamerChecks.cmake	2021-04-06 21:05:53 UTC (rev 275550)
+++ trunk/Source/cmake/GStreamerChecks.cmake	2021-04-06 21:08:53 UTC (rev 275551)
@@ -54,6 +54,8 @@
 
 if (ENABLE_MEDIA_STREAM AND ENABLE_WEB_RTC)
     SET_AND_EXPOSE_TO_BUILD(USE_LIBWEBRTC TRUE)
+    SET_AND_EXPOSE_TO_BUILD(WEBRTC_WEBKIT_BUILD TRUE)
 else ()
     SET_AND_EXPOSE_TO_BUILD(USE_LIBWEBRTC FALSE)
+    SET_AND_EXPOSE_TO_BUILD(WEBRTC_WEBKIT_BUILD FALSE)
 endif ()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to