1. Add max codec resolution for Sero TV.
2. Update VP9* codec info.
3. Set HDR info.
4. Not support spatial rendering feature.
* Multiview resource allocation depends on left/right launch, and limitations are:
- not support trick play
- not support HDR
- not support 360 video
Migration from:
https://review.tizen.org/gerrit/#/c/platform/framework/web/chromium-efl/+/290344/
https://review.tizen.org/gerrit/#/c/platform/framework/web/chromium-efl/+/297093/
https://review.tizen.org/gerrit/#/c/platform/framework/web/chromium-efl/+/290415/
Change-Id: If91d6130281ac10cc0dc5b414f819d1ff557b9a2
Signed-off-by: wuxiaoliang <xliang.wu@samsung.com>
void set_is_rtc(bool is_rtc) { is_rtc_ = is_rtc; }
bool is_rtc() const { return is_rtc_; }
+#if BUILDFLAG(IS_TIZEN_TV)
+ void set_hdr_info(const std::string& hdr_info) { hdr_info_ = hdr_info; }
+ const std::string& hdr_info() const { return hdr_info_; }
+#endif
+
private:
VideoCodec codec_ = VideoCodec::kUnknown;
VideoCodecProfile profile_ = VIDEO_CODEC_PROFILE_UNKNOWN;
absl::optional<gfx::HDRMetadata> hdr_metadata_;
bool is_rtc_ = false;
+#if BUILDFLAG(IS_TIZEN_TV)
+ std::string hdr_info_;
+#endif
+
// Not using DISALLOW_COPY_AND_ASSIGN here intentionally to allow the compiler
// generated copy constructor and assignment operator. Since the extra data is
// typically small, the performance impact is minimal.
static const CodecInfo kVP8CodecInfo = {"vp8", CodecInfo::VIDEO, nullptr,
CodecInfo::HISTOGRAM_VP8};
-static const CodecInfo kLegacyVP9CodecInfo = {"vp9", CodecInfo::VIDEO, nullptr,
+static const CodecInfo kLegacyVP9CodecInfo = {"vp9*", CodecInfo::VIDEO, nullptr,
CodecInfo::HISTOGRAM_VP9};
static const CodecInfo kVP9CodecInfo = {"vp09.*", CodecInfo::VIDEO, nullptr,
CodecInfo::HISTOGRAM_VP9};
return color_metadata;
}
+#if BUILDFLAG(IS_TIZEN_TV)
+#define DEFAULT_ZERO(x) ((x == -1) ? 0 : x)
+const std::string WebMColourParser::GetWebMHdrInfo() {
+ std::ostringstream s;
+ s << "matrixCoefficients:" << DEFAULT_ZERO(matrix_coefficients_)
+ << " bitsPerChannel:" << DEFAULT_ZERO(bits_per_channel_)
+ << " chromaSubsamplingHorz:" << DEFAULT_ZERO(chroma_subsampling_horz_)
+ << " chromaSubsamplingVert:" << DEFAULT_ZERO(chroma_subsampling_vert_)
+ << " cbSubsamplingHorz:" << DEFAULT_ZERO(cb_subsampling_horz_)
+ << " cbSubsamplingVert:" << DEFAULT_ZERO(cb_subsampling_vert_)
+ << " chromaSitingHorz:" << DEFAULT_ZERO(chroma_siting_horz_)
+ << " chromaSitingVert:" << DEFAULT_ZERO(chroma_siting_vert_)
+ << " range:" << DEFAULT_ZERO(range_)
+ << " transferCharacteristics:" << DEFAULT_ZERO(transfer_characteristics_)
+ << " primaries:" << DEFAULT_ZERO(primaries_)
+ << " maxCLL:" << DEFAULT_ZERO(max_content_light_level_)
+ << " maxFALL:" << DEFAULT_ZERO(max_content_light_level_) << " RX:"
+ << color_volume_metadata_parser_.GetColorVolumeMetadata().primaries.fRX
+ << " RY:"
+ << color_volume_metadata_parser_.GetColorVolumeMetadata().primaries.fRY
+ << " GX:"
+ << color_volume_metadata_parser_.GetColorVolumeMetadata().primaries.fGX
+ << " GY:"
+ << color_volume_metadata_parser_.GetColorVolumeMetadata().primaries.fGY
+ << " BX:"
+ << color_volume_metadata_parser_.GetColorVolumeMetadata().primaries.fBX
+ << " BY:"
+ << color_volume_metadata_parser_.GetColorVolumeMetadata().primaries.fBY
+ << " wX:"
+ << color_volume_metadata_parser_.GetColorVolumeMetadata().primaries.fWX
+ << " wY:"
+ << color_volume_metadata_parser_.GetColorVolumeMetadata().primaries.fWY
+ << " luminanceMax:"
+ << color_volume_metadata_parser_.GetColorVolumeMetadata().luminance_max
+ << " luminanceMin:"
+ << color_volume_metadata_parser_.GetColorVolumeMetadata().luminance_min;
+
+ return s.str();
+}
+#endif
+
} // namespace media
WebMColorMetadata GetWebMColorMetadata() const;
+#if BUILDFLAG(IS_TIZEN_TV)
+ const std::string GetWebMHdrInfo();
+#endif
+
private:
// WebMParserClient implementation.
WebMParserClient* OnListStart(int id) override;
color_space, kNoTransformation, coded_size, visible_rect,
natural_size, codec_private, encryption_scheme);
+#if defined(IS_TIZEN_TV)
+ if (colour_parsed_)
+ config->set_hdr_info(colour_parser_.GetWebMHdrInfo());
+#endif
+
return config->IsValidConfig();
}
EncryptionScheme encryption_scheme;
VideoColorSpace color_space_info;
gfx.mojom.HDRMetadata? hdr_metadata;
+ [EnableIf=is_tizen_tv]
+ string hdr_info;
};
// Native struct media::SubsampleEntry;
output->set_level(input.level());
+#if BUILDFLAG(IS_TIZEN_TV)
+ std::string hdr;
+ if (!input.ReadHdrInfo(&hdr))
+ return false;
+ output->set_hdr_info(hdr.c_str());
+#endif
+
if (!output->IsValidConfig())
return false;
return input.level();
}
+#if BUILDFLAG(IS_TIZEN_TV)
+ static std::string hdr_info(const media::VideoDecoderConfig& input) {
+ return input.hdr_info();
+ }
+#endif
+
static bool Read(media::mojom::VideoDecoderConfigDataView input,
media::VideoDecoderConfig* output);
};
BuildRequires: pkgconfig(tv-resource-information)
BuildRequires: pkgconfig(vd-win-util)
BuildRequires: pkgconfig(WebProduct)
+%if %{tizen_version} >= 60
+BuildRequires: pkgconfig(resource-center-api)
+%endif
%endif
%if "%{__enable_capi_thread_booster}" == "1"
if (configuration->hasSamplerate())
web_configuration.samplerate = configuration->samplerate();
+#if BUILDFLAG(IS_TIZEN_TV)
+ if (configuration->hasSpatialRendering())
+ web_configuration.spatialRendering = configuration->spatialRendering();
+#endif
+
return web_configuration;
}
if (audio_config->hasSpatialRendering())
is_spatial_rendering = audio_config->spatialRendering();
+#if BUILDFLAG(IS_TIZEN_TV)
+ // Currently there is no support for spatial rendering feature
+ if (is_spatial_rendering)
+ return false;
+#endif
+
return media::IsSupportedAudioType(
{audio_codec, audio_profile, is_spatial_rendering});
}
bool result = supported == MIMETypeRegistry::kSupported;
- DVLOG(2) << __func__ << "(" << type << ", "
- << (enforce_codec_specificity ? "true" : "false") << ") -> "
- << (result ? "true" : "false");
+ LOG(INFO) << __func__ << "(" << type << ", "
+ << (enforce_codec_specificity ? "true" : "false") << ") -> "
+ << (result ? "true" : "false");
RecordIdentifiabilityMetric(context, type, result);
return result;
}
}
}
+config("resource-center-api") {
+ if (tizen_product_tv && tizen_version >= 60) {
+ ldflags = [ "-lresource-center-api" ]
+ }
+}
+
+tizen_pkg_config("libresource-center-api") {
+ packages = []
+ if (tizen_product_tv && tizen_version >= 60) {
+ packages = [ "resource-center-api" ]
+ }
+}
+
config("ecore-wayland") {
if (is_tizen && use_wayland) {
if (tizen_version >= 50) {
#include "tizen_src/chromium_impl/media/filters/esplusplayer_util.h"
+#include <vconf/vconf.h>
+
+#include "base/json/json_reader.h"
#include "base/logging.h"
+#include "tizen_src/chromium_impl/build/tizen_version.h"
#if BUILDFLAG(IS_TIZEN_TV)
+#include <resource_center.h>
+#include <ri-common-type.h>
+#include <ri-module-api.h>
+#include <tv-resource-information/ri-api.h>
+#include <tv-resource-manager/rm_module_api.h>
+#include "base/command_line.h"
+#include "base/memory/ptr_util.h"
+#include "content/public/common/content_switches.h"
+#include "ewk/efl_integration/common/application_type.h"
+#include "ewk/efl_integration/common/content_switches_efl.h"
#include "tizen_src/chromium_impl/tizen/tizen_tv_platform.h"
#endif
return PIPELINE_ERROR_DECODE;
}
+bool isProductTypeSero() {
+ bool is_sero = false;
+#if BUILDFLAG(IS_TIZEN_TV)
+ is_sero = isTVRotated();
+#endif
+
+ LOG(INFO) << "This product type is " << (is_sero ? "a Sero" : "not a Sero");
+ return is_sero;
+}
+
+#if BUILDFLAG(IS_TIZEN_TV) && TIZEN_VERSION_AT_LEAST(6, 0, 0)
+gfx::Size GetDynamicMaxCodecResolution() {
+ int max_width = 0;
+ int max_height = 0;
+ int max_framerate = 0;
+ std::string app_id =
+ base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ switches::kTizenAppId);
+
+ // resource center returns decodeer ability not resolution (ex.1088)
+ // http://wiki.vd.sec.samsung.net/display/OSS/02.+Max+Resolution
+ if (rc_get_max_video_resolution(app_id.c_str(), &max_width, &max_height,
+ &max_framerate) < 0) {
+ LOG(ERROR) << "Getting max video resolution failed in multiview mode.";
+ return {kFHDVideoMaxWidth, kFHDVideoMaxHeight};
+ }
+
+ // H.264 has to be decoded by 4K decoder(dvde) in multiview mode
+ // to support below scenario.
+ // Left FHD@30 (TVPlus) | Right FHD@60 (AirPlay is placed at right always)
+ // Refer to http://wiki.vd.sec.samsung.net/display/OSS/10.+Resource+table
+ if (max_width >= k8KVideoMaxWidth) {
+ return k8KVideoMaxSize;
+ } else if (max_width >= k4KVideoMaxWidth && max_width < k8KVideoMaxWidth) {
+ return k4KVideoMaxSize;
+ } else {
+ return kFHDVideoMaxSize;
+ }
+}
+
+const char* GetRIVideoCodecName(esplusplayer_video_mime_type mime_type) {
+ switch (mime_type) {
+ case ESPLUSPLAYER_VIDEO_MIME_TYPE_AV1:
+ return RI_CODEC_NAME_AV1;
+ case ESPLUSPLAYER_VIDEO_MIME_TYPE_VP8:
+ return RI_CODEC_NAME_VP8;
+ case ESPLUSPLAYER_VIDEO_MIME_TYPE_VP9:
+ return RI_CODEC_NAME_VP9;
+ case ESPLUSPLAYER_VIDEO_MIME_TYPE_HEVC:
+ return RI_CODEC_NAME_HEVC;
+ case ESPLUSPLAYER_VIDEO_MIME_TYPE_H264:
+ return RI_CODEC_NAME_H264;
+ case ESPLUSPLAYER_VIDEO_MIME_TYPE_MJPEG:
+ return RI_CODEC_NAME_MJPEG;
+ default:
+ break;
+ }
+ return "";
+}
+
+gfx::Size GetMaxCodecResolutionRI(esplusplayer_video_mime_type mime_type,
+ bool is_video_hole) {
+ int max_width = 0;
+ int max_height = 0;
+ int max_framerate = 0;
+ const char* ri_video_codec = GetRIVideoCodecName(mime_type);
+
+ // In portrait mode adaptive streaming has some problem
+ // when changing a resolution so Sero uses dvde decoder
+ // for all kind of codecs.
+ // The dvde decoder doesn't support VP8 and WMV. It is Sero product spec.
+ if (!*ri_video_codec) {
+ if (isProductTypeSero()) {
+ return k4KVideoMaxSize;
+ } else {
+ return kFHDVideoMaxSize;
+ }
+ }
+
+ if (ri_video_codec == RI_CODEC_NAME_H264) {
+ if (is_video_hole && isProductTypeSero())
+ return k4KVideoMaxSize;
+ else
+ return kFHDVideoMaxSize;
+ }
+
+ if (ri_get_max_resolution(ri_video_codec, &max_width, &max_height,
+ &max_framerate) != RI_OK) {
+ LOG(WARNING) << "Failed to get video max information";
+ const auto panel_resolution = GetPanelResolution();
+ return {panel_resolution.width(), panel_resolution.height()};
+ }
+
+ if (max_width >= k8KVideoMaxWidth) {
+ max_width = k8KVideoMaxWidth;
+ max_height = k8KVideoMaxHeight;
+ } else if (max_width >= k4KVideoMaxWidth && max_width < k8KVideoMaxWidth) {
+ max_width = k4KVideoMaxWidth;
+ max_height = k4KVideoMaxHeight;
+ } else if (max_width >= kFHDVideoMaxWidth && max_width < k4KVideoMaxWidth) {
+ max_width = kFHDVideoMaxWidth;
+ max_height = kFHDVideoMaxHeight;
+ }
+ return {max_width, max_height};
+}
+#endif
+
gfx::Size GetMaxCodecResolution(esplusplayer_video_mime_type mime_type,
bool is_video_hole) {
+#if BUILDFLAG(IS_TIZEN_TV) && TIZEN_VERSION_AT_LEAST(6, 0, 0)
+ if (media::IsMultiviewMode()) {
+ // Multiview specification:
+ // http://wiki.vd.sec.samsung.net/pages/viewpage.action?pageId=79211942
+ return GetDynamicMaxCodecResolution();
+ }
+ return GetMaxCodecResolutionRI(mime_type, is_video_hole);
+#else
switch (mime_type) {
case ESPLUSPLAYER_VIDEO_MIME_TYPE_AV1:
case ESPLUSPLAYER_VIDEO_MIME_TYPE_HEVC:
case ESPLUSPLAYER_VIDEO_MIME_TYPE_VP9:
return k8KVideoMaxSize;
case ESPLUSPLAYER_VIDEO_MIME_TYPE_H264:
- if (is_video_hole)
+ // H.264 has to be decoded by dvde decoder in multiview mode
+ // to support below scenario.
+ // Left FHD@30 (TVPlus) | Right FHD@60 (AirPlay)
+ // Refer to http://wiki.vd.sec.samsung.net/display/OSS/10.+Resource+table
+ if (is_video_hole && isProductTypeSero())
return k4KVideoMaxSize;
else
return kFHDVideoMaxSize;
case ESPLUSPLAYER_VIDEO_MIME_TYPE_VP8:
default:
- return kFHDVideoMaxSize;
+ // In portrait mode adaptive streaming has some problem
+ // when changing a resolution so Sero uses dvde decoder
+ // for all kind of codecs.
+ // The dvde decoder doesn't support VP8 and WMV. It is Sero product spec.
+ if (isProductTypeSero())
+ return k4KVideoMaxSize;
+ else
+ return kFHDVideoMaxSize;
}
+#endif
}
gfx::Size GetPanelResolution() {
}
}
+#if BUILDFLAG(IS_TIZEN_TV)
+bool IsMultiviewMode() {
+ const char vconf_multiview_info[] = "memory/multiscreen/info";
+
+ char* multiview_info = vconf_get_str(vconf_multiview_info);
+ if (multiview_info) {
+ auto multiview_info_value = base::JSONReader::Read(multiview_info);
+ free(multiview_info);
+ if (!multiview_info_value || !multiview_info_value->is_dict()) {
+ LOG(ERROR) << "read vconf multiview info failed";
+ return false;
+ }
+
+ base::Value::Dict& dict = multiview_info_value->GetDict();
+
+ const std::string* mode_value = dict.FindString("mode");
+ if (mode_value && *mode_value == "on") {
+ LOG(INFO) << "It is in multiview mode.";
+ return true;
+ }
+ }
+
+ return false;
+}
+#endif
+
} // namespace media
#include "tizen_src/chromium_impl/media/filters/buffer_observer.h"
#include "ui/gfx/geometry/size.h"
+constexpr auto kFHDVideoMaxWidth = 1920;
+constexpr auto kFHDVideoMaxHeight = 1080;
+constexpr auto kQHDVideoMaxWidth = 2560;
+constexpr auto kQHDVideoMaxHeight = 1440;
+constexpr auto k4KVideoMaxWidth = 3840;
+constexpr auto k4KVideoMaxHeight = 2160;
+constexpr auto k4KDCIVideoMaxWidth = 4096;
+constexpr auto k4KDCIVideoMaxHeight = 2160;
+constexpr auto k8KVideoMaxWidth = 7680;
+constexpr auto k8KVideoMaxHeight = 4320;
+
namespace media {
constexpr int kElementryStreamCount = 2; // Audio, Video only.
constexpr int kVideoFramerateDen = 100;
esplusplayer_display_rotation_type ConvertToESPlusPlayerDisplayRotation(
int rotation);
+#if BUILDFLAG(IS_TIZEN_TV)
+bool IsMultiviewMode();
+#endif
+
} // namespace media
#endif // MEDIA_FILTERS_ESPP_PLAYER_UTIL_H_
"//tizen_src/build:esplusplayer",
"//tizen_src/build:libesplusplayer",
"//tizen_src/chromium_impl/media:media_efl_config",
+ "//tizen_src/build:tizen-tv-resource-manager-config",
]
+ if(tizen_product_tv) {
+ external_media_video_decode_config += [
+ "//tizen_src/build:hdmicec-api",
+ "//tizen_src/build:libhdmicec-api",
+ ]
+ }
+
+ if(tizen_product_tv) {
+ external_media_video_decode_config += [
+ "//tizen_src/build:resource-center-api",
+ "//tizen_src/build:libresource-center-api",
+ ]
+ }
+
if (use_wayland) {
external_media_video_decode_config += [
"//tizen_src/build:ecore-wayland",