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.