Add X11 VAAPI decoder

This commit is contained in:
Iwan Timmer committed 2017-06-17 12:32:33 +02:00
1 parent 2c35e70cc0
commit 4415836579
9 files changed
+204 -43

No files matched your search

+23 -8
View File
@@ -21,20 +21,26 @@ pkg_check_modules(SDL sdl2>=2.0.4)
pkg_check_modules(AVCODEC libavcodec)
pkg_check_modules(AVUTIL libavutil)
pkg_check_modules(XLIB x11)
pkg_check_modules(LIBVA vdpau)
pkg_check_modules(VDPAU vdpau)
pkg_check_modules(LIBVA libva)
pkg_check_modules(LIBVA_X11 libva-x11)
pkg_check_modules(PULSE libpulse-simple)
pkg_check_modules(CEC libcec>=3.0.0)
pkg_check_modules(EGL egl)
pkg_check_modules(GLES glesv2)
set(VDPAU_FOUND FALSE)
set(VDPAU_ACCEL_FOUND FALSE)
set(VA_ACCEL_FOUND FALSE)
set(SOFTWARE_FOUND FALSE)
if(AVCODEC_FOUND AND AVUTIL_FOUND)
if(EGL_FOUND AND GLES_FOUND AND XLIB_FOUND)
set(X11_FOUND TRUE)
if(XLIB_FOUND AND LIBVA_FOUND)
set(VDPAU_FOUND TRUE)
if(VDPAU_FOUND)
set(VDPAU_ACCEL_FOUND TRUE)
endif()
if (LIBVA_FOUND AND LIBVA_X11_FOUND)
set(VA_ACCEL_FOUND TRUE)
endif()
endif()
if(SDL_FOUND OR X11_FOUND)
@@ -61,11 +67,16 @@ if (SOFTWARE_FOUND)
list(APPEND MOONLIGHT_DEFINITIONS HAVE_X11)
list(APPEND MOONLIGHT_OPTIONS X11)
endif()
if(VDPAU_FOUND)
if(VDPAU_ACCEL_FOUND)
list(APPEND SRC_LIST ./src/video/ffmpeg_vdpau.c)
list(APPEND MOONLIGHT_DEFINITIONS HAVE_VDPAU)
list(APPEND MOONLIGHT_OPTIONS VDPAU)
endif()
if(VA_ACCEL_FOUND)
list(APPEND SRC_LIST ./src/video/ffmpeg_vaapi.c)
list(APPEND MOONLIGHT_DEFINITIONS HAVE_VAAPI)
list(APPEND MOONLIGHT_OPTIONS VAAPI)
endif()
endif()
if (AMLOGIC_FOUND OR BROADCOM_FOUND OR FREESCALE_FOUND OR X11_FOUND)
@@ -147,9 +158,13 @@ endif()
if (SOFTWARE_FOUND)
target_include_directories(moonlight PRIVATE ${AVCODEC_INCLUDE_DIRS} ${AVUTIL_INCLUDE_DIRS})
target_link_libraries(moonlight ${AVCODEC_LIBRARIES} ${AVUTIL_LIBRARIES})
if(VDPAU_FOUND)
target_include_directories(moonlight PRIVATE ${XLIB_INCLUDE_DIRS} ${LIBVA_INCLUDE_DIRS})
target_link_libraries(moonlight ${XLIB_LIBRARIES} ${LIBVA_LIBRARIES})
if(VDPAU_ACCEL_FOUND)
target_include_directories(moonlight PRIVATE ${VDPAU_INCLUDE_DIRS})
target_link_libraries(moonlight ${VDPAU_LIBRARIES})
endif()
if(VA_ACCEL_FOUND)
target_include_directories(moonlight PRIVATE ${LIBVA_INCLUDE_DIRS} ${LIBVA_X11_INCLUDE_DIRS})
target_link_libraries(moonlight ${LIBVA_LIBRARIES} ${LIBVA_X11_LIBRARIES})
endif()
endif()