mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
d3d11vp9dec: Disallow Profile2 12bits stream
Since DXVA does not support the format, specify bit-depth field to sinkpad template caps so that d3d11vp9dec can be skipped during autoplugging Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3297>
This commit is contained in:
parent
32b13a883a
commit
d8bdd9429b
1 changed files with 24 additions and 39 deletions
|
@ -823,13 +823,13 @@ gst_d3d11_vp9_dec_register (GstPlugin * plugin, GstD3D11Device * device,
|
||||||
const GUID *profile0_guid = NULL;
|
const GUID *profile0_guid = NULL;
|
||||||
GstCaps *sink_caps = NULL;
|
GstCaps *sink_caps = NULL;
|
||||||
GstCaps *src_caps = NULL;
|
GstCaps *src_caps = NULL;
|
||||||
|
GstCaps *d3d11_caps = NULL;
|
||||||
guint max_width = 0;
|
guint max_width = 0;
|
||||||
guint max_height = 0;
|
guint max_height = 0;
|
||||||
guint resolution;
|
guint resolution;
|
||||||
gboolean have_profile2 = FALSE;
|
gboolean have_profile2 = FALSE;
|
||||||
gboolean have_profile0 = FALSE;
|
gboolean have_profile0 = FALSE;
|
||||||
DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN;
|
DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN;
|
||||||
GValue vp9_profiles = G_VALUE_INIT;
|
|
||||||
|
|
||||||
have_profile2 = gst_d3d11_decoder_get_supported_decoder_profile (device,
|
have_profile2 = gst_d3d11_decoder_get_supported_decoder_profile (device,
|
||||||
GST_DXVA_CODEC_VP9, GST_VIDEO_FORMAT_P010_10LE, &profile2_guid);
|
GST_DXVA_CODEC_VP9, GST_VIDEO_FORMAT_P010_10LE, &profile2_guid);
|
||||||
|
@ -890,47 +890,32 @@ gst_d3d11_vp9_dec_register (GstPlugin * plugin, GstD3D11Device * device,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
sink_caps = gst_caps_from_string ("video/x-vp9, alignment = (string) frame");
|
if (have_profile0 && have_profile2) {
|
||||||
src_caps = gst_caps_from_string ("video/x-raw("
|
sink_caps = gst_caps_from_string ("video/x-vp9, "
|
||||||
GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY "); video/x-raw");
|
"alignment = (string) frame, profile = (string) 0; "
|
||||||
|
"video/x-vp9, alignment = (string) frame, profile = (string) 2, "
|
||||||
g_value_init (&vp9_profiles, GST_TYPE_LIST);
|
"bit-depth-luma = (uint) 10, bit-depth-chroma = (uint) 10");
|
||||||
|
src_caps = gst_caps_from_string ("video/x-raw, "
|
||||||
if (have_profile0) {
|
"format = (string) { NV12, P010_10LE }");
|
||||||
GValue vp9_profile_val = G_VALUE_INIT;
|
} else if (have_profile0) {
|
||||||
|
sink_caps = gst_caps_from_string ("video/x-vp9, "
|
||||||
g_value_init (&vp9_profile_val, G_TYPE_STRING);
|
"alignment = (string) frame, profile = (string) 0");
|
||||||
g_value_set_string (&vp9_profile_val, "0");
|
src_caps = gst_caps_from_string ("video/x-raw, " "format = (string) NV12");
|
||||||
gst_value_list_append_and_take_value (&vp9_profiles, &vp9_profile_val);
|
} else if (have_profile2) {
|
||||||
}
|
sink_caps = gst_caps_from_string ("video/x-vp9, "
|
||||||
|
"alignment = (string) frame, profile = (string) 2, "
|
||||||
if (have_profile2) {
|
"bit-depth-luma = (uint) 10, bit-depth-chroma = (uint) 10");
|
||||||
GValue format_list = G_VALUE_INIT;
|
src_caps = gst_caps_from_string ("video/x-raw, "
|
||||||
GValue format_value = G_VALUE_INIT;
|
"format = (string) P010_10LE");
|
||||||
GValue vp9_profile_val = G_VALUE_INIT;
|
|
||||||
|
|
||||||
g_value_init (&format_list, GST_TYPE_LIST);
|
|
||||||
|
|
||||||
g_value_init (&format_value, G_TYPE_STRING);
|
|
||||||
g_value_set_string (&format_value, "NV12");
|
|
||||||
gst_value_list_append_and_take_value (&format_list, &format_value);
|
|
||||||
|
|
||||||
g_value_init (&format_value, G_TYPE_STRING);
|
|
||||||
g_value_set_string (&format_value, "P010_10LE");
|
|
||||||
gst_value_list_append_and_take_value (&format_list, &format_value);
|
|
||||||
|
|
||||||
gst_caps_set_value (src_caps, "format", &format_list);
|
|
||||||
g_value_unset (&format_list);
|
|
||||||
|
|
||||||
g_value_init (&vp9_profile_val, G_TYPE_STRING);
|
|
||||||
g_value_set_string (&vp9_profile_val, "2");
|
|
||||||
gst_value_list_append_and_take_value (&vp9_profiles, &vp9_profile_val);
|
|
||||||
} else {
|
} else {
|
||||||
gst_caps_set_simple (src_caps, "format", G_TYPE_STRING, "NV12", NULL);
|
g_assert_not_reached ();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_caps_set_value (sink_caps, "profile", &vp9_profiles);
|
d3d11_caps = gst_caps_copy (src_caps);
|
||||||
g_value_unset (&vp9_profiles);
|
gst_caps_set_features_simple (d3d11_caps,
|
||||||
|
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY, NULL));
|
||||||
|
src_caps = gst_caps_merge (d3d11_caps, src_caps);
|
||||||
|
|
||||||
/* To cover both landscape and portrait, select max value */
|
/* To cover both landscape and portrait, select max value */
|
||||||
resolution = MAX (max_width, max_height);
|
resolution = MAX (max_width, max_height);
|
||||||
|
|
Loading…
Reference in a new issue