mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-03 06:39:51 +00:00
d3d11vp9dec: Specify profile and alignment on sink template
Set supported profile(s) on sink template caps, so that decodebin can filter out this element if profile of given vp9 stream is not supported by hardware decoder. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1567>
This commit is contained in:
parent
bb5ef4fd5b
commit
b73a223dc5
1 changed files with 20 additions and 1 deletions
|
@ -1136,6 +1136,7 @@ gst_d3d11_vp9_dec_register (GstPlugin * plugin, GstD3D11Device * device,
|
|||
gboolean have_profile2 = FALSE;
|
||||
gboolean have_profile0 = FALSE;
|
||||
DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN;
|
||||
GValue vp9_profiles = G_VALUE_INIT;
|
||||
|
||||
have_profile2 = gst_d3d11_decoder_get_supported_decoder_profile (decoder,
|
||||
&profile2_guid, 1, &profile);
|
||||
|
@ -1198,15 +1199,26 @@ gst_d3d11_vp9_dec_register (GstPlugin * plugin, GstD3D11Device * device,
|
|||
}
|
||||
|
||||
sink_caps = gst_caps_from_string ("video/x-vp9, "
|
||||
"framerate = " GST_VIDEO_FPS_RANGE);
|
||||
"alignment = (string) frame, framerate = " GST_VIDEO_FPS_RANGE);
|
||||
src_caps = gst_caps_from_string ("video/x-raw("
|
||||
GST_CAPS_FEATURE_MEMORY_D3D11_MEMORY "), "
|
||||
"framerate = " GST_VIDEO_FPS_RANGE ";"
|
||||
"video/x-raw, " "framerate = " GST_VIDEO_FPS_RANGE);
|
||||
|
||||
g_value_init (&vp9_profiles, GST_TYPE_LIST);
|
||||
|
||||
if (have_profile0) {
|
||||
GValue vp9_profile_val = G_VALUE_INIT;
|
||||
|
||||
g_value_init (&vp9_profile_val, G_TYPE_STRING);
|
||||
g_value_set_string (&vp9_profile_val, "0");
|
||||
gst_value_list_append_and_take_value (&vp9_profiles, &vp9_profile_val);
|
||||
}
|
||||
|
||||
if (have_profile2) {
|
||||
GValue format_list = G_VALUE_INIT;
|
||||
GValue format_value = G_VALUE_INIT;
|
||||
GValue vp9_profile_val = G_VALUE_INIT;
|
||||
|
||||
g_value_init (&format_list, GST_TYPE_LIST);
|
||||
|
||||
|
@ -1220,10 +1232,17 @@ gst_d3d11_vp9_dec_register (GstPlugin * plugin, GstD3D11Device * device,
|
|||
|
||||
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 {
|
||||
gst_caps_set_simple (src_caps, "format", G_TYPE_STRING, "NV12", NULL);
|
||||
}
|
||||
|
||||
gst_caps_set_value (sink_caps, "profile", &vp9_profiles);
|
||||
g_value_unset (&vp9_profiles);
|
||||
|
||||
/* To cover both landscape and portrait, select max value */
|
||||
resolution = MAX (max_width, max_height);
|
||||
gst_caps_set_simple (sink_caps,
|
||||
|
|
Loading…
Reference in a new issue