Skip to content
Permalink
Browse files

[libva] Better detection of system libva (h265, vp9,...)

  • Loading branch information...
mean
mean committed Oct 16, 2016
1 parent e9989d1 commit ff92a4e1c16646b1bb1dd06d80c1c61481559dea
@@ -2,7 +2,19 @@
# libva
# We only need header for libva
# as it is including its own dynlinker
########################################
#######################################
# Check if it options
MACRO(vaCheck fileToCompile varToSet title)
ADM_COMPILE(${fileToCompile} "" "${LIBVA_INCLUDE_DIR}" "va" OUTPUT_IS_OK vaOutput)
MESSAGE(STATUS "Checking for ${title}, result is ${OUTPUT_IS_OK}")
IF(OUTPUT_IS_OK)
MESSAGE(STATUS "${title} is supported")
SET(LIBVA_CFLAGS ${LIBVA_CFLAGS} -D${varToSet})
ELSE(OUTPUT_IS_OK)
MESSAGE(STATUS "${title} is not supported (${vaOutput})")
ENDIF(OUTPUT_IS_OK)
ENDMACRO(vaCheck fileToCompile varToSet title)
#
MACRO(checkLibVA)
if (UNIX)
IF (NOT LIBVA_CHECKED)
@@ -11,26 +23,33 @@ MACRO(checkLibVA)
MESSAGE(STATUS "Checking for LIBVA")
MESSAGE(STATUS "*******************")

IF (LIBVA)
IF (LIBVA)

FIND_HEADER_AND_LIB(LIBVA va/va.h )

IF (LIBVA_FOUND)
MESSAGE(STATUS "Checking it is the right version...")
ADM_COMPILE(libva.cpp "" "${LIBVA_INCLUDE_DIR}" "va" LIBVA_ERROR LIBVA_COMPILE_OUTPUT)
IF( LIBVA_ERROR)
ADM_COMPILE(libva.cpp "" "${LIBVA_INCLUDE_DIR}" "va" LIBVA_COMPILED LIBVA_COMPILE_OUTPUT)
IF( LIBVA_COMPILED)
SET(LIBVA_FOUND 1)
SET(USE_LIBVA 1)
SET(LIBVA_INCLUDE_DIR "${LIBVA_INCLUDE_DIR}")
ELSE( LIBVA_ERROR)
MESSAGE(STATUS " yes")
# Check if it supports HEVC
vaCheck(libva_hevcdec.cpp LIBVA_HEVC_DEC "HEVC decoder")
# VP8
vaCheck(libva_hevcdec.cpp LIBVA_VP9_DEC "VP9 decoder")
# Failsafe
vaCheck(libva_dummy.cpp LIBVA_DUMMY_DEC "DUMMY decoder")
ELSE( LIBVA_COMPILED)
SET(LIBVA_FOUND 0)
MESSAGE(STATUS "Libva compile check failed")
MESSAGE(STATUS "${LIBVA_COMPILE_OUTPUT}")
ENDIF( LIBVA_ERROR)
ENDIF( LIBVA_COMPILED)

ENDIF (LIBVA_FOUND)

PRINT_LIBRARY_INFO("LIBVA" LIBVA_FOUND "${LIBVA_INCLUDE_DIR}" "${LIBVA_LIBRARY_DIR}")
MESSAGE(STATUS "LibVA cflags=<${LIBVA_CFLAGS}>")
PRINT_LIBRARY_INFO("LIBVA" LIBVA_FOUND "${LIBVA_INCLUDE_DIR},${LIBVA_CFLAGS}" "${LIBVA_LIBRARY_DIR}")
ELSE (LIBVA)
MESSAGE("${MSG_DISABLE_OPTION}")
ENDIF (LIBVA)
@@ -0,0 +1,10 @@
#include <string.h>
#include <stdio.h>
#include <va/va.h>
#error fail safe
int main(int argc, char **argv)
{
lfdkmlfml,f
int attr=VAProfileHEVCMain;
return 0;
}
@@ -0,0 +1,9 @@
#include <string.h>
#include <stdio.h>
#include <va/va.h>

int main(int argc, char **argv)
{
int attr=VAProfileHEVCMain;
return 0;
}
@@ -0,0 +1,9 @@
#include <string.h>
#include <stdio.h>
#include <va/va.h>

int main(int argc, char **argv)
{
int attr=VAPRofileVP9Profile3;
return 0;
}

0 comments on commit ff92a4e

Please sign in to comment.
You can’t perform that action at this time.