Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC
Manage
Activity
Members
Labels
Plan
Issues
4k
Issue boards
Milestones
Code
Merge requests
455
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLC
Commits
14ba7d2d
Commit
14ba7d2d
authored
7 years ago
by
Thomas Guillem
Browse files
Options
Downloads
Patches
Plain Diff
gl: vaapi: add DRM support
Favor DRM and use X11/WAYLAND if it's not available. Fixes
#18445
parent
040316e9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/video_output/Makefile.am
+4
-0
4 additions, 0 deletions
modules/video_output/Makefile.am
modules/video_output/opengl/converter_vaapi.c
+35
-0
35 additions, 0 deletions
modules/video_output/opengl/converter_vaapi.c
with
39 additions
and
0 deletions
modules/video_output/Makefile.am
+
4
−
0
View file @
14ba7d2d
...
...
@@ -40,6 +40,10 @@ OPENGL_COMMONLIBS += $(LIBVA_X11_LIBS) $(X_LIBS) $(X_PRE_LIBS) -lX11
OPENGL_COMMONCFLAGS
+=
-DHAVE_VA_X11
endif
endif
if
HAVE_VAAPI_DRM
OPENGL_COMMONLIBS
+=
$(
LIBVA_DRM_LIBS
)
OPENGL_COMMONCFLAGS
+=
-DHAVE_VA_DRM
endif
endif
endif
...
...
This diff is collapsed.
Click to expand it.
modules/video_output/opengl/converter_vaapi.c
+
35
−
0
View file @
14ba7d2d
...
...
@@ -41,6 +41,12 @@
# include <vlc_xlib.h>
#endif
#ifdef HAVE_VA_DRM
# include <va/va_drm.h>
# include <vlc_fs.h>
# include <fcntl.h>
#endif
#if defined(USE_OPENGL_ES2)
# include <GLES2/gl2ext.h>
#endif
...
...
@@ -354,6 +360,13 @@ x11_native_destroy_cb(VANativeDisplay native)
XCloseDisplay
(
native
);
}
#endif
#ifdef HAVE_VA_DRM
static
void
drm_native_destroy_cb
(
VANativeDisplay
native
)
{
vlc_close
((
intptr_t
)
native
);
}
#endif
int
opengl_tex_converter_vaapi_init
(
opengl_tex_converter_t
*
tc
)
...
...
@@ -370,6 +383,28 @@ opengl_tex_converter_vaapi_init(opengl_tex_converter_t *tc)
if
(
eglexts
==
NULL
||
!
HasExtension
(
eglexts
,
"EGL_EXT_image_dma_buf_import"
))
return
VLC_EGENERIC
;
#ifdef HAVE_VA_DRM
static
const
char
const
*
drm_device_paths
[]
=
{
"/dev/dri/renderD128"
,
"/dev/dri/card0"
};
for
(
int
i
=
0
;
ARRAY_SIZE
(
drm_device_paths
);
i
++
)
{
int
drm_fd
=
vlc_open
(
drm_device_paths
[
i
],
O_RDWR
);
if
(
drm_fd
==
-
1
)
continue
;
VADisplay
dpy
=
vaGetDisplayDRM
(
drm_fd
);
if
(
dpy
)
return
tc_vaegl_init
(
tc
,
dpy
,
(
VANativeDisplay
)
(
intptr_t
)
drm_fd
,
drm_native_destroy_cb
);
vlc_close
(
drm_fd
);
}
/* Fallback to X11 or WAYLAND */
#endif
switch
(
tc
->
gl
->
surface
->
type
)
{
#ifdef HAVE_VA_X11
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment