// When collection for preparation is changed we should reset result,
// to avoid returning invalid value.
if (collection_token_on_client_ != collection_token) {
+ TIZEN_MEDIA_LOG(VERBOSE) << "Collection token change from: "
+ << collection_token_on_client_.ToString()
+ << " to: " << collection_token.ToString();
+
+ // Notify previous collection about mode change. It might wait to reach
+ // overlay mode (like preparation during decoder start).
+ if (mode_cb_on_client_) {
+ mode_cb_on_client_.Run(gfx::VideoOutputMode::kTexture);
+ }
collection_token_on_client_ = collection_token;
last_result_on_client_ = gfx::VideoOutputMode::kTransitionUnmuting;
is_first_preparation = true;
auto bound_mode_cb = media::BindToCurrentLoop(base::BindRepeating(
&OutputSurfaceProxy::UpdateMode, client_accessor_->weak_ptr));
if (!initialized_on_client_.has_value()) {
+ if (pending_prepare_to_render_on_client_ &&
+ pending_prepare_to_render_on_client_->mode_cb) {
+ TIZEN_MEDIA_LOG(VERBOSE) << "Notify old pending prepare of stealing";
+ pending_prepare_to_render_on_client_->mode_cb.Run(
+ gfx::VideoOutputMode::kTexture);
+ }
TIZEN_MEDIA_LOG(VERBOSE) << "Set pending prepare to render";
pending_prepare_to_render_on_client_ = {collection_token,
can_render_texture, bound_mode_cb};