summaryrefslogtreecommitdiff
path: root/gst-libs/gst/codecparsers
diff options
context:
space:
mode:
authorHaihao Xiang <haihao.xiang@intel.com>2020-06-05 13:01:06 +0800
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>2020-09-16 16:51:45 +0000
commit626af12498c940183572004ea96a48eb3432d2f5 (patch)
tree11417bfd53d64e0132ae6725267dda56d7214cf3 /gst-libs/gst/codecparsers
parent2f5904c20d61fd75a8a8c30ec790f276c35df4b8 (diff)
downloadgstreamer-plugins-bad-626af12498c940183572004ea96a48eb3432d2f5.tar.gz
h265parser: select the right profile for high throughput SCC stream
Currently screen-extended-high-throughput-444 is recognized as screen-extended-main-444, screen-extended-high-throughput-444-10 is recognized as screen-extended-main-444-10 because they have the same extension flags, so without this patch, it is possible that a decoder which supports SCC but doesn't support throughput SCC will try to decode a throughput SCC stream. e.g. https://www.itu.int/wftp3/av-arch/jctvc-site/bitstream_exchange/draft_conformance/SCC/HT_A_SCC_Apple_2.zip Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1328>
Diffstat (limited to 'gst-libs/gst/codecparsers')
-rw-r--r--gst-libs/gst/codecparsers/gsth265parser.c34
1 files changed, 22 insertions, 12 deletions
diff --git a/gst-libs/gst/codecparsers/gsth265parser.c b/gst-libs/gst/codecparsers/gsth265parser.c
index 26e68b276..69166ca36 100644
--- a/gst-libs/gst/codecparsers/gsth265parser.c
+++ b/gst-libs/gst/codecparsers/gsth265parser.c
@@ -3582,14 +3582,6 @@ get_screen_content_coding_extensions_profile (GstH265ProfileTierLevel * ptl)
1, 1, 1, 1, 0, 0, 0, 0, 0, TRUE, 2},
{GST_H265_PROFILE_SCREEN_EXTENDED_MAIN_444_10,
1, 1, 1, 0, 0, 0, 0, 0, 0, TRUE, 3},
- /* identical to screen-extended-main-444 */
- {GST_H265_PROFILE_SCREEN_EXTENDED_HIGH_THROUGHPUT_444,
- 1, 1, 1, 1, 0, 0, 0, 0, 0, TRUE, 4},
- /* identical to screen-extended-main-444-10 */
- {GST_H265_PROFILE_SCREEN_EXTENDED_HIGH_THROUGHPUT_444_10,
- 1, 1, 1, 0, 0, 0, 0, 0, 0, TRUE, 5},
- {GST_H265_PROFILE_SCREEN_EXTENDED_HIGH_THROUGHPUT_444_14,
- 1, 0, 0, 0, 0, 0, 0, 0, 0, TRUE, 6},
};
return get_extension_profile (profiles, G_N_ELEMENTS (profiles), ptl);
@@ -3612,6 +3604,22 @@ get_scalable_format_range_extensions_profile (GstH265ProfileTierLevel * ptl)
return get_extension_profile (profiles, G_N_ELEMENTS (profiles), ptl);
}
+static GstH265Profile
+ get_screen_content_coding_extensions_high_throughput_profile
+ (GstH265ProfileTierLevel * ptl)
+{
+ static H265ExtensionProfile profiles[] = {
+ {GST_H265_PROFILE_SCREEN_EXTENDED_HIGH_THROUGHPUT_444,
+ 1, 1, 1, 1, 0, 0, 0, 0, 0, TRUE, 0},
+ {GST_H265_PROFILE_SCREEN_EXTENDED_HIGH_THROUGHPUT_444_10,
+ 1, 1, 1, 0, 0, 0, 0, 0, 0, TRUE, 1},
+ {GST_H265_PROFILE_SCREEN_EXTENDED_HIGH_THROUGHPUT_444_14,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, TRUE, 2},
+ };
+
+ return get_extension_profile (profiles, G_N_ELEMENTS (profiles), ptl);
+}
+
/**
* gst_h265_profile_tier_level_get_profile:
* @ptl: a #GstH265ProfileTierLevel
@@ -3657,16 +3665,18 @@ gst_h265_profile_tier_level_get_profile (GstH265ProfileTierLevel * ptl)
return get_3d_profile (ptl);
if (ptl->profile_idc == GST_H265_PROFILE_IDC_SCREEN_CONTENT_CODING
- || ptl->profile_compatibility_flag[9]
- || ptl->profile_idc ==
- GST_H265_PROFILE_IDC_HIGH_THROUGHPUT_SCREEN_CONTENT_CODING_EXTENSION
- || ptl->profile_compatibility_flag[11])
+ || ptl->profile_compatibility_flag[9])
return get_screen_content_coding_extensions_profile (ptl);
if (ptl->profile_idc == GST_H265_PROFILE_IDC_SCALABLE_FORMAT_RANGE_EXTENSION
|| ptl->profile_compatibility_flag[10])
return get_scalable_format_range_extensions_profile (ptl);
+ if (ptl->profile_idc ==
+ GST_H265_PROFILE_IDC_HIGH_THROUGHPUT_SCREEN_CONTENT_CODING_EXTENSION
+ || ptl->profile_compatibility_flag[11])
+ return get_screen_content_coding_extensions_high_throughput_profile (ptl);
+
return GST_H265_PROFILE_INVALID;
}