}
}
-ri_rsc_category_e FindDecoderForResolution(base::ResourceManager* manager,
- const char* codec_name,
- int32_t color_depth,
- const gfx::Size& resolution,
- uint32_t framerate,
- ri_sampling_format sampling_format) {
+ri_rsc_category_e FindDecoderForResolution(
+ base::ResourceManager* manager,
+ const char* codec_name,
+ int32_t color_depth,
+ const gfx::Size& resolution,
+ uint32_t framerate,
+ ri_sampling_format sampling_format,
+ base::PreferTexturingSupport prefer_texturing_support) {
// Lists framerates thresholds for different resource manager decoder
// categories, e.g.:
// - RM_CATEGORY_VIDEO_DECODER_HEVC_UHD_8BIT_30P
category_option =
static_cast<ri_rsc_category_e>(manager->GetCapableVideoCategoryId(
codec_name, color_depth, resolution.width(), resolution.height(),
- fps, sampling_format));
+ fps, sampling_format, prefer_texturing_support));
TIZEN_MEDIA_LOG_NO_INSTANCE(VERBOSE)
<< "codec: '" << codec_name << "'"
<< " size: " << resolution.ToString() << " fps: " << fps
<< "Disabling picking better decoder for game streaming";
}
+ // When manual rendering is prefered, we should allocate decoder that
+ // supports texturing to be able to utilize software rendering mode.
+ const auto prefer_texturing_support =
+ workarounds->ttvd_prefer_manual_rendering_for_low_latency
+ ? base::PreferTexturingSupport::kYes
+ : base::PreferTexturingSupport::kNo;
+
if (codec == MediaVideoCodec::kCodecH264 && has_udh_decoder &&
(use_h264_level50_workaround ||
should_use_faster_decoder_for_game_streaming)) {
.value_or(kDefaultFramerate);
category_option = FindDecoderForResolution(
GetResourceManager(), codec_name, bit_depth, k4k, uhd_fps,
- ConvertChromaSampling(sampling));
+ ConvertChromaSampling(sampling), prefer_texturing_support);
}
if (category_option <= 0) {
// try to use MFC.
category_option = FindDecoderForResolution(
GetResourceManager(), codec_name, bit_depth, coded_size, framerate,
- ConvertChromaSampling(sampling));
+ ConvertChromaSampling(sampling), prefer_texturing_support);
}
}
return ri_get_jpeg_category_id(codec_name, h_size);
}
-int ResourceManager::GetCapableVideoCategoryId(const char* codec_name,
- int color_depth,
- int width,
- int height,
- int framerate,
- int sampling_format) {
+int ResourceManager::GetCapableVideoCategoryId(
+ const char* codec_name,
+ int color_depth,
+ int width,
+ int height,
+ int framerate,
+ int sampling_format,
+ PreferTexturingSupport prefer_texturing_support) {
#if TIZEN_VERSION_AT_LEAST(6, 5, 0)
auto property = VideoPropertyType(ri_create_video_property(
codec_name, width, height, framerate, color_depth, sampling_format));
- if (ri_video_property_set_progressive(property.get(), true) != RI_OK) {
+ // Interlaced format is supported on MFC, so skipping setting progressive
+ // property should allow to request texturing supported decoder. Note that
+ // it does not prevent from allocating decoder other than MFC (e.g for 4K).
+ const bool use_progressive =
+ prefer_texturing_support == PreferTexturingSupport::kNo;
+ if (use_progressive &&
+ ri_video_property_set_progressive(property.get(), true) != RI_OK) {
TIZEN_MEDIA_LOG(ERROR) << "Cannot set progressive on video property";
return RI_CATEGORY_NONE;
}
class ResourceManager;
+enum class PreferTexturingSupport { kNo, kYes };
+
struct AllocatedResource {
using ID = uint32_t;
virtual bool IsCategorySupported(int category);
virtual int GetJpegCategoryId(const char* codec_name, int h_size);
- virtual int GetCapableVideoCategoryId(const char* codec_name,
- int color_depth,
- int width,
- int height,
- int framerate,
- int sampling_format);
+ virtual int GetCapableVideoCategoryId(
+ const char* codec_name,
+ int color_depth,
+ int width,
+ int height,
+ int framerate,
+ int sampling_format,
+ PreferTexturingSupport prefer_texturing_support);
// Checks if on the TV board there is physically present decoder capable
// of decoding UHD (4K) content (aka DVDE).