[WebRTC] Add missing encoding formats to RTCVideoEncoderFactoryEfl 75/291975/3
authorJakub Gajownik <j.gajownik2@samsung.com>
Thu, 13 Apr 2023 14:28:21 +0000 (16:28 +0200)
committerBot Blink <blinkbot@samsung.com>
Fri, 5 May 2023 10:32:57 +0000 (10:32 +0000)
We're not using standard RTCVideoEncoderFactory, but the
EFL version. Because of that we got no default H264 encoder
formats from libwebrtc. As a result, no intersection will
be found between recv and send codecs for H264. Some feature
might not work properly in such environment, e.g
|setCodecPreferences| method.

Bug: https://cam.sprc.samsung.pl/browse/VDWASM-1223
Change-Id: Iddc63e48fa9da04ad78a1c6e6d9987b37756acde
Signed-off-by: Jakub Gajownik <j.gajownik2@samsung.com>
tizen_src/chromium_impl/third_party/blink/renderer/platform/peerconnection/rtc_video_encoder_factory_efl.cc

index d193013c5008e1ae99f495d1c2c0494e1fbe7b93..703f04347754af6e101901b0bc543045cd4a5824 100644 (file)
@@ -19,6 +19,7 @@
 #include "third_party/webrtc/api/video_codecs/sdp_video_format.h"
 #include "third_party/webrtc/media/base/h264_profile_level_id.h"
 #include "third_party/webrtc/media/base/media_constants.h"
+#include "third_party/webrtc/modules/video_coding/codecs/h264/include/h264.h"
 
 #if defined(TIZEN_CAPI_ENCODER_TV_API)
 #include "third_party/blink/renderer/platform/peerconnection/rtc_video_encoder_tizen_adapter.h"
@@ -72,7 +73,6 @@ RTCVideoEncoderFactoryEfl::GetSupportedFormats() const {
   std::vector<webrtc::SdpVideoFormat> supported_codecs;
   supported_codecs.emplace_back(cricket::kVp8CodecName);
 
-  // TODO(m.napiorkows): We should include this AND lower coding profiles
   const webrtc::H264::ProfileLevelId profile_level_id(
       webrtc::H264::kProfileConstrainedBaseline, webrtc::H264::kLevel4);
   webrtc::SdpVideoFormat format{"H264"};
@@ -82,6 +82,13 @@ RTCVideoEncoderFactoryEfl::GetSupportedFormats() const {
       {cricket::kH264FmtpLevelAsymmetryAllowed, "1"},
       {cricket::kH264FmtpPacketizationMode, "1"}};
   supported_codecs.push_back(format);
+
+  // Mark default configurations from WebRTC SW decoder as supported also.
+  for (const webrtc::SdpVideoFormat& format : webrtc::SupportedH264Codecs()) {
+    if (!format.IsCodecInList(supported_codecs)) {
+      supported_codecs.push_back(format);
+    }
+  }
   return supported_codecs;
 }