forked from obsproject/obs-studio
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
obs-ffmpeg: Use Libva in FFmpeg VA-API
Libva is directly used to check if DRI devices support H264 encoding.
- Loading branch information
Showing
6 changed files
with
440 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# * Try to find Libva, once done this will define | ||
# | ||
# * LIBVA_FOUND - system has Libva | ||
# * LIBVA_INCLUDE_DIRS - the Libva include directory | ||
# * LIBVA_LIBRARIES - the libraries needed to use Libva | ||
# * LIBVA_DEFINITIONS - Compiler switches required for using Libva | ||
|
||
# Use pkg-config to get the directories and then use these values in the | ||
# find_path() and find_library() calls | ||
|
||
find_package(PkgConfig QUIET) | ||
if(PKG_CONFIG_FOUND) | ||
pkg_check_modules(_LIBVA libva) | ||
endif() | ||
|
||
find_path( | ||
LIBVA_INCLUDE_DIR | ||
NAMES va.h | ||
HINTS ${_LIBVA_INCLUDE_DIRS} | ||
PATHS /usr/include /usr/local/include /opt/local/include | ||
PATH_SUFFIXES va/) | ||
|
||
find_library( | ||
LIBVA_LIB | ||
NAMES ${_LIBVA_LIBRARIES} libva | ||
HINTS ${_LIBVA_LIBRARY_DIRS} | ||
PATHS /usr/lib /usr/local/lib /opt/local/lib) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(Libva REQUIRED_VARS LIBVA_LIB | ||
LIBVA_INCLUDE_DIR) | ||
mark_as_advanced(LIBVA_INCLUDE_DIR LIBVA_LIB) | ||
|
||
if(LIBVA_FOUND) | ||
set(LIBVA_INCLUDE_DIRS ${LIBVA_INCLUDE_DIR}) | ||
set(LIBVA_LIBRARIES ${LIBVA_LIB}) | ||
|
||
if(NOT TARGET Libva::va) | ||
if(IS_ABSOLUTE "${LIBVA_LIBRARIES}") | ||
add_library(Libva::va UNKNOWN IMPORTED) | ||
set_target_properties(Libva::va PROPERTIES IMPORTED_LOCATION | ||
"${LIBVA_LIBRARIES}") | ||
else() | ||
add_library(Libva::va INTERFACE IMPORTED) | ||
set_target_properties(Libva::va PROPERTIES IMPORTED_LIBNAME | ||
"${LIBVA_LIBRARIES}") | ||
endif() | ||
endif() | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.