#include "tizen_src/chromium_impl/media/filters/media_player_esplusplayer_tv.h"
#include "base/command_line.h"
+#include "base/time/time.h"
#include "base/trace_event/trace_event.h"
#include "content/public/common/content_switches.h"
#include "media/base/audio_codecs.h"
#include "media/base/decoder_buffer.h"
#include "media/base/renderer_client.h"
#include "media/filters/esplusplayer_util.h"
+#include "media/filters/hardware_resource_types.h"
+#include "third_party/blink/public/platform/web_application_type.h"
#include "tizen/system_info.h"
#include "tizen_src/chromium_impl/media/filters/media_player_tizen_client.h"
#define TIMELINESTATE 3
#define TIMELINEPAUSED true
+namespace {
+
+std::pair<uint32_t, uint32_t> GetHBBTvTAResolution(uint32_t width,
+ uint32_t height) {
+ // NOTE: HBBTV TA requires to play two videos on two different scalers at the
+ // same time. To achive this behavior we limit maximal resolution to
+ // the value which always allow two HW decoder playbacks.
+ return {std::min(static_cast<uint32_t>(kFHDVideoMaxWidth), width),
+ std::min(static_cast<uint32_t>(kFHDVideoMaxHeight), height)};
+}
+
// malloc_trim(0) will be called every 2 minutes.
const base::TimeDelta kMallocTrimInterval = base::TimeDelta::FromSeconds(120);
+
+// Only for HBBTV TA
+// Estimated pulling ZOrder interval time, to proceed a fastswitch.
+const base::TimeDelta kHbbTVZorderCheckInterval = base::Milliseconds(500);
+} // namespace
+
namespace media {
// Limit of platform player's total (audio and video) buffer size
bool MediaPlayerESPlusPlayerTV::Play() {
LOG_ID(INFO, player_id_) << "(" << static_cast<void*>(this) << ") "
<< __func__;
+
+ if (!IsInitialized()) {
+ LOG_ID(ERROR, GetPlayerId()) << "Player not initialized!";
+ return false;
+ }
+
auto td_ptr = suitable_decoder_.lock();
auto dec_name = content::kNoneDecoder;
- if (td_ptr) {
- dec_name = td_ptr->GetDecoderType();
- SetDecoderAcquired(td_ptr->GetDecoderType());
- }
- if (GetMediaPlayerClient()) {
- bool media_resource_acquired = false;
- GetMediaPlayerClient()->NotifyPlaybackState(kPlaybackStart, player_id_, "",
- "", &media_resource_acquired,
- NULL, NULL, dec_name);
- if (blink::IsHbbTV() && !media_resource_acquired) {
- LOG_ID(ERROR, player_id_) << "HbbTV failed to allocate media resources";
+ if (td_ptr || !(GetMediaType() & MediaType::Video) ||
+ !content::HardwareResourceHelper::Get().IsDualDecoding()) {
+ if (td_ptr) {
+ dec_name = td_ptr->GetDecoderType();
+ }
+ if (blink::IsHbbTV() && CanPrepare()) {
+ if (DemuxerStream* stream =
+ GetDemuxerStream(media::DemuxerStream::VIDEO)) {
+ VideoDecoderConfig video_config = stream->video_decoder_config();
+ ChooseDecoderIfNeeded(video_config.codec(), true /* ignore_conflict */);
+ MediaPlayerESPlusPlayer::Prepare();
+ MediaPlayerESPlusPlayer::Play();
+ return true;
+ }
+ }
+ if (!IsPrepared()) {
+ if (blink::IsHbbTV() && GetMediaPlayerClient()) {
+ bool media_resource_acquired = false;
+ GetMediaPlayerClient()->NotifyPlaybackState(
+ kPlaybackReady, GetPlayerId(), "", "", &media_resource_acquired,
+ NULL, NULL, dec_name);
+ if (!media_resource_acquired) {
+ LOG_ID(ERROR, GetPlayerId())
+ << "HbbTV media resource was not acquired";
+ return false;
+ }
+ }
+
+ if (td_ptr) {
+ SetDecoderAcquired(td_ptr->GetDecoderType());
+ if (td_ptr->RequiresBothDecoders()) {
+ SetDecoderAcquired(content::kSubDecoder);
+ }
+ }
+ MediaPlayerESPlusPlayer::Prepare();
+ MediaPlayerESPlusPlayer::Play();
+
return false;
}
}
}
ActivateAudioStreamIfNeeded();
+ if (GetMediaPlayerClient()) {
+ GetMediaPlayerClient()->NotifyPlaybackState(kPlaybackStart, player_id_, "",
+ "", NULL, NULL, NULL, dec_name);
+ GetMediaPlayerClient()->OnPlayerStarted(true);
+ }
+ StartMallocTrimTimer();
+
#if TIZEN_VERSION_AT_LEAST(8, 0, 0)
if (!SwitchAudioFocusIfNeeded()) {
LOG_ID(INFO, player_id_) << "switch audio focus failed";
return false;
}
#endif
+
return true;
}
void MediaPlayerESPlusPlayerTV::Prepare() {
LOG_ID(INFO, player_id_) << "(" << static_cast<void*>(this) << ") "
<< __func__;
+ if (!blink::IsHbbTV()) {
+ MediaPlayerESPlusPlayer::Prepare();
+ return;
+ }
- if (blink::IsHbbTV() && !decoder_assigned_) {
- DemuxerStream* stream = GetDemuxerStream(media::DemuxerStream::VIDEO);
- if (stream) {
- VideoDecoderConfig video_config = stream->video_decoder_config();
- ChooseDecoderIfNeeded(video_config.codec());
- if (auto td_ptr = suitable_decoder_.lock()) {
- decoder_assigned_ = true;
- }
+ DemuxerStream* stream = GetDemuxerStream(media::DemuxerStream::VIDEO);
+ if (stream) {
+ VideoDecoderConfig video_config = stream->video_decoder_config();
+ ChooseDecoderIfNeeded(video_config.codec());
+ }
+
+ if (IsHbbTvTaAllowed() && GetMediaPlayerClient()) {
+ GetMediaPlayerClient()->OnBufferingStateChange(
+ BUFFERING_HAVE_ENOUGH, BUFFERING_CHANGE_REASON_UNKNOWN);
+ }
+
+ bool has_suitable_decoder = suitable_decoder_.lock() != nullptr;
+ if (!stream && HasAudio()) {
+ // Support standalone audio.
+ decoder_conflict_ = IsHwAudioConflicted();
+ has_suitable_decoder = true;
+ }
+
+ if (has_suitable_decoder && !decoder_conflict_) {
+ MediaPlayerESPlusPlayer::Prepare();
+ } else {
+ LOG_ID(WARNING, player_id_)
+ << "Delaying |Prepare| to avoid resource conflict. "
+ << (has_suitable_decoder ? "Has" : "NO") << " suitable decoder. "
+ << (decoder_conflict_ ? "Decoder Conflict!" : "");
+ }
+
+ if (!stream || suitable_decoder_.lock() ||
+ content::HardwareResourceHelper::Get().IsDualDecoding()) {
+ return;
+ }
+
+ // No decoder - is dual decoding not available?
+ if (GetMediaPlayerClient()) {
+ bool media_resource_acquired = false;
+ auto dec_name = content::kNoneDecoder;
+ if (GetMediaType() & MediaType::Video)
+ dec_name = content::kMainDecoder;
+ GetMediaPlayerClient()->NotifyPlaybackState(
+ kPlaybackVideoReady, GetPlayerId(), "", "", &media_resource_acquired,
+ NULL, NULL, dec_name);
+ if (!media_resource_acquired) {
+ LOG_ID(INFO, GetPlayerId()) << "HbbTV media resource was not acquired";
+ MediaPlayerESPlusPlayer::OnError(ESPLUSPLAYER_ERROR_TYPE_UNKNOWN);
}
}
+}
+
+
+void MediaPlayerESPlusPlayerTV::PrepareToMediaSwitch() {
+ if (!IsHbbTvTaAllowed()) {
+ LOG_ID(ERROR, player_id_) << "HbbTV-TA is not allowed";
+ return;
+ }
+
+ LOG_ID(INFO, player_id_);
+ is_for_ta_ = true;
+
+ if (GetPlayerState() == ESPLUSPLAYER_STATE_NONE) {
+ LOG_ID(INFO, player_id_)
+ << "Initialization order was wrong, request resume.";
+ should_trigger_ta_zorder_checking_ = true;
+ GetMediaPlayerClient()->RequestResume();
+ return;
+ }
+
+ bool has_suitable_decoder = (suitable_decoder_.lock() != nullptr);
+ if (has_suitable_decoder && !decoder_conflict_ && !CanPrepare()) {
+ LOG_ID(INFO, player_id_)
+ << "Already prepared (or still preparing), continue.";
+ StartCheckingHbbTVZOrder();
+ return;
+ }
+
+ LOG_ID(INFO, player_id_) << "Not prepared, choose decoder again and prepare.";
+ DemuxerStream* stream = GetDemuxerStream(media::DemuxerStream::VIDEO);
+ if (stream) {
+ VideoDecoderConfig video_config = stream->video_decoder_config();
+ ChooseDecoderIfNeeded(video_config.codec(), true /* ignore_conflict */);
+ auto td_ptr = suitable_decoder_.lock();
+ if (!td_ptr) {
+ LOG_ID(ERROR, player_id_) << "No decoder assigned!";
+ return;
+ }
+ }
+
+ should_trigger_ta_zorder_checking_ = true;
MediaPlayerESPlusPlayer::Prepare();
}
+void MediaPlayerESPlusPlayerTV::RequestPlay() {
+ LOG_ID(INFO, player_id_) << "(" << static_cast<void*>(this) << ")";
+ if (!is_for_ta_) {
+ LOG_ID(ERROR, player_id_)
+ << "This method should be called for HbbTV-TA only";
+ return;
+ }
+
+ if (!GetMediaPlayerClient()) {
+ LOG_ID(ERROR, player_id_)
+ << "(" << static_cast<void*>(this) << ") No media player client";
+ return;
+ }
+ Play();
+ should_trigger_ta_zorder_checking_ = false;
+ StopCheckingHbbTVZOrder();
+ if (!is_ta_geometry_set_) {
+ // Setting geometry if prepare was significantly delayed.
+ is_ta_geometry_set_ = true;
+ GetMediaPlayerClient()->OnVideoRect(video_rect_);
+ }
+ ForceVideoOrder(VideoOrder::kOnTop);
+ GetMediaPlayerClient()->RequestPlay();
+}
+
+void MediaPlayerESPlusPlayerTV::RequestPause() {
+ LOG_ID(INFO, player_id_) << "(" << static_cast<void*>(this) << ")";
+ if (!is_for_ta_) {
+ LOG_ID(ERROR, player_id_)
+ << "This method should be called for HbbTV-TA only";
+ return;
+ }
+
+ if (!GetMediaPlayerClient()) {
+ LOG_ID(ERROR, player_id_)
+ << "(" << static_cast<void*>(this) << ") No media player client";
+ return;
+ }
+ GetMediaPlayerClient()->RequestPause();
+ ForceVideoOrder(VideoOrder::kOnBottom);
+}
+
+void MediaPlayerESPlusPlayerTV::SetVideoRect(const gfx::RectF& video_rect) {
+ LOG_ID(INFO, player_id_) << "(" << static_cast<void*>(this) << ")";
+ video_rect_ = video_rect;
+}
+
void MediaPlayerESPlusPlayerTV::Release() {
LOG_ID(INFO, player_id_) << "(" << static_cast<void*>(this) << ") "
<< __func__;
video_stream_info.framerate_den = 1;
}
+ if (is_for_ta_) {
+ std::tie(video_stream_info.max_width, video_stream_info.max_height) =
+ GetHBBTvTAResolution(video_stream_info.width, video_stream_info.height);
+ }
+
video_codec_ = video_config.codec();
if (hdr_info_.compare(video_config.hdr_info()) != 0) {
is_hdr_changed_ = true;
return;
}
- return MediaPlayerESPlusPlayer::OnPrepareComplete(result);
+ if (result && IsValid(DemuxerStream::VIDEO) &&
+ !ReadRequested(DemuxerStream::VIDEO)) {
+ SetShouldFeed(DemuxerStream::VIDEO, true);
+ ReadBuffer(DemuxerStream::VIDEO);
+ }
+
+ if (result && GetMediaPlayerClient())
+ GetMediaPlayerClient()->NotifyPlaybackState(kPlaybackReady, player_id_);
+
+ MediaPlayerESPlusPlayer::OnPrepareComplete(result);
+
+ if (is_for_ta_ && result && should_trigger_ta_zorder_checking_) {
+ should_trigger_ta_zorder_checking_ = false;
+ StartCheckingHbbTVZOrder();
+ }
}
void MediaPlayerESPlusPlayerTV::OnEos() {
#endif // TIZEN_VERSION_AT_LEAST(6, 5, 0)
}
-void MediaPlayerESPlusPlayerTV::ChooseDecoderIfNeeded(VideoCodec codec) {
+void MediaPlayerESPlusPlayerTV::ChooseDecoderIfNeeded(VideoCodec codec,
+ bool ignore_conflict) {
if (!blink::IsHbbTV()) {
return;
}
- content::WebContentsDelegate* contents_delegate =
- GetMediaPlayerClient()->GetWebContentsDelegate();
+
+ if (!content::HardwareResourceHelper::Get().IsDualDecoding()) {
+ LOG_ID(INFO, player_id_) << "No dual decoder support...";
+ return;
+ }
+
+ if (auto td_ptr = suitable_decoder_.lock()) {
+ SetDecoderReleased(td_ptr->GetDecoderType());
+ }
+
+ // Prevent checking ZOrder for invalid decoder.
+ StopCheckingHbbTVZOrder();
+
+ content::WebContentsDelegate* contents_delegate = nullptr;
+ if (GetMediaPlayerClient()) {
+ contents_delegate = GetMediaPlayerClient()->GetWebContentsDelegate();
+ }
if (contents_delegate != nullptr) {
content::HardwareResourceHelper::Get().HandleBroadcastDecoder(
contents_delegate->GetBroadcastDecoder());
auto fps = static_cast<int>(framerate);
const auto max_resolution =
GetMaxResolution(capi_media_format_video_.mime_type, is_video_hole_);
- const auto max_width = max_resolution.width();
- const auto max_height = max_resolution.height();
+ auto max_width = max_resolution.width();
+ auto max_height = max_resolution.height();
+ if (is_for_ta_) {
+ std::tie(max_width, max_height) =
+ GetHBBTvTAResolution(max_width, max_height);
+ }
suitable_decoder_ =
content::HardwareResourceHelper::Get().GetSuitableResource(
media::MediaType::Video, content::HWAquirePolicy::SWITCH, max_width,
use_sw_audio_decoder = IsSwAudioSupported();
}
+ // NOTE: Broadcast always uses HW, so we need to avoid also audio conflicts
+ const bool is_hw_audio_conflicted =
+ IsHwAudioConflicted() && !use_sw_audio_decoder;
+ decoder_conflict_ = td_ptr->IsAcquired() || is_hw_audio_conflicted;
+ if (decoder_conflict_) {
+ LOG_ID(INFO, player_id_) << "Conflict:"
+ << " audio_conflicted=" << is_hw_audio_conflicted
+ << " video_conflicted=" << td_ptr->IsAcquired();
+ if (!ignore_conflict) {
+ LOG_ID(ERROR, player_id_)
+ << "Selected decoder but it's already acquired.";
+ return;
+ }
+ LOG_ID(INFO, player_id_)
+ << "Selected decoder with conflict, but we're force to ignore it.";
+ }
+
SetHwAudioDecoder();
#if TIZEN_VERSION_AT_LEAST(6, 0, 0)
+ constexpr int kAllResourcesForMain = 0;
+ constexpr int kAllResourcesForSub = 1;
if ((dec_name & content::kSubDecoder) == content::kSubDecoder) {
LOG_ID(INFO, player_id_) << "SUB decoder is used for this " << this;
// 1 = set all video resources(decoder/scaler) to sub resources
- esplusplayer_set_alternative_video_resource(esplayer_, 1);
+ esplusplayer_set_alternative_video_resource(esplayer_, kAllResourcesForSub);
} else if ((dec_name & content::kMainDecoder) == content::kMainDecoder) {
LOG_ID(INFO, player_id_) << "MAIN decoder is used for this " << this;
// 0 = set all video resources(decoder/scaler) to main resources
- esplusplayer_set_alternative_video_resource(esplayer_, 0);
+ esplusplayer_set_alternative_video_resource(esplayer_,
+ kAllResourcesForMain);
// If using SW audio decoding is possible. HW audio decoder
// should be explicitly used for MAIN decoder.
+
} else {
LOG_ID(ERROR, GetPlayerId()) << "CANNOT USE ANY VIDEO DECODER";
}
SetSwAudioDecoder();
}
#endif
- decoder_conflict_ = td_ptr->IsAcquired();
- if (!decoder_conflict_) {
+
+ // Decoder conflict is now checked above and we do not get here
+ // if there is one.
+ if (GetMediaPlayerClient()) {
// is_notification_playback_ready_delayed_ = true;
bool media_resource_acquired = false;
GetMediaPlayerClient()->NotifyPlaybackState(
LOG_ID(INFO, GetPlayerId()) << "HbbTV media resource was not acquired";
return;
}
-
- SetDecoderAcquired(dec_name);
}
+ SetDecoderAcquired(dec_name);
}
void MediaPlayerESPlusPlayerTV::SetDecoderAcquired(
return !is_audio_drm_eme_ && audio_codec_ != media::AudioCodec::kAC4;
}
+bool MediaPlayerESPlusPlayerTV::HasAudio() const {
+ return GetMediaType() & MediaType::Audio;
+}
+
+void MediaPlayerESPlusPlayerTV::ForceVideoOrder(VideoOrder videoOrder) {
+#if defined(TIZEN_VIDEO_HOLE) && TIZEN_VERSION_AT_LEAST(6, 0, 0)
+ const auto decoder = suitable_decoder_.lock();
+ if (!decoder) {
+ return;
+ }
+ const auto dec_type = decoder->GetDecoderType(content::kDecoders);
+ ::media::ForceVideoOrder<content::DecoderType, VideoOrder,
+ VideoOrder::kOnTop>(dec_type, videoOrder,
+ player_id_);
+#endif // defined(TIZEN_VIDEO_HOLE) && TIZEN_VERSION_AT_LEAST(6, 0, 0)
+}
+
#if defined(TIZEN_VIDEO_HOLE)
void MediaPlayerESPlusPlayerTV::SetVideoVisibility(bool visible) {
- if (!blink::IsHbbTV() || !is_video_hole_) {
+ if (!blink::IsHbbTV() || !is_video_hole_ || is_for_ta_)
return;
- }
#if TIZEN_VERSION_AT_LEAST(6, 0, 0)
if (auto td_ptr = suitable_decoder_.lock()) {
- if (td_ptr->GetDecoderType(content::kDecoders) == content::kMainDecoder &&
- td_ptr->GetDecoderType(content::kResolutions) == content::kFHDDecoder) {
- return;
- }
auto dec_type = td_ptr->GetDecoderType(content::kDecoders);
const unsigned int kFullVisibility = 255;
const unsigned int kNoVisibility = 0;
}
#endif
+bool MediaPlayerESPlusPlayerTV::IsHbbTvTaAllowed() const {
+ // HbbTV Targeted Advertisement is allowed only when SW audio decoding is set.
+ return blink::IsHbbTV() && UseSwAudioDecoding();
+}
+
+void MediaPlayerESPlusPlayerTV::StartCheckingHbbTVZOrder() {
+ if (!is_for_ta_) {
+ return;
+ }
+ if (hbbtv_zorder_checker_timer_.IsRunning())
+ return;
+
+ LOG_ID(INFO, player_id_) << __func__;
+ is_ta_geometry_set_ = false;
+ hbbtv_zorder_checker_timer_.Start(
+ FROM_HERE, kHbbTVZorderCheckInterval, this,
+ &MediaPlayerESPlusPlayerTV::OnCheckingHbbtvTVZorder);
+}
+
+void MediaPlayerESPlusPlayerTV::StopCheckingHbbTVZOrder() {
+ if (!hbbtv_zorder_checker_timer_.IsRunning())
+ return;
+
+ LOG_ID(INFO, player_id_) << __func__;
+ hbbtv_zorder_checker_timer_.Stop();
+}
+
+void MediaPlayerESPlusPlayerTV::OnCheckingHbbtvTVZorder() {
+ if (is_ta_geometry_set_)
+ return;
+
+ auto decoder = suitable_decoder_.lock();
+ if (!decoder) {
+ LOG_ID(WARNING, player_id_) << "No suitable decoder";
+ return;
+ }
+
+ constexpr int kMainPlane = 0;
+ constexpr int kSubPlane = 1;
+ int expected_zorder_on_top;
+ const auto dec_type = decoder->GetDecoderType(content::kDecoders);
+ if ((dec_type & content::kDecoders) == content::kSubDecoder) {
+ expected_zorder_on_top = kSubPlane;
+ } else if ((dec_type & content::kDecoders) == content::kMainDecoder) {
+ expected_zorder_on_top = kMainPlane;
+ } else {
+ LOG_ID(WARNING, player_id_)
+ << "Cannot understand a decoder type: " << dec_type;
+ return;
+ }
+
+ constexpr size_t kZOrderRawMinimalLength = 8;
+ unsigned char order[kZOrderRawMinimalLength];
+#if TIZEN_VERSION_AT_LEAST(9, 0, 0) && !BUILDFLAG(IS_RISCV64_TV)
+ const auto error = ppi_video_dp_control_get_zorder_raw(order);
+#else
+ const auto error = IVideoDpControl::getInstance()->getZorderRaw(order);
+#endif
+ if (error) {
+ LOG_ID(WARNING, player_id_) << "Cannot acquire ZORDER: " << strerror(error);
+ return;
+ }
+
+ auto ToText = [](int plane) -> std::string {
+ switch (plane) {
+ case kMainPlane:
+ return "MAIN-SUB-BG";
+ case kSubPlane:
+ return "SUB-MAIN-BG";
+ default:
+ return "UNACCEPTED";
+ }
+ };
+
+ LOG_ID(INFO, player_id_) << "ZOrder=" << ToText(order[0])
+ << " expected=" << ToText(expected_zorder_on_top);
+
+ if (expected_zorder_on_top == order[0]) {
+ LOG_ID(INFO, player_id_)
+ << "ZOrder updated. Changing a geometry in advance.";
+ is_ta_geometry_set_ = true;
+ hbbtv_zorder_checker_timer_.Stop();
+ ForceVideoOrder(VideoOrder::kOnBottom);
+ GetMediaPlayerClient()->OnVideoRect(video_rect_);
+ }
+}
+
+bool MediaPlayerESPlusPlayerTV::IsHwAudioConflicted() const {
+ // NOTE: Broadcast always uses HW, so we need to avoid also audio conflicts
+ return HasAudio() &&
+ content::HardwareResourceHelper::Get()
+ .IsAnyDecoderAcquiredByBroadcast() &&
+ !UseSwAudioDecoding();
+}
+
} // namespace media
#include "public/ewk_context.h"
#include "public/ewk_enums_internal.h"
#include "public/ewk_settings.h"
+#include "tizen_src/chromium_impl/tizen/tizen_tv_platform.h"
#include "third_party/blink/public/common/page/page_zoom.h"
#include "third_party/blink/public/common/web_preferences/web_preferences.h"
#include "ui/events/gesture_detection/gesture_configuration.h"
Ewk_Board_Decoding_Capabilities ewk_view_board_decoding_capabilities_get(
const Evas_Object* view)
{
- LOG_EWK_API_MOCKUP();
+#if BUILDFLAG(IS_TIZEN_TV)
+ // This one should be moved into HbbTV code.
+ auto DecodingCapabilities = []() -> Ewk_Board_Decoding_Capabilities {
+ const std::string chipset = GetTVChipset();
+ const ResourceTableIndex rt_idx = GetResourceTableIndex();
+ // 1x FHD decoder: KantS2
+ // 1x UHD decoder: NikeL 1.5G
+ if (chipset == "KANTS2" || rt_idx == ResourceTableIndex::DTV_NIKEL_1_5G) {
+ LOG(INFO) << "It is low-end board, do not use dual decoding";
+ return EWK_BOARD_DECODING_CAPABILITIES_SINGLE;
+ }
+ // 2x FHD decoder: KantSU2E
+ if (chipset == "KANTSU2E") {
+ LOG(INFO) << "It is KantSU2e, use 2x FHD decoders";
+ return EWK_BOARD_DECODING_CAPABILITIES_DOUBLE_FHD;
+ }
+ // 1x UHD, 1x FHD decoder: other boards
+ LOG(INFO) << "It is " << chipset << ", rt idx is "
+ << static_cast<int>(rt_idx) << ", use both decoders";
+ return EWK_BOARD_DECODING_CAPABILITIES_FHD_AND_UHD;
+ };
+
+ static Ewk_Board_Decoding_Capabilities board_decoding_capabilities =
+ DecodingCapabilities();
+ return board_decoding_capabilities;
+#else
+ LOG_EWK_API_MOCKUP("Only for Tizen TV.");
return EWK_BOARD_DECODING_CAPABILITIES_UNKNOWN;
+#endif
}
void ewk_view_next_player_for_media_switch_set(
Evas_Object* view,
int player_id)
{
- LOG_EWK_API_MOCKUP();
+#if BUILDFLAG(IS_TIZEN_TV)
+ LOG(INFO) << "Notify about media switch, next player id: " << player_id;
+ EWK_VIEW_IMPL_GET_OR_RETURN(view, impl);
+ impl->SetNextPlayerForMediaSwitch(player_id);
+#else
+ LOG_EWK_API_MOCKUP("Only for Tizen TV.");
+#endif // BUILDFLAG(IS_TIZEN_TV)
}
-void ewk_view_sw_audio_decoding_set(
- Evas_Object* view,
- Eina_Bool use_sw_audio_decoder)
-{
+void ewk_view_sw_audio_decoding_set(Evas_Object* view,
+ Eina_Bool use_sw_audio_decoder) {
#if BUILDFLAG(IS_TIZEN_TV)
LOG(INFO) << "Use sw audio decoding: "
<< static_cast<bool>(use_sw_audio_decoder);
#endif // BUILDFLAG(IS_TIZEN_TV)
}
+void ewk_view_sw_audio_volume(Evas_Object* view, double volume) {
+ LOG_EWK_API_MOCKUP();
+}
+
void ewk_view_set_video_geometry(
Evas_Object* view,
Eina_Rectangle v_area)
{
- LOG_EWK_API_MOCKUP();
+#if BUILDFLAG(IS_TIZEN_TV)
+ LOG(INFO) << "Notify about geometry: " << v_area.x << ", " << v_area.y << " "
+ << v_area.w << "x" << v_area.h;
+ EWK_VIEW_IMPL_GET_OR_RETURN(view, impl);
+ impl->SetVideoGeometry(v_area.x, v_area.y, v_area.w, v_area.h);
+#else
+ LOG_EWK_API_MOCKUP("Only for Tizen TV.");
+#endif // BUILDFLAG(IS_TIZEN_TV)
}
void ewk_view_release_players(
Evas_Object* view,
int video_id)
{
- LOG_EWK_API_MOCKUP();
+#if BUILDFLAG(IS_TIZEN_TV)
+ LOG(INFO) << "Video play: " << video_id;
+ EWK_VIEW_IMPL_GET_OR_RETURN(view, impl);
+ impl->VideoPlay(video_id);
+#else
+ LOG_EWK_API_MOCKUP("Only for Tizen TV.");
+#endif // BUILDFLAG(IS_TIZEN_TV)
}
void ewk_view_player_pause(
Evas_Object* view,
int video_id)
{
- LOG_EWK_API_MOCKUP();
+#if BUILDFLAG(IS_TIZEN_TV)
+ LOG(INFO) << "Video pause: " << video_id;
+ EWK_VIEW_IMPL_GET_OR_RETURN(view, impl);
+ impl->VideoPause(video_id);
+#else
+ LOG_EWK_API_MOCKUP("Only for Tizen TV.");
+#endif // BUILDFLAG(IS_TIZEN_TV)
}
Eina_Bool ewk_media_translated_url_set(Evas_Object* ewkView, const char* url)