[M120 Migration][WebRTC] Fix simulcast functionality when VP8 encoder is used 33/311533/6
authorMichal Jurkiewicz <m.jurkiewicz@samsung.com>
Mon, 20 May 2024 11:10:52 +0000 (13:10 +0200)
committerBot Blink <blinkbot@samsung.com>
Thu, 23 May 2024 01:24:04 +0000 (01:24 +0000)
Ported changes of upstream part of the commit:
https://review.tizen.org/gerrit/c/platform/framework/web/chromium-efl/+/303290

Bug: https://jira-eu.sec.samsung.net/browse/VDWASM-1548
Change-Id: I0646a245b2e9b988f66c4c06afe660e604763ed8
Signed-off-by: Michal Jurkiewicz <m.jurkiewicz@samsung.com>
third_party/webrtc/media/engine/simulcast_encoder_adapter.cc

index 4853e68996261c32181c7b39d59b2e179ce45c55..1ca67a9652f071d5d8c135caa51eb045f447cd65 100644 (file)
@@ -412,6 +412,18 @@ int SimulcastEncoderAdapter::InitEncode(
       return ret;
     }
 
+#if defined(WEBRTC_TIZEN_TV)
+    // It is possible, that `encoder_context` stores |VideoEncoder| that
+    // supports simulcast and have multiple active layers, but does not support
+    // specific provided configuration. In such case
+    // `encoder_context->Release()` will be called, resulting in resetting
+    // |EncodedImageCallback| registered inside of `VideoEncoder` class. If that
+    // happens, here we will have properly initialized encoder, that has
+    // `nullptr` registered as its |EncodedImageCallback|.
+    encoder_context->encoder().RegisterEncodeCompleteCallback(
+        encoded_complete_callback_);
+#endif
+
     // Intercept frame encode complete callback only for upper streams, where
     // we need to set a correct stream index. Set `parent` to nullptr for the
     // lowest stream to bypass the callback.