From 2e8d32ef2c1b7bb9368d02003cc604517c46be7c Mon Sep 17 00:00:00 2001 From: Michal Jurkiewicz Date: Mon, 20 May 2024 13:10:52 +0200 Subject: [PATCH] [M120 Migration][WebRTC] Fix simulcast functionality when VP8 encoder is used 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 --- .../webrtc/media/engine/simulcast_encoder_adapter.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/third_party/webrtc/media/engine/simulcast_encoder_adapter.cc b/third_party/webrtc/media/engine/simulcast_encoder_adapter.cc index 4853e6899626..1ca67a9652f0 100644 --- a/third_party/webrtc/media/engine/simulcast_encoder_adapter.cc +++ b/third_party/webrtc/media/engine/simulcast_encoder_adapter.cc @@ -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. -- 2.34.1