[MM] Support 4 videos 07/320707/2
authorwuxiaoliang <xliang.wu@samsung.com>
Thu, 21 Nov 2024 06:06:10 +0000 (14:06 +0800)
committerBot Blink <blinkbot@samsung.com>
Mon, 25 Nov 2024 02:36:43 +0000 (02:36 +0000)
1. Mixer mode:  3 mixer + 1 dvde1
2. 4 scalers

Change-Id: I53fc052efee0f385faedb9da38023427f800d574
Signed-off-by: wuxiaoliang <xliang.wu@samsung.com>
tizen_src/chromium_impl/content/browser/media/tizen_renderer_impl.cc
tizen_src/chromium_impl/media/base/efl/media_player_util_efl.cc
tizen_src/chromium_impl/media/base/efl/media_player_util_efl.h
tizen_src/chromium_impl/media/base/tizen/video_plane_controller_capi.cc
tizen_src/chromium_impl/media/base/tizen/video_plane_controller_capi.h
tizen_src/chromium_impl/media/filters/media_capabilities.cc
tizen_src/chromium_impl/media/filters/media_player_bridge_capi.cc
tizen_src/chromium_impl/media/filters/media_player_bridge_capi.h
tizen_src/chromium_impl/media/filters/media_player_bridge_capi_tv.cc
tizen_src/chromium_impl/media/filters/media_player_bridge_capi_tv.h

index baf422fb33ad384c9ed7846b6bbc9720ddaf8a70..34414e9db36c3971d1fd461b1e85fb3df2b33360 100644 (file)
@@ -29,6 +29,7 @@
 
 #if BUILDFLAG(IS_TIZEN_TV)
 #include "ewk/efl_integration/common/application_type.h"
+#include "media/base/efl/media_player_util_efl.h"
 #include "tizen_src/chromium_impl/tizen/tizen_tv_platform.h"
 #endif
 
@@ -172,6 +173,12 @@ void TizenRendererImpl::Initialize(media::MediaResource* media_resource,
       (media_resource->GetType() == media::MediaResource::Type::KUrl)) {
     pre_player_count =
         media::MediaPlayerRegistry::GetInstance()->GetMediaPlayers().size();
+
+    if (media::GetScalerCount() >= 4) {
+      LOG(INFO) << "(" << static_cast<void*>(this)
+                << ")  tv support 4 scaler, disable mixer mode";
+      disable_mixer_mode_ = true;
+    }
   }
 #endif
 
index ed124dc6852109fbc816ce35c8eebfb752ade37d..385634d1b4cc221a2c0ab02abafbf1dfffa87a26 100644 (file)
@@ -10,6 +10,7 @@
 
 #if BUILDFLAG(IS_TIZEN_TV)
 #include <player_product.h>
+#include <tv-resource-manager/rm_resource.h>
 #endif
 
 #include <device/power.h>
@@ -403,4 +404,22 @@ int PlayerSetPlayPosition(player_h player,
 #endif
 }
 
+int GetScalerCount() {
+#if BUILDFLAG(IS_TIZEN_TV)
+  int count = 0;
+  rm_resource_list_h list;
+  if (rm_get_resource_list(RM_CATEGORY_SCALER_PROGRESSIVE, &list) != RM_OK) {
+    LOG(INFO) << "rm_get_resource_list failed";
+    return count;
+  }
+
+  count = rm_resource_list_get_count(list);
+  LOG(INFO) << "rm_resource_list_get_count:" << count;
+  rm_free_resource_list(list);
+  return count;
+#else
+  return 1;
+#endif
+}
+
 }  // namespace media
index ac73011d5c3c99e07a43e6605f217a3d8324dde3..8fb1aeed6284a2e01fb777b1d9229d42ad608d7f 100644 (file)
@@ -69,6 +69,7 @@ int PlayerSetPlayPosition(player_h player,
                           bool accurate,
                           player_seek_completed_cb callback,
                           void* user_data);
+int GetScalerCount();
 
 }  // namespace media
 
