diff options
author | Haihao Xiang <haihao.xiang@intel.com> | 2021-01-27 12:05:44 +0800 |
---|---|---|
committer | GStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2021-01-29 14:08:42 +0000 |
commit | 4ff4bcd725290c8f1a52e791496f164c3090ecaa (patch) | |
tree | 442c4f3fa6a3ceff6c9c3848248fc676b1e82e1c /gst/vaapi | |
parent | 85284f4aacc9cfc059c59aa033166fedc247e117 (diff) |
libs: display: drm: support gst.vaapi.app.Display context for drm backend
Attributes for drm backend:
- va-display : ponter of VADisplay
- drm-device-fd : the DRM device file descriptor
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/409>
Diffstat (limited to 'gst/vaapi')
-rw-r--r-- | gst/vaapi/gstvaapivideocontext.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gst/vaapi/gstvaapivideocontext.c b/gst/vaapi/gstvaapivideocontext.c index 2528ff37..bd3db01d 100644 --- a/gst/vaapi/gstvaapivideocontext.c +++ b/gst/vaapi/gstvaapivideocontext.c @@ -34,6 +34,9 @@ #if USE_WAYLAND #include <gst/vaapi/gstvaapidisplay_wayland.h> #endif +#if USE_DRM +#include <gst/vaapi/gstvaapidisplay_drm.h> +#endif GST_DEBUG_CATEGORY_STATIC (GST_CAT_CONTEXT); @@ -117,6 +120,15 @@ gst_vaapi_video_context_get_display (GstContext * context, gboolean app_context, } } #endif +#if USE_DRM + if (!display) { + gint fd = -1; + if (gst_structure_get (structure, "drm-device-fd", G_TYPE_INT, &fd, + NULL)) { + display = gst_vaapi_display_drm_new_with_va_display (va_display, fd); + } + } +#endif _init_context_debug (); |