mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-30 05:31:15 +00:00
va: Add decoder compatible caps string field into profiles' map
Some profiles such as main or main-10 in HEVC can support more compatible profiles such as main-still-picture or main-10-intra. We should add them into decoder's sink caps. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5797>
This commit is contained in:
parent
354aceb9cd
commit
5345652896
1 changed files with 19 additions and 7 deletions
|
@ -33,11 +33,16 @@ static const struct ProfileMap
|
||||||
const gchar *name;
|
const gchar *name;
|
||||||
const gchar *media_type;
|
const gchar *media_type;
|
||||||
const gchar *caps_str;
|
const gchar *caps_str;
|
||||||
|
const gchar *decoder_compatible_caps_str;
|
||||||
} profile_map[] = {
|
} profile_map[] = {
|
||||||
#define P(codec, va_name, name, media_type, caps_str) { \
|
#define O(codec, va_name, name, media_type, caps_str, all_caps_str) \
|
||||||
G_PASTE (G_PASTE (VAProfile, codec), va_name), codec, \
|
G_PASTE (G_PASTE (VAProfile, codec), va_name), codec, \
|
||||||
G_STRINGIFY (G_PASTE (G_PASTE (VAProfile, codec), va_name)), \
|
G_STRINGIFY (G_PASTE (G_PASTE (VAProfile, codec), va_name)), \
|
||||||
name, media_type, caps_str }
|
name, media_type, caps_str, all_caps_str
|
||||||
|
#define P(codec, va_name, name, media_type, caps_str) { \
|
||||||
|
O(codec, va_name, name, media_type, caps_str, NULL) }
|
||||||
|
#define Q(codec, va_name, name, media_type, caps_str, all_caps_str) { \
|
||||||
|
O(codec, va_name, name, media_type, caps_str, all_caps_str) }
|
||||||
P (MPEG2, Simple, "simple", "video/mpeg",
|
P (MPEG2, Simple, "simple", "video/mpeg",
|
||||||
"mpegversion = (int) 2, profile = (string) simple"),
|
"mpegversion = (int) 2, profile = (string) simple"),
|
||||||
P (MPEG2, Main, "main", "video/mpeg",
|
P (MPEG2, Main, "main", "video/mpeg",
|
||||||
|
@ -69,8 +74,10 @@ static const struct ProfileMap
|
||||||
/* "profile = (string) { multiview-high, stereo-high }"), */
|
/* "profile = (string) { multiview-high, stereo-high }"), */
|
||||||
/* P (H264, StereoHigh, "video/x-h264", */
|
/* P (H264, StereoHigh, "video/x-h264", */
|
||||||
/* "profile = (string) { multiview-high, stereo-high }"), */
|
/* "profile = (string) { multiview-high, stereo-high }"), */
|
||||||
P (HEVC, Main, "main", "video/x-h265", "profile = (string) main"),
|
Q (HEVC, Main, "main", "video/x-h265", "profile = (string) main",
|
||||||
P (HEVC, Main10, "main-10", "video/x-h265", "profile = (string) main-10"),
|
"profile = (string) { main, main-intra, main-still-picture }"),
|
||||||
|
Q (HEVC, Main10, "main-10", "video/x-h265", "profile = (string) main-10",
|
||||||
|
"profile = (string) { main-10, main-10-intra }"),
|
||||||
P (VP9, Profile0, "0", "video/x-vp9", "profile = (string) 0"),
|
P (VP9, Profile0, "0", "video/x-vp9", "profile = (string) 0"),
|
||||||
P (VP9, Profile1, "1", "video/x-vp9", "profile = (string) 1"),
|
P (VP9, Profile1, "1", "video/x-vp9", "profile = (string) 1"),
|
||||||
P (VP9, Profile2, "2", "video/x-vp9", "profile = (string) 2"),
|
P (VP9, Profile2, "2", "video/x-vp9", "profile = (string) 2"),
|
||||||
|
@ -111,7 +118,9 @@ static const struct ProfileMap
|
||||||
P (AV1, Profile1, "high", "video/x-av1", "profile = (string) high"),
|
P (AV1, Profile1, "high", "video/x-av1", "profile = (string) high"),
|
||||||
P (HEVC, SccMain444_10, "screen-extended-main-444-10", "video/x-h265",
|
P (HEVC, SccMain444_10, "screen-extended-main-444-10", "video/x-h265",
|
||||||
"profile = (string) screen-extended-main-444-10"),
|
"profile = (string) screen-extended-main-444-10"),
|
||||||
|
#undef O
|
||||||
#undef P
|
#undef P
|
||||||
|
#undef Q
|
||||||
};
|
};
|
||||||
/* *INDENT-ON* */
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
|
@ -166,7 +175,10 @@ gst_va_profile_caps (VAProfile profile, VAEntrypoint entrypoint)
|
||||||
if (!map)
|
if (!map)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (map->caps_str)
|
if (entrypoint == VAEntrypointVLD && map->decoder_compatible_caps_str) {
|
||||||
|
caps_str = g_strdup_printf ("%s, %s", map->media_type,
|
||||||
|
map->decoder_compatible_caps_str);
|
||||||
|
} else if (map->caps_str)
|
||||||
caps_str = g_strdup_printf ("%s, %s", map->media_type, map->caps_str);
|
caps_str = g_strdup_printf ("%s, %s", map->media_type, map->caps_str);
|
||||||
else
|
else
|
||||||
caps_str = g_strdup (map->media_type);
|
caps_str = g_strdup (map->media_type);
|
||||||
|
|
Loading…
Reference in a new issue