index 2ed228083c9f377d3c0d9c32403bf7bbb9dee047..6340c3eee08c79fbe501cb2690d650ab78de941b 100644 (file)
 
 namespace media {
 
-VideoPlaneControllerCapi::VideoPlaneControllerCapi(player_h player)
-    : player_handle_(player) {}
+VideoPlaneControllerCapi::VideoPlaneControllerCapi(
+    MediaPlayerBridgeCapi* player)
+    : player_(player) {}
 
 VideoPlaneControllerCapi::~VideoPlaneControllerCapi() {}
 
 int VideoPlaneControllerCapi::Initialize() {
   int ret = PLAYER_ERROR_NONE;
 #if BUILDFLAG(IS_TIZEN_TV)
-  ret = player_set_display_mode(player_handle_, PLAYER_DISPLAY_MODE_DST_ROI);
+  if (!player_) {
+    LOG(INFO) << "player is destroyed";
+    return PLAYER_ERROR_INVALID_OPERATION;
+  }
+  player_h player_handle = player_->GetPlayerHandle();
+
+  ret = player_set_display_mode(player_handle, PLAYER_DISPLAY_MODE_DST_ROI);
 
   if (ret != PLAYER_ERROR_NONE)
     return ret;
@@ -44,13 +51,20 @@ int VideoPlaneControllerCapi::Initialize() {
 int VideoPlaneControllerCapi::SetVideoRect(const gfx::RectF& rect) {
   int ret = PLAYER_ERROR_NONE;
 #if BUILDFLAG(IS_TIZEN_TV)
-  ret = player_set_display_roi_area(player_handle_, rect.x(), rect.y(),
+  if (!player_) {
+    LOG(INFO) << "player is destroyed";
+    return PLAYER_ERROR_INVALID_OPERATION;
+  }
+  player_h player_handle = player_->GetPlayerHandle();
+
+  ret = player_set_display_roi_area(player_handle, rect.x(), rect.y(),
                                     rect.width(), rect.height());
-  if (is_multi_video_) {
+  if (is_multi_video_ && !player_->Is4thVideo()) {
     int mix_ret = player_video_mixer_set_displayarea(
-        player_handle_, 0, 0, rect.x(), rect.y(), rect.width(), rect.height());
+        player_handle, 0, 0, rect.x(), rect.y(), rect.width(), rect.height());
     LOG(INFO) << "[MIXER] mixer_displayarea : (" << rect.x() << ", " << rect.y()
-              << ", " << rect.width() << ", " << rect.height() << ")";
+              << ", " << rect.width() << ", " << rect.height() << ")"
+              << ", player id:" << player_->GetPlayerId();
     if (mix_ret != PLAYER_ERROR_NONE)
       LOG(ERROR) << "[MIXER] player_video_mixer_set_displayarea, ret ="
                  << mix_ret;
@@ -62,10 +76,17 @@ int VideoPlaneControllerCapi::SetVideoRect(const gfx::RectF& rect) {
 int VideoPlaneControllerCapi::PlayerSetCropRatio(const gfx::RectF& rect) {
   int ret = PLAYER_ERROR_NONE;
 #if BUILDFLAG(IS_TIZEN_TV)
+  if (!player_) {
+    LOG(INFO) << "player is destroyed";
+    return PLAYER_ERROR_INVALID_OPERATION;
+  }
+  player_h player_handle = player_->GetPlayerHandle();
+
   LOG(INFO) << "crop_ratio : (" << rect.x() << ", " << rect.y() << ", "
-            << rect.width() << ", " << rect.height() << ")";
+            << rect.width() << ", " << rect.height() << ")"
+            << ", player id:" << player_->GetPlayerId();
 
-  ret = player_set_crop_ratio(player_handle_, rect.x(), rect.y(), rect.width(),
+  ret = player_set_crop_ratio(player_handle, rect.x(), rect.y(), rect.width(),
                               rect.height());
 #endif
   return ret;
@@ -73,7 +94,12 @@ int VideoPlaneControllerCapi::PlayerSetCropRatio(const gfx::RectF& rect) {
 
 player_state_e VideoPlaneControllerCapi::GetPlayerState() {
   player_state_e state = PLAYER_STATE_NONE;
-  player_get_state(player_handle_, &state);
+  if (!player_) {
+    LOG(INFO) << "player is destroyed";
+    return state;
+  }
+  player_h player_handle = player_->GetPlayerHandle();
+  player_get_state(player_handle, &state);
   return state;
 }
 
@@ -82,27 +108,34 @@ bool VideoPlaneControllerCapi::IsAvailableSetMediaGeometry() {
 }
 
 void VideoPlaneControllerCapi::SetDisplayRotation(int rotation_degree) {
+  if (!player_) {
+    LOG(INFO) << "player is destroyed";
+    return;
+  }
+  player_h player_handle = player_->GetPlayerHandle();
+
   int ret = PLAYER_ERROR_NONE;
   player_display_rotation_e screen_rotation =
       static_cast<player_display_rotation_e>(
           ConvertToPlayerDisplayRotation(rotation_degree));
 #if BUILDFLAG(IS_TIZEN_TV)
-  if (is_multi_video_) {
+  if (is_multi_video_ && !player_->Is4thVideo()) {
     LOG(INFO) << "[MIXER] this: " << this << ", rotation : " << rotation_degree
-              << ", video rotate angle : " << screen_rotation;
+              << ", video rotate angle : " << screen_rotation
+              << ", player id:" << player_->GetPlayerId();
 
     player_video_mixer_set_position_of_mixedframe(
-        player_handle_, DEPRECATED_PARAM, 0, 0, MIXER_SCREEN_WIDTH,
+        player_handle, DEPRECATED_PARAM, 0, 0, MIXER_SCREEN_WIDTH,
         MIXER_SCREEN_HEIGHT);
 
     if (screen_rotation == PLAYER_DISPLAY_ROTATION_90 ||
         screen_rotation == PLAYER_DISPLAY_ROTATION_270) {
       ret = player_video_mixer_set_resolution_of_mixedframe(
-          player_handle_, DEPRECATED_PARAM, MIXER_SCREEN_HEIGHT,
+          player_handle, DEPRECATED_PARAM, MIXER_SCREEN_HEIGHT,
           MIXER_SCREEN_WIDTH);
     } else {
       ret = player_video_mixer_set_resolution_of_mixedframe(
-          player_handle_, DEPRECATED_PARAM, MIXER_SCREEN_WIDTH,
+          player_handle, DEPRECATED_PARAM, MIXER_SCREEN_WIDTH,
           MIXER_SCREEN_HEIGHT);
     }
     if (ret != PLAYER_ERROR_NONE) {
@@ -114,15 +147,18 @@ void VideoPlaneControllerCapi::SetDisplayRotation(int rotation_degree) {
 #endif
 
   player_display_rotation_e rotation = PLAYER_DISPLAY_ROTATION_NONE;
-  ret = player_get_display_rotation(player_handle_, &rotation);
+  ret = player_get_display_rotation(player_handle, &rotation);
+  LOG(INFO) << "player_get_display_rotation:" << rotation
+            << ", player id:" << player_->GetPlayerId();
+
   if (ret == PLAYER_ERROR_NONE && screen_rotation != rotation) {
     LOG(INFO) << "current player rotate angle : " << rotation
               << " , video should rotate angle : " << screen_rotation;
 
 #if BUILDFLAG(IS_TIZEN_TV)
-    if (is_multi_video_) {
+    if (is_multi_video_ && !player_->Is4thVideo()) {
       ret = player_video_mixer_set_rotation_degree_of_mixedframe(
-          player_handle_, 0, screen_rotation);
+          player_handle, 0, screen_rotation);
       if (ret != PLAYER_ERROR_NONE) {
         LOG(ERROR) << "[MIXER] "
                       "player_video_mixer_set_rotation_degree_of_mixedframe, "
@@ -133,11 +169,10 @@ void VideoPlaneControllerCapi::SetDisplayRotation(int rotation_degree) {
 #endif
     {
       LOG(INFO) << "Display rotation sets with " << screen_rotation;
-      ret = player_set_display_rotation(player_handle_, screen_rotation);
-      if (ret != PLAYER_ERROR_NONE) {
+      ret = player_set_display_rotation(player_handle, screen_rotation);
+      if (ret != PLAYER_ERROR_NONE)
         LOG(ERROR) << "Cannot set display rotation : "
                    << GetErrorString(static_cast<player_error_e>(ret));
-      }
     }
   }
 }
@@ -151,23 +186,14 @@ void VideoPlaneControllerCapi::SetDisplayRotation() {
 }
 
 int VideoPlaneControllerCapi::ConvertToPlayerDisplayRotation(int rotation) {
-#if BUILDFLAG(IS_TIZEN_TV)
-  bool video_counter_rotation = false;
-  if (!is_multi_video_) {
-    video_counter_rotation = true;
-  }
-#endif
-
   switch (rotation) {
 #if BUILDFLAG(IS_TIZEN_TV)
     case 90:
-      return video_counter_rotation ? PLAYER_DISPLAY_ROTATION_270
-                                    : PLAYER_DISPLAY_ROTATION_90;
+      return PLAYER_DISPLAY_ROTATION_270;
     case 180:
       return PLAYER_DISPLAY_ROTATION_180;
     case 270:
-      return video_counter_rotation ? PLAYER_DISPLAY_ROTATION_90
-                                    : PLAYER_DISPLAY_ROTATION_270;
+      return PLAYER_DISPLAY_ROTATION_90;
 #else
     case 90:
       return PLAYER_DISPLAY_ROTATION_90;
index b9c0baaa8d9a8d10c16fca41678a62e50f7831ab..4d19f525f3e5ac87b33497e65794b3b6b3fd13b4 100644 (file)
 #pragma GCC diagnostic pop
 
 #include "media/base/tizen/video_plane_controller.h"
+#include "tizen_src/chromium_impl/media/filters/media_player_bridge_capi.h"
 
 namespace media {
 
 class MEDIA_EXPORT VideoPlaneControllerCapi : public VideoPlaneController {
  public:
-  VideoPlaneControllerCapi(player_h player);
+  VideoPlaneControllerCapi(MediaPlayerBridgeCapi* player);
 
   ~VideoPlaneControllerCapi() override;
 
@@ -41,7 +42,7 @@ class MEDIA_EXPORT VideoPlaneControllerCapi : public VideoPlaneController {
   bool is_multi_video_{false};
 #endif
 
-  player_h player_handle_;
+  MediaPlayerBridgeCapi* player_;
 };
 
 }  // namespace media
index 4e6f7ce33f5eb62a38f4bd6b24772af8d2900998..ad14a9aa5dbc118e041f42265463bd65a5f19b2f 100644 (file)
@@ -45,7 +45,10 @@ std::size_t TVMaxCount(MediaType type) {
     // browser support 1 video and 1 audio at most.
     // Reason : browser cannot support mixer mode, scroll function
     // has some issue when browser in mixer mode(video shows issue).
-    count = 3;
+
+    // 2024 new requirement to support lfd 4 videos,3 mixer+1 dvde1
+    // or rosep 4 UHD
+    count = 4;
   } else if (MediaType::Video == type && IsDualDecodingSupported()) {
     count = 2;
   } else if (media::IsMultiPlayerSupported()) {
index a7bd1a446309e69900f266457a96673b2483806d..af83f356c0ccfed4823ffd51f632401d1de4f312 100644 (file)
@@ -610,7 +610,7 @@ void MediaPlayerBridgeCapi::SetVideoHole(bool is_video_hole) {
                            << __func__ << " is_video_hole : " << is_video_hole;
   is_video_hole_ = is_video_hole;
   if (is_video_hole_ && player_ && !video_plane_controller_) {
-    video_plane_controller_.reset(new VideoPlaneControllerCapi(player_));
+    video_plane_controller_.reset(new VideoPlaneControllerCapi(this));
   }
 }
 
index a8b74a12c44e4bd026c0f3093f03b231bd6a08e8..17497cb7521009e6be378821ccfd4ca8172d95f8 100644 (file)
@@ -116,6 +116,8 @@ class MEDIA_EXPORT MediaPlayerBridgeCapi : public MediaPlayerTizen {
 
   bool IsMultiVideo() const override { return false; };
   void SetMultiVideo(bool is_multi_video) override{};
+  player_h GetPlayerHandle() { return player_; }
+  virtual bool Is4thVideo() { return false; }
 
 #if defined(TIZEN_VIDEO_HOLE)
   void SetVideoHole(bool is_video_hole) override;
index 66c3e4f636ed519b9f62a7a5e2efebb343bb3e08..1596d4198165df123e62c484eaf090ee5dc99298 100644 (file)
@@ -154,7 +154,10 @@ player_h MediaPlayerBridgeCapiTV::mixer_player_group_[kMaxPlayerMixerNum] = {
 player_h MediaPlayerBridgeCapiTV::mixer_player_active_audio_ = 0;
 int MediaPlayerBridgeCapiTV::mixer_player_counts_ = 0;
 int MediaPlayerBridgeCapiTV::total_player_counts_ = 0;
-int MediaPlayerBridgeCapiTV::mixer_decoder_hw_state_[2] = {NOT_USED, NOT_USED};
+int MediaPlayerBridgeCapiTV::mixer_decoder_state_[3] = {NOT_USED, NOT_USED,
+                                                        NOT_USED};
+int MediaPlayerBridgeCapiTV::scaler_state_[4] = {NOT_USED, NOT_USED, NOT_USED,
+                                                 NOT_USED};
 
 MediaPlayerBridgeCapiTV::MediaPlayerBridgeCapiTV(const GURL& url,
                                                  const std::string& user_agent,
@@ -267,38 +270,79 @@ void MediaPlayerBridgeCapiTV::Prepare() {
     Resume();
     return;
   }
+  // the are 2 method to support 4 videos play
+  // 1. 4 scaler(24 rosep)
+  if (GetScalerCount() >= 4 && !GetTransparent()) {
+    if (scaler_state_[SCALER_MAIN] == NOT_USED) {
+      scaler_state_[SCALER_MAIN] = IN_USED;
+      scaler_type_ = PLAYER_SCALER_MAIN;
+      LOG_ID(INFO, player_id_) << " this: " << this << ",PLAYER_SCALER_MAIN";
+    } else if (scaler_state_[SCALER_SUB] == NOT_USED) {
+      scaler_state_[SCALER_SUB] = IN_USED;
+      scaler_type_ = PLAYER_SCALER_SUB;
+      LOG_ID(INFO, player_id_) << " this: " << this << ",PLAYER_SCALER_SUB";
+    } else if (scaler_state_[SCALER_SUB2] == NOT_USED) {
+      scaler_state_[SCALER_SUB2] = IN_USED;
+      scaler_type_ = PLAYER_SCALER_SUB2;
+      LOG_ID(INFO, player_id_) << " this: " << this << ",PLAYER_SCALER_SUB2";
+    } else if (scaler_state_[SCALER_SUB3] == NOT_USED) {
+      scaler_state_[SCALER_SUB3] = IN_USED;
+      scaler_type_ = PLAYER_SCALER_SUB3;
+      LOG_ID(INFO, player_id_) << " this: " << this << ",PLAYER_SCALER_SUB3";
+    }
+    player_set_fixed_video_scaler(player_, scaler_type_);
 
-  // LFD TV mixer mode
-  if (IsMultiVideo()) {
+    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()) {
     SetMultiVideoState();
 #if defined(TIZEN_VIDEO_HOLE)
     if (is_video_hole_) {
-      video_plane_controller_->SetDisplayRotation();
       video_plane_controller_->SetMultiVideo(true);
+      video_plane_controller_->SetDisplayRotation();
     }
 #endif
-    LOG_ID(INFO, GetPlayerId())
-        << "[MIXER] this: " << this << ",mixer mode prepare "
-        << ", type :" << mixer_decoder_type_;
-    if (HW_MAIN == mixer_decoder_type_) {
-      ret = player_video_mixer_open(player_, PLAYER_MIXER_DECODER_HW_MAIN);
-    } else if (HW_SUB == mixer_decoder_type_) {
-      ret = player_video_mixer_open(player_, PLAYER_MIXER_DECODER_HW_SUB);
-    } else {
-      ret = player_video_mixer_open(player_, PLAYER_MIXER_DECODER_SW);
-    }
 
-    if (ret != PLAYER_ERROR_NONE)
-      LOG_ID(ERROR, GetPlayerId())
-          << "[MIXER] Mixer open deocder fail,ret:" << ret
-          << " , type :" << mixer_decoder_type_;
-    else {
-      mixer_player_counts_++;
-      is_player_mixer_opened_ = true;
+    if (is_4th_video_) {
+      // when the 4th video comes, it use dvde1 decoder and it didn't support
+      // mixer mode
       LOG_ID(INFO, GetPlayerId())
-          << "[MIXER] mixer mode open , mixer_player_counts_ :"
-          << mixer_player_counts_
-          << " ; is_player_mixer_opened_ : " << is_player_mixer_opened_;
+          << "the 4th video use dvde1 decoder,this:" << (void*)this;
+      ret = player_set_fixed_video_scaler(player_, PLAYER_SCALER_SUB);
+      if (ret != PLAYER_ERROR_NONE)
+        LOG_ID(ERROR, GetPlayerId())
+            << "|player_set_fixed_video_scaler| failed";
+      ret = player_set_fixed_video_decoder(
+          player_, PLAYER_VIDEO_DECODER_DEDICATE_TRIPLE);
+      if (ret != PLAYER_ERROR_NONE)
+        LOG_ID(ERROR, GetPlayerId())
+            << "|player_set_fixed_video_decoder| failed";
+    } else {
+      LOG_ID(INFO, GetPlayerId())
+          << "[MIXER] this: " << this << ",mixer mode prepare "
+          << ", type :" << mixer_decoder_type_;
+      if (HW_MAIN == mixer_decoder_type_) {
+        ret = player_video_mixer_open(player_, PLAYER_MIXER_DECODER_HW_MAIN);
+      } else if (HW_SUB == mixer_decoder_type_) {
+        ret = player_video_mixer_open(player_, PLAYER_MIXER_DECODER_HW_SUB);
+      } else {
+        ret = player_video_mixer_open(player_, PLAYER_MIXER_DECODER_SW);
+      }
+
+      if (ret != PLAYER_ERROR_NONE)
+        LOG_ID(ERROR, GetPlayerId())
+            << "[MIXER] Mixer open deocder fail,ret:" << ret
+            << " , type :" << mixer_decoder_type_;
+      else {
+        mixer_player_counts_++;
+        is_player_mixer_opened_ = true;
+        LOG_ID(INFO, GetPlayerId())
+            << "[MIXER] mixer mode open , mixer_player_counts_ :"
+            << mixer_player_counts_
+            << " ; is_player_mixer_opened_ : " << is_player_mixer_opened_;
+      }
     }
     player_deactivate_stream(player_, PLAYER_STREAM_TYPE_AUDIO);
   }
@@ -504,13 +548,24 @@ void MediaPlayerBridgeCapiTV::Release() {
   player_unset_pes_cb(player_, -999);
 #endif
 
-  if (IsMultiVideo()) {
+  if (GetScalerCount() >= 4 && !GetTransparent()) {
+    if (scaler_type_ == PLAYER_SCALER_MAIN)
+      scaler_state_[SCALER_MAIN] = NOT_USED;
+    else if (scaler_type_ == PLAYER_SCALER_SUB)
+      scaler_state_[SCALER_SUB] = NOT_USED;
+    else if (scaler_type_ == PLAYER_SCALER_SUB2)
+      scaler_state_[SCALER_SUB2] = NOT_USED;
+    else if (scaler_type_ == PLAYER_SCALER_SUB3)
+      scaler_state_[SCALER_SUB3] = NOT_USED;
+  } else if (IsMultiVideo()) {
     if (player_)
       mixer_player_group_[player_index_] = 0;
     if (HW_MAIN == mixer_decoder_type_)
-      mixer_decoder_hw_state_[HW_MAIN] = NOT_USED;
+      mixer_decoder_state_[HW_MAIN] = NOT_USED;
     else if (HW_SUB == mixer_decoder_type_)
-      mixer_decoder_hw_state_[HW_SUB] = NOT_USED;
+      mixer_decoder_state_[HW_SUB] = NOT_USED;
+    else if (SW == mixer_decoder_type_)
+      mixer_decoder_state_[SW] = NOT_USED;
 
     if (mixer_player_active_audio_ == player_)
       mixer_player_active_audio_ = 0;
@@ -3564,17 +3619,21 @@ void MediaPlayerBridgeCapiTV::SetMultiVideoState() {
     }
   }
   // Video Mixer decoder type selector
-  if (mixer_decoder_hw_state_[HW_MAIN] == NOT_USED) {
-    mixer_decoder_hw_state_[HW_MAIN] = IN_USED;
+  if (mixer_decoder_state_[HW_MAIN] == NOT_USED) {
+    mixer_decoder_state_[HW_MAIN] = IN_USED;
     mixer_decoder_type_ = HW_MAIN;
     LOG_ID(INFO, GetPlayerId()) << "[MIXER] Video mixer decoder type: HW-MAIN";
-  } else if (mixer_decoder_hw_state_[HW_SUB] == NOT_USED) {
-    mixer_decoder_hw_state_[HW_SUB] = IN_USED;
+  } else if (mixer_decoder_state_[HW_SUB] == NOT_USED) {
+    mixer_decoder_state_[HW_SUB] = IN_USED;
     mixer_decoder_type_ = HW_SUB;
     LOG_ID(INFO, GetPlayerId()) << "[MIXER] Video mixer decoder type: HW-SUB";
-  } else {
+  } else if (mixer_decoder_state_[SW] == NOT_USED) {
+    mixer_decoder_state_[SW] = IN_USED;
     mixer_decoder_type_ = SW;
     LOG_ID(INFO, GetPlayerId()) << "[MIXER] Video mixer decoder type: SW";
+  } else {
+    LOG_ID(INFO, GetPlayerId()) << "the 4th video will use dvde1 decoder";
+    is_4th_video_ = true;
   }
 }
 
index 625acbb992e3b83a3a4de7abdea056d40fd064fd..ae83bdf686b8419ded1c1907a4d854fb57fada89 100644 (file)
@@ -53,6 +53,13 @@ enum MixerDecoderType {
   SW,
 };
 
+enum ScalerType {
+  SCALER_MAIN = 0,
+  SCALER_SUB,
+  SCALER_SUB2,
+  SCALER_SUB3,
+};
+
 enum InitDataError {
   ERROR_NONE = 0,
   NOT_CENC_DATA,
@@ -200,6 +207,7 @@ class MEDIA_EXPORT MediaPlayerBridgeCapiTV : public MediaPlayerBridgeCapi {
   void ActivateCurrentStream(player_stream_type_e stream_type);
   bool IsMultiVideo() const override;
   void SetMultiVideo(bool is_multi_video) override;
+  bool Is4thVideo() override { return is_4th_video_; }
 
 #if defined(TIZEN_VD_NGA)
   void OnAudioPreselectionInfo(
@@ -366,13 +374,16 @@ class MEDIA_EXPORT MediaPlayerBridgeCapiTV : public MediaPlayerBridgeCapi {
   // LFD TV mixer mode
   bool is_multi_video_{false};
   bool is_player_mixer_opened_{false};
+  bool is_4th_video_{false};
   int player_index_{0};
   int mixer_decoder_type_{-1};
   static player_h mixer_player_group_[kMaxPlayerMixerNum];
-  static int mixer_decoder_hw_state_[2];
+  static int mixer_decoder_state_[3];
   static int mixer_player_counts_;
   static int total_player_counts_;
   static player_h mixer_player_active_audio_;
+  player_scaler_type_e scaler_type_;
+  static int scaler_state_[4];
 
 #if defined(TIZEN_VD_NGA)
   std::vector<AudioPreselectionInfos> audio_preselection_infos_;