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_);
}
}
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
#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()) {
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);
}
}