Changeset 275275 in webkit
- Timestamp:
- Mar 31, 2021 4:11:17 AM (3 years ago)
- Location:
- trunk/Source
- Files:
-
- 2 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/CMakeLists.txt
r270477 r275275 28 28 if (USE_LIBWEBRTC) 29 29 add_subdirectory(ThirdParty/libwebrtc) 30 include_directories(${CMAKE_CURRENT_BINARY_DIR}/ThirdParty/libwebrtc) 30 31 endif () 31 32 -
trunk/Source/ThirdParty/libwebrtc/CMakeLists.txt
r272413 r275275 1418 1418 endif() 1419 1419 1420 1421 find_package(Openh264) 1422 if (NOT Openh264_FOUND) 1423 message(WARNING "openh264 is not found, not building support.") 1424 set(WEBKIT_LIBWEBRTC_OPENH264_ENCODER 0) 1425 else() 1426 list(APPEND webrtc_SOURCES 1427 Source/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.cc 1428 ) 1429 set(WEBKIT_LIBWEBRTC_OPENH264_ENCODER 1) 1430 endif () 1431 configure_file(LibWebRTCWebKitMacros.h.in LibWebRTCWebKitMacros.h @ONLY) 1432 1420 1433 add_library(webrtc STATIC ${webrtc_SOURCES}) 1421 1434 … … 1464 1477 WEBRTC_OPUS_VARIABLE_COMPLEXITY=0 1465 1478 WEBRTC_USE_BUILTIN_OPUS=1 1479 WEBRTC_USE_H264=1 1466 1480 WEBRTC_POSIX 1467 1481 WEBRTC_USE_BUILTIN_ISAC_FIX=1 … … 1517 1531 target_link_libraries(webrtc ${LIBOPUS_LIBRARY}) 1518 1532 1533 target_link_libraries(webrtc ${Openh264_LIBRARY}) 1534 1519 1535 # libsrtp package compilation 1520 1536 set(libsrtp_SOURCES -
trunk/Source/ThirdParty/libwebrtc/ChangeLog
r275082 r275275 1 2021-03-31 Thibault Saunier <tsaunier@igalia.com> and Philippe Normand <pnormand@igalia.com> 2 3 [WebRTC][GStreamer] Build and use the openh264 based encoder if present on the system 4 https://bugs.webkit.org/show_bug.cgi?id=202538 5 6 Reviewed by Xabier Rodriguez-Calvar and Adrian Perez de Castro. 7 8 In WPE/GTK we would like to have the libwebrtc openh264 encoder enabled if libopenh264 is 9 present on the host (eg not vendored). 10 11 * CMakeLists.txt: 12 * Source/webrtc/modules/video_coding/codecs/h264/h264.cc: 13 * Source/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.cc: 14 * Source/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.h: 15 1 16 2021-03-26 Jessie Berlin <jberlin@webkit.org> 2 17 -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/modules/video_coding/codecs/h264/h264.cc
r269642 r275275 20 20 21 21 #if defined(WEBRTC_USE_H264) 22 #if !defined(WEBRTC_WEBKIT_BUILD) 22 23 #include "modules/video_coding/codecs/h264/h264_decoder_impl.h" 24 #endif 23 25 #include "modules/video_coding/codecs/h264/h264_encoder_impl.h" 24 26 #endif … … 104 106 std::unique_ptr<H264Decoder> H264Decoder::Create() { 105 107 RTC_DCHECK(H264Decoder::IsSupported()); 106 #if defined(WEBRTC_USE_H264) 108 #if defined(WEBRTC_USE_H264) && !defined(WEBRTC_WEBKIT_BUILD) 107 109 RTC_CHECK(g_rtc_use_h264); 108 110 RTC_LOG(LS_INFO) << "Creating H264DecoderImpl."; -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.cc
r269642 r275275 30 30 #include "third_party/libyuv/include/libyuv/convert.h" 31 31 #include "third_party/libyuv/include/libyuv/scale.h" 32 33 #ifdef WEBRTC_WEBKIT_BUILD 34 #include "wels/codec_api.h" 35 #include "wels/codec_app_def.h" 36 #include "wels/codec_def.h" 37 #include "wels/codec_ver.h" 38 #else 32 39 #include "third_party/openh264/src/codec/api/svc/codec_api.h" 33 40 #include "third_party/openh264/src/codec/api/svc/codec_app_def.h" 34 41 #include "third_party/openh264/src/codec/api/svc/codec_def.h" 35 42 #include "third_party/openh264/src/codec/api/svc/codec_ver.h" 43 #endif 36 44 37 45 namespace webrtc { -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.h
r269642 r275275 30 30 #include "modules/video_coding/codecs/h264/include/h264.h" 31 31 #include "modules/video_coding/utility/quality_scaler.h" 32 33 #ifdef WEBRTC_WEBKIT_BUILD 34 #include "wels/codec_app_def.h" 35 #else 32 36 #include "third_party/openh264/src/codec/api/svc/codec_app_def.h" 37 #endif 33 38 34 39 class ISVCEncoder; -
trunk/Source/WebCore/ChangeLog
r275273 r275275 1 2021-03-31 Thibault Saunier <tsaunier@igalia.com> and Philippe Normand <pnormand@igalia.com> 2 3 [WebRTC][GStreamer] Build and use the openh264 based encoder if present on the system 4 https://bugs.webkit.org/show_bug.cgi?id=202538 5 6 Reviewed by Xabier Rodriguez-Calvar and Adrian Perez de Castro. 7 8 Enable the openh264 encoder if it is available, it would be preferred over existing 9 GStreamer H.264 encoders in such case. 10 11 * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp: 12 (WebCore::GStreamerVideoEncoder::AddCodecIfSupported): 13 (WebCore::GStreamerVideoEncoderFactory::CreateVideoEncoder): 14 1 15 2021-03-30 Antoine Quint <graouts@webkit.org> 2 16 -
trunk/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoCommon.cpp
r270190 r275275 40 40 } 41 41 42 std::vector<webrtc::SdpVideoFormat> gstreamerSupportedH264Codecs()42 std::vector<webrtc::SdpVideoFormat> supportedH264Formats() 43 43 { 44 44 // @TODO Create from encoder src pad caps template -
trunk/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoCommon.h
r270190 r275275 29 29 namespace WebCore { 30 30 31 std::vector<webrtc::SdpVideoFormat> gstreamerSupportedH264Codecs();31 std::vector<webrtc::SdpVideoFormat> supportedH264Formats(); 32 32 33 33 } // namespace WebCore -
trunk/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp
r274479 r275275 363 363 std::vector<webrtc::SdpVideoFormat> ConfigureSupportedDecoder() final 364 364 { 365 return gstreamerSupportedH264Codecs();365 return supportedH264Formats(); 366 366 } 367 367 }; -
trunk/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp
r274149 r275275 27 27 #include "GStreamerVideoEncoder.h" 28 28 #include "GStreamerVideoFrameLibWebRTC.h" 29 #include "LibWebRTCWebKitMacros.h" 29 30 #include "webrtc/common_video/h264/h264_common.h" 30 31 #include "webrtc/modules/video_coding/codecs/h264/include/h264.h" … … 375 376 std::vector<webrtc::SdpVideoFormat> ConfigureSupportedCodec() final 376 377 { 377 return gstreamerSupportedH264Codecs();378 return supportedH264Formats(); 378 379 } 379 380 … … 433 434 } 434 435 435 if (format.name == cricket::kH264CodecName) 436 if (format.name == cricket::kH264CodecName) { 437 #if WEBKIT_LIBWEBRTC_OPENH264_ENCODER 438 GST_INFO("Using OpenH264 libwebrtc encoder."); 439 return webrtc::H264Encoder::Create(cricket::VideoCodec(format)); 440 #else 441 GST_INFO("Using H264 GStreamer encoder."); 436 442 return makeUnique<GStreamerH264Encoder>(format); 443 #endif 444 } 437 445 438 446 return nullptr; … … 457 465 458 466 supportedCodecs.push_back(webrtc::SdpVideoFormat(cricket::kVp8CodecName)); 467 468 // If OpenH264 is present, prefer it over the GStreamer encoders (x264enc, usually). 469 #if WEBKIT_LIBWEBRTC_OPENH264_ENCODER 470 auto formats = supportedH264Formats(); 471 supportedCodecs.insert(supportedCodecs.end(), formats.begin(), formats.end()); 472 #else 459 473 GStreamerH264Encoder().AddCodecIfSupported(supportedCodecs); 474 #endif 460 475 461 476 return supportedCodecs; -
trunk/Source/cmake/GStreamerChecks.cmake
r271399 r275275 55 55 if (ENABLE_MEDIA_STREAM AND ENABLE_WEB_RTC) 56 56 SET_AND_EXPOSE_TO_BUILD(USE_LIBWEBRTC TRUE) 57 SET_AND_EXPOSE_TO_BUILD(WEBRTC_WEBKIT_BUILD TRUE)58 57 else () 59 58 SET_AND_EXPOSE_TO_BUILD(USE_LIBWEBRTC FALSE) 60 SET_AND_EXPOSE_TO_BUILD(WEBRTC_WEBKIT_BUILD FALSE)61 59 endif ()
Note: See TracChangeset
for help on using the changeset viewer.