[M130 Migration][MM] Fix video quality on device with multiple video tags 81/324481/10
authorNathaniel Brian Micu <nb.micu@samsung.com>
Mon, 19 May 2025 09:49:18 +0000 (17:49 +0800)
committerBot Blink <blinkbot@samsung.com>
Tue, 27 May 2025 07:49:51 +0000 (07:49 +0000)
Using mixer mode decreases the quality of the video,
sometimes making the video unwatchable. To improve
the playback of multiple videos, the use of multiple
scalers when available is prioritized before mixer mode.

As is:
2 videos - play videos #1-2 using mixer mode
3 videos - play videos #1-3 using mixer mode
4 videos - play videos #1-3 using mixer mode
    and video #4 using sub-scaler

To be:
2 videos - play video #1 using main scaler
    and video #2 using sub-scaler
3 videos - play videos #1-3 using mixer mode (no change)
4 videos - play videos #1-3 using mixer mode
    and video #4 using sub-scaler (no change)

Related KONA: DF250217-00919

Reference: http://10.40.78.157/changes/12687643
Change-Id: I693ee8922b85169389ac3e5dc2a4900efe7ee2fc
Signed-off-by: Nathaniel Brian Micu <nb.micu@samsung.com>
tizen_src/chromium_impl/content/browser/media/tizen_renderer_impl.cc
tizen_src/chromium_impl/media/filters/media_player_bridge_capi_tv.cc

index 08a2ed047d5f47f3e6820d7ff90ed9ce3dc6eb24..36960cd0a1b97ccdcd8bb382a98eaafd466d7053 100644 (file)
@@ -251,7 +251,8 @@ void TizenRendererImpl::Initialize(media::MediaResource* media_resource,
       media_player_->SetMultiVideo(true);
       // Only need reload the first video when the first video not use mixer,
       // but the second use the mixer
-      if (cur_player_count == 2 && pre_player_count == 1)
+      if ((cur_player_count == 2 && pre_player_count == 1) ||
+          (cur_player_count == 3 && pre_player_count == 2))
         PreVideoReload(cur_player_count, player_id_);
     }
   }
@@ -571,7 +572,9 @@ void TizenRendererImpl::PreVideoReload(int count, int player_id) {
     int pre_player_id = pair.first;
     auto pre_player = media::MediaPlayerRegistry::GetInstance()->GetMediaPlayer(
         pre_player_id);
-    if (pre_player_id != player_id && !pre_player->IsMultiVideo()) {
+    if (pre_player_id != player_id &&
+        ((count == 2 && !pre_player->IsMultiVideo()) ||
+        (count == 3 && pre_player->IsMultiVideo()))) {
       LOG(INFO) << "(" << static_cast<void*>(this)
                 << ") [MIXER] Need reload the first video "
                 << "pre_player_id :" << pre_player_id
index a2b9a55e8ff7cadc71f2a9e08c82e75a6d42e53c..2281a99087356211889367a3d9c47ea35009cb37 100644 (file)
@@ -267,6 +267,23 @@ void MediaPlayerBridgeCapiTV::Prepare() {
 #else
     LOG_ID(INFO, GetPlayerId()) << "support 4 videos at least 7.0";
 #endif
+  } else if (GetScalerCount() >= 2 && total_player_counts_ == 2) {
+    LOG_ID(INFO, GetPlayerId()) << " this: " << this << ", using multiple scalers";
+    if (scaler_state_[SCALER_MAIN] == NOT_USED) {
+      scaler_state_[SCALER_MAIN] = IN_USED;
+      scaler_type_ = PLAYER_SCALER_MAIN;
+      LOG_ID(INFO, GetPlayerId()) << " this: " << this << ",PLAYER_SCALER_MAIN";
+      player_set_audio_codec_type(player_, PLAYER_CODEC_TYPE_HW);
+    } else if (scaler_state_[SCALER_SUB] == NOT_USED) {
+      scaler_state_[SCALER_SUB] = IN_USED;
+      scaler_type_ = PLAYER_SCALER_SUB;
+      player_set_audio_codec_type(player_, PLAYER_CODEC_TYPE_SW);
+      LOG_ID(INFO, GetPlayerId()) << " this: " << this << ",PLAYER_SCALER_SUB";
+    }
+    player_set_fixed_video_scaler(player_, scaler_type_);
+
+    if (scaler_type_ != PLAYER_SCALER_MAIN)
+      player_deactivate_stream(player_, PLAYER_STREAM_TYPE_AUDIO);
   }
   // 2.  LFD TV mixer mode:  3 mixer decoder + 1 dvde1 decoder
   else if (IsMultiVideo()) {
@@ -531,6 +548,11 @@ void MediaPlayerBridgeCapiTV::Release() {
 
     if (mixer_player_active_audio_ == player_)
       mixer_player_active_audio_ = 0;
+
+    // LFD the first 3 videos are in mixer mode,no blackscreen when switch
+    // the 4th video is not in mixer mode, it not set PLAYER_STILL_MODE_ON
+    // it will be blackscreen when switch from video3 to video4
+    player_set_video_still(player_, PLAYER_STILL_MODE_ON);
   }
 }