va: Use va_get_surface_usage_hint() to detect the modifiers

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5210>
This commit is contained in:
He Junyan 2023-08-21 16:50:39 +08:00 committed by Víctor Manuel Jáquez Leal
parent 8399bc2521
commit 696d81f6f8

View file

@ -25,6 +25,7 @@
#include "gstvacaps.h" #include "gstvacaps.h"
#include <gst/va/gstvavideoformat.h> #include <gst/va/gstvavideoformat.h>
#include <gst/va/vasurfaceimage.h>
#include <va/va_drmcommon.h> #include <va/va_drmcommon.h>
#include "gstvadisplay_priv.h" #include "gstvadisplay_priv.h"
@ -219,23 +220,8 @@ gst_va_create_dma_caps (GstVaDisplay * display, VAEntrypoint entrypoint,
GstCaps *caps = NULL; GstCaps *caps = NULL;
guint i; guint i;
switch (entrypoint) { usage_hint = va_get_surface_usage_hint (display,
case VAEntrypointVLD: entrypoint, GST_PAD_UNKNOWN, TRUE);
usage_hint = VA_SURFACE_ATTRIB_USAGE_HINT_DECODER;
break;
case VAEntrypointEncSlice:
case VAEntrypointEncSliceLP:
case VAEntrypointEncPicture:
usage_hint = VA_SURFACE_ATTRIB_USAGE_HINT_ENCODER;
break;
case VAEntrypointVideoProc:
usage_hint = VA_SURFACE_ATTRIB_USAGE_HINT_VPP_READ |
VA_SURFACE_ATTRIB_USAGE_HINT_VPP_WRITE;
break;
default:
g_assert_not_reached ();
break;
}
drm_formats_str = g_ptr_array_new_with_free_func (g_free); drm_formats_str = g_ptr_array_new_with_free_func (g_free);