summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorHe Junyan <junyan.he@hotmail.com>2020-03-18 16:41:01 +0800
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2020-03-20 14:57:49 +0100
commit532a1e5509952ce018899b50a0412db9bbf8a614 (patch)
treecfd0bb6ec585dd4e6fc471eb67c7b723e96a0b01 /gst
parenta28046a8dfc2e44c709525c52bc2cfd53a421b91 (diff)
libs,plugins: decoder: Add -intra profile support for hevc.
In hevc, we can consider the -intra profile a subset of the none -intra profile. The -intra profiles just contain I frames and we definitely can use the none -intra profiles's context to decode them. Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
Diffstat (limited to 'gst')
-rw-r--r--gst/vaapi/gstvaapidecode.c31
1 files changed, 28 insertions, 3 deletions
diff --git a/gst/vaapi/gstvaapidecode.c b/gst/vaapi/gstvaapidecode.c
index d5db8107..68de7e9d 100644
--- a/gst/vaapi/gstvaapidecode.c
+++ b/gst/vaapi/gstvaapidecode.c
@@ -1267,9 +1267,34 @@ gst_vaapidecode_ensure_allowed_sinkpad_caps (GstVaapiDecode * decode)
continue;
profile_name = gst_vaapi_profile_get_name (profile);
- if (profile_name)
- gst_structure_set (structure, "profile", G_TYPE_STRING,
- profile_name, NULL);
+ if (profile_name) {
+ /* Add all according -intra profile for HEVC */
+ if (profile == GST_VAAPI_PROFILE_H265_MAIN
+ || profile == GST_VAAPI_PROFILE_H265_MAIN10
+ || profile == GST_VAAPI_PROFILE_H265_MAIN_422_10
+ || profile == GST_VAAPI_PROFILE_H265_MAIN_444
+ || profile == GST_VAAPI_PROFILE_H265_MAIN_444_10) {
+ GValue list_value = G_VALUE_INIT;
+ GValue value = G_VALUE_INIT;
+ gchar *intra_name;
+
+ g_value_init (&list_value, GST_TYPE_LIST);
+ g_value_init (&value, G_TYPE_STRING);
+ g_value_set_string (&value, profile_name);
+ gst_value_list_append_value (&list_value, &value);
+
+ intra_name = g_strdup_printf ("%s-intra", profile_name);
+ g_value_take_string (&value, intra_name);
+ gst_value_list_append_value (&list_value, &value);
+
+ gst_structure_set_value (structure, "profile", &list_value);
+ g_value_unset (&list_value);
+ g_value_unset (&value);
+ } else {
+ gst_structure_set (structure, "profile", G_TYPE_STRING,
+ profile_name, NULL);
+ }
+ }
gst_vaapi_profile_caps_append_decoder (display, profile, structure);