[HbbTV] Fix resource conflict when selecting video decoder during a mid-roll ad insertion 18/314518/6
authorJan Prusakowski <jan.prus@samsung.com>
Wed, 3 Jul 2024 07:47:36 +0000 (09:47 +0200)
committerj.gajownik2 <j.gajownik2@samsung.com>
Sat, 13 Jul 2024 19:24:47 +0000 (21:24 +0200)
    [Problem]
    During a mid-roll ad insertion the sub-decoder allocation conflicts with main
    decoder. Additionally during the second ad insertion the ad steals the main
    decoder from the main content.

    [Cause]
    Using UHD main video decoder on KantSU2e disables dual video decoding.
    Relying on last_used_decoder_ causes the 2nd ad to take the main decoder.

    [Solution]
    Only request UHD decoder when video resolution is greater than full HD.
    Use a free decoder for next playback (ignore last_used_decoder_).

Bug: https://jira-eu.sec.samsung.net/browse/VDSPD2CA-1191
Signed-off-by: Jan Prusakowski <jan.prus@samsung.com>
Change-Id: I70c4bfda96291aede363b6916df2e205238bb1d0

tizen_src/chromium_impl/media/filters/hardware_resource_helper.cc
tizen_src/chromium_impl/media/filters/media_player_bridge_capi_tv.cc

index 6a53089993b8e74f5b7ce79aa7d82cb63492bf1d..a06da314b17086a8a55d6a2c1930d294363bbf6a 100644 (file)
@@ -182,17 +182,13 @@ DecoderStatePtr HardwareResourceHelper::GetSuitableResource(
         if(!broadcast_in_use)
           broadcast_in_use = state->GetDecoderType(kDecoders) == broadcast_decoder_;
 
-        // Below condition is used to handle most common scenarios for dual
-        // decoding.
+        // Below condition is used to handle the following scenarios for dual
+        // decoding:
         // 1: Skip decoder that is already used
         // 2: Load ad in background, when broadcast is playing. Skip decoder
         //    used by broadcast
-        // 3: Fast switch between two html players, without broadcast. Use
-        //    different decoders for each player.
         if (state->IsAcquired() ||
-            state->GetDecoderType(kDecoders) == broadcast_decoder_ ||
-            ((broadcast_decoder_ & kDecoders) == kNoneDecoder &&
-             state->GetDecoderType(kDecoders) == last_used_decoder_)) {
+            state->GetDecoderType(kDecoders) == broadcast_decoder_) {
           continue;
         }
         LOG(INFO) << "Previous last used decoder "
index f855a7b3d1149524c15150d8a68591af10d7450d..2df60dcacf71e1993a12b065ad0839d6d800d270 100644 (file)
@@ -1314,7 +1314,10 @@ bool MediaPlayerBridgeCapiTV::ChooseDecoder() {
     } else if ((dec_name & content::kDecoders) == content::kMainDecoder) {
       LOG_ID(INFO, GetPlayerId()) << "MAIN decoder is used for this " << this;
       player_set_fixed_video_decoder(player_, PLAYER_VIDEO_DECODER_MAIN);
-      if ((dec_name & content::kResolutions) == content::kUHDDecoder)
+      // Allocating a UHD decoder precludes dual video decoding on KantSU2e -
+      // request it only if the content resolution is greater than full HD.
+      if ((dec_name & content::kResolutions) == content::kUHDDecoder &&
+        height > kFHDVideoMaxHeight)
         player_set_ini_param(player_, "use uhd video decoder = yes");
       else
         player_set_ini_param(player_, "use uhd video decoder = no");