autotools: Rewrite configuration in a minimalistic fashion
Drop the per-codec options while at it, since we'll soon include a copy of the associated headers. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
This commit is contained in:
+31
-3
@@ -1,6 +1,34 @@
|
|||||||
AUTOMAKE_OPTIONS = foreign
|
# Copyright (C) 2019 Bootlin
|
||||||
|
#
|
||||||
|
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
# copy of this software and associated documentation files (the
|
||||||
|
# "Software"), to deal in the Software without restriction, including
|
||||||
|
# without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
# distribute, sub license, and/or sell copies of the Software, and to
|
||||||
|
# permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
# the following conditions:
|
||||||
|
#
|
||||||
|
# The above copyright notice and this permission notice (including the
|
||||||
|
# next paragraph) shall be included in all copies or substantial portions
|
||||||
|
# of the Software.
|
||||||
|
#
|
||||||
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||||
|
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
|
||||||
|
# IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
|
||||||
|
# ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||||
|
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
SUBDIRS = src
|
SUBDIRS = src
|
||||||
|
|
||||||
MAINTAINERCLEANFILES = aclocal.m4 compile config.guess config.sub configure \
|
MAINTAINERCLEANFILES = aclocal.m4 \
|
||||||
depcomp install-sh ltmain.sh Makefile.in missing
|
compile \
|
||||||
|
config.guess \
|
||||||
|
config.sub \
|
||||||
|
configure \
|
||||||
|
depcomp \
|
||||||
|
install-sh \
|
||||||
|
ltmain.sh \
|
||||||
|
Makefile.in \
|
||||||
|
missing
|
||||||
|
|||||||
+5
-4
@@ -1,7 +1,8 @@
|
|||||||
#! /bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
autoreconf -v --install
|
autoreconf -vi
|
||||||
|
|
||||||
if test -z "$NOCONFIGURE"; then
|
if [ -z "$NOCONFIGURE" ]
|
||||||
./configure "$@"
|
then
|
||||||
|
./configure "$@"
|
||||||
fi
|
fi
|
||||||
|
|||||||
+39
-140
@@ -1,154 +1,53 @@
|
|||||||
# intel-driver package version number
|
# Copyright (C) 2019 Bootlin
|
||||||
m4_define([v4l2_request_major_version], [1])
|
#
|
||||||
m4_define([v4l2_request_minor_version], [0])
|
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
m4_define([v4l2_request_micro_version], [0])
|
# copy of this software and associated documentation files (the
|
||||||
m4_define([v4l2_request_pre_version], [0])
|
# "Software"), to deal in the Software without restriction, including
|
||||||
m4_define([v4l2_request_version],
|
# without limitation the rights to use, copy, modify, merge, publish,
|
||||||
[v4l2_request_major_version.v4l2_request_minor_version.v4l2_request_micro_version])
|
# distribute, sub license, and/or sell copies of the Software, and to
|
||||||
m4_if(v4l2_request_pre_version, [0], [], [
|
# permit persons to whom the Software is furnished to do so, subject to
|
||||||
m4_append([v4l2_request_version], v4l2_request_pre_version, [.pre])
|
# the following conditions:
|
||||||
])
|
#
|
||||||
|
# The above copyright notice and this permission notice (including the
|
||||||
# libva minimum version requirement
|
# next paragraph) shall be included in all copies or substantial portions
|
||||||
m4_define([libva_package_version], [1.2.2])
|
# of the Software.
|
||||||
m4_define([va_api_version], [0.34.0])
|
#
|
||||||
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||||
# libdrm minimum version requirement
|
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
m4_define([libdrm_version], [2.4.45])
|
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
|
||||||
|
# IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
|
||||||
|
# ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||||
|
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
AC_PREREQ([2.60])
|
AC_PREREQ([2.60])
|
||||||
AC_INIT([liva_wrapper], [v4l2_request_version],
|
AC_INIT([libva-v4l2-request], [1.0.0], [paul.kocialkowski@bootlin.com])
|
||||||
[florent.revest@free-electrons.com], [v4l2_request])
|
AM_INIT_AUTOMAKE([dist-bzip2 subdir-objects foreign])
|
||||||
AC_CONFIG_SRCDIR([Makefile.am])
|
|
||||||
AM_INIT_AUTOMAKE([1.9 tar-ustar])
|
|
||||||
|
|
||||||
AC_CONFIG_HEADERS([src/autoconfig.h])
|
|
||||||
|
|
||||||
V4L2_REQUEST_MAJOR_VERSION=v4l2_request_major_version
|
|
||||||
V4L2_REQUEST_MINOR_VERSION=v4l2_request_minor_version
|
|
||||||
V4L2_REQUEST_MICRO_VERSION=v4l2_request_micro_version
|
|
||||||
AC_DEFINE([V4L2_REQUEST_MAJOR_VERSION], [v4l2_request_major_version], [Major version of the driver])
|
|
||||||
AC_DEFINE([V4L2_REQUEST_MINOR_VERSION], [v4l2_request_minor_version], [Minor version of the driver])
|
|
||||||
AC_DEFINE([V4L2_REQUEST_MICRO_VERSION], [v4l2_request_micro_version], [Micro version of the driver])
|
|
||||||
AC_DEFINE([V4L2_REQUEST_PRE_VERSION], [v4l2_request_pre_version], [Preversion of the driver])
|
|
||||||
|
|
||||||
V4L2_REQUEST_LT_LDFLAGS="-avoid-version"
|
|
||||||
AC_SUBST(V4L2_REQUEST_LT_LDFLAGS)
|
|
||||||
|
|
||||||
dnl Use pretty build output with automake >= 1.11
|
|
||||||
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], [
|
|
||||||
AM_DEFAULT_VERBOSITY=1
|
|
||||||
AC_SUBST(AM_DEFAULT_VERBOSITY)
|
|
||||||
])
|
|
||||||
|
|
||||||
|
AC_CONFIG_SRCDIR([src/request.c])
|
||||||
|
AC_ENABLE_SHARED
|
||||||
AC_DISABLE_STATIC
|
AC_DISABLE_STATIC
|
||||||
AC_PROG_LIBTOOL
|
AC_LANG_C
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
AM_PROG_CC_C_O
|
AC_PROG_LIBTOOL
|
||||||
|
AC_PROG_INSTALL
|
||||||
AM_PROG_AS
|
AM_PROG_AS
|
||||||
|
|
||||||
AC_C_BIGENDIAN
|
PKG_CHECK_MODULES([LIBVA], [libva >= 1.4.0])
|
||||||
AC_HEADER_STDC
|
PKG_CHECK_MODULES([DRM], [libdrm >= 2.4.52])
|
||||||
AC_SYS_LARGEFILE
|
|
||||||
AC_CHECK_LIB([m], [sin])
|
|
||||||
|
|
||||||
LIBVA_PACKAGE_VERSION=libva_package_version
|
#LIBS="$LIBS $DRM_LIBS"
|
||||||
AC_SUBST(LIBVA_PACKAGE_VERSION)
|
#CFLAGS="$CFLAGS $DRM_CFLAGS $LIBVA_CFLAGS"
|
||||||
|
|
||||||
dnl Check for recent enough DRM
|
|
||||||
LIBDRM_VERSION=libdrm_version
|
|
||||||
PKG_CHECK_MODULES([DRM], [libdrm >= $LIBDRM_VERSION])
|
|
||||||
AC_SUBST(LIBDRM_VERSION)
|
|
||||||
|
|
||||||
dnl Check for VA-API
|
|
||||||
PKG_CHECK_MODULES(LIBVA_DEPS, [libva >= va_api_version])
|
|
||||||
|
|
||||||
dnl Check for VA/DRM API
|
|
||||||
PKG_CHECK_MODULES(LIBVA_DRM_DEPS, [libva-drm],
|
|
||||||
[AC_DEFINE([HAVE_VA_DRM], [1], [Defined to 1 if VA/DRM API is enabled])],
|
|
||||||
[USE_DRM="no"])
|
|
||||||
|
|
||||||
# Check for <drm_fourcc.h>
|
|
||||||
if test "$USE_DRM" = "yes"; then
|
|
||||||
saved_CPPFLAGS="$CPPFLAGS"
|
|
||||||
CPPFLAGS="$CPPFLAGS $DRM_CFLAGS"
|
|
||||||
AC_CHECK_HEADERS([drm_fourcc.h], [:], [USE_DRM="no"])
|
|
||||||
CPPFLAGS="$saved_CPPFLAGS"
|
|
||||||
fi
|
|
||||||
|
|
||||||
AC_MSG_CHECKING([for MPEG2 support])
|
|
||||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
|
||||||
#include <linux/videodev2.h>
|
|
||||||
#ifndef V4L2_PIX_FMT_MPEG2_SLICE
|
|
||||||
# error macro not defined
|
|
||||||
#endif
|
|
||||||
]])], [WITH_MPEG2="yes"], [WITH_MPEG2="no"])
|
|
||||||
AC_MSG_RESULT([$WITH_MPEG2])
|
|
||||||
AM_CONDITIONAL([WITH_MPEG2], [test "$WITH_MPEG2" = "yes"])
|
|
||||||
if test "$WITH_MPEG2" = "yes"; then
|
|
||||||
AC_DEFINE([WITH_MPEG2], [1], [MPEG2 support detected])
|
|
||||||
fi
|
|
||||||
|
|
||||||
AC_MSG_CHECKING([for H.264 support])
|
|
||||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
|
||||||
#include <linux/videodev2.h>
|
|
||||||
#ifndef V4L2_PIX_FMT_H264_SLICE
|
|
||||||
# error macro not defined
|
|
||||||
#endif
|
|
||||||
]])], [WITH_H264="yes"], [WITH_H264="no"])
|
|
||||||
AC_MSG_RESULT([$WITH_H264])
|
|
||||||
AM_CONDITIONAL([WITH_H264], [test "$WITH_H264" = "yes"])
|
|
||||||
if test "$WITH_H264" = "yes"; then
|
|
||||||
AC_DEFINE([WITH_H264], [1], [H.264 support detected])
|
|
||||||
fi
|
|
||||||
|
|
||||||
AC_MSG_CHECKING([for H.265 support])
|
|
||||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
|
||||||
#include <linux/videodev2.h>
|
|
||||||
#ifndef V4L2_PIX_FMT_HEVC_SLICE
|
|
||||||
# error macro not defined
|
|
||||||
#endif
|
|
||||||
]])], [WITH_H265="yes"], [WITH_H265="no"])
|
|
||||||
AC_MSG_RESULT([$WITH_H265])
|
|
||||||
AM_CONDITIONAL([WITH_H265], [test "$WITH_H265" = "yes"])
|
|
||||||
if test "$WITH_H265" = "yes"; then
|
|
||||||
AC_DEFINE([WITH_H265], [1], [H.265 support detected])
|
|
||||||
fi
|
|
||||||
|
|
||||||
VA_VERSION=`$PKG_CONFIG --modversion libva`
|
VA_VERSION=`$PKG_CONFIG --modversion libva`
|
||||||
VA_MAJOR_VERSION=`echo "$VA_VERSION" | cut -d'.' -f1`
|
VA_VERSION_MAJOR=`echo "$VA_VERSION" | cut -d'.' -f1`
|
||||||
VA_MINOR_VERSION=`echo "$VA_VERSION" | cut -d'.' -f2`
|
VA_VERSION_MINOR=`echo "$VA_VERSION" | cut -d'.' -f2`
|
||||||
VA_MICRO_VERSION=`echo "$VA_VERSION" | cut -d'.' -f3`
|
|
||||||
VA_VERSION_STR="$VA_VERSION"
|
|
||||||
|
|
||||||
va_full_version_int=`expr ${VA_MAJOR_VERSION:-0} "*" 1000000 + \
|
VA_DRIVER_INIT_FUNC="__vaDriverInit_${VA_VERSION_MAJOR}_${VA_VERSION_MINOR}"
|
||||||
${VA_MINOR_VERSION:-0} "*" 10000 + \
|
|
||||||
${VA_MICRO_VERSION:-0} "*" 100 + \
|
|
||||||
0`
|
|
||||||
VA_DRIVER_INIT_FUNC="__vaDriverInit_${VA_MAJOR_VERSION}_${VA_MINOR_VERSION}"
|
|
||||||
AC_DEFINE_UNQUOTED([VA_DRIVER_INIT_FUNC], [$VA_DRIVER_INIT_FUNC],
|
AC_DEFINE_UNQUOTED([VA_DRIVER_INIT_FUNC], [$VA_DRIVER_INIT_FUNC],
|
||||||
[Define driver entry-point])
|
[Driver init function])
|
||||||
|
|
||||||
dnl Check for VA-API drivers path
|
AC_CONFIG_HEADERS([src/autoconfig.h])
|
||||||
AC_MSG_CHECKING([for VA drivers path])
|
AC_CONFIG_FILES([Makefile src/Makefile])
|
||||||
LIBVA_DRIVERS_PATH=`$PKG_CONFIG libva --variable driverdir`
|
|
||||||
if test -z "$LIBVA_DRIVERS_PATH"; then
|
|
||||||
LIBVA_DRIVERS_PATH="/usr/lib/dri/"
|
|
||||||
fi
|
|
||||||
AC_MSG_RESULT([$LIBVA_DRIVERS_PATH])
|
|
||||||
AC_SUBST(LIBVA_DRIVERS_PATH)
|
|
||||||
|
|
||||||
AC_OUTPUT([
|
AC_OUTPUT
|
||||||
Makefile
|
|
||||||
src/Makefile
|
|
||||||
])
|
|
||||||
|
|
||||||
echo
|
|
||||||
echo $PACKAGE configuration summary:
|
|
||||||
echo
|
|
||||||
echo VA-API version ................... : $VA_VERSION_STR
|
|
||||||
echo VA-API drivers path .............. : $LIBVA_DRIVERS_PATH
|
|
||||||
echo H.264 support .................... : $WITH_H264
|
|
||||||
echo H.265 support .................... : $WITH_H265
|
|
||||||
echo MPEG2 support .................... : $WITH_MPEG2
|
|
||||||
echo
|
|
||||||
|
|||||||
+61
-30
@@ -1,36 +1,67 @@
|
|||||||
AM_CPPFLAGS = -DPTHREADS $(DRM_CFLAGS) $(LIBVA_DEPS_CFLAGS)
|
# Copyright (C) 2019 Bootlin
|
||||||
|
#
|
||||||
|
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
# copy of this software and associated documentation files (the
|
||||||
|
# "Software"), to deal in the Software without restriction, including
|
||||||
|
# without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
# distribute, sub license, and/or sell copies of the Software, and to
|
||||||
|
# permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
# the following conditions:
|
||||||
|
#
|
||||||
|
# The above copyright notice and this permission notice (including the
|
||||||
|
# next paragraph) shall be included in all copies or substantial portions
|
||||||
|
# of the Software.
|
||||||
|
#
|
||||||
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||||
|
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
|
||||||
|
# IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
|
||||||
|
# ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||||
|
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
backend_cflags = -Wall -fvisibility=hidden
|
AM_CFLAGS = $(CFLAGS)
|
||||||
backend_ldflags = -module -avoid-version -no-undefined -Wl,--no-undefined
|
|
||||||
backend_libs = -lpthread -ldl $(DRM_LIBS) $(LIBVA_DEPS_LIBS)
|
|
||||||
|
|
||||||
backend_c = request.c object_heap.c config.c surface.c context.c buffer.c \
|
v4l2_request_drv_video_la_SOURCES = request.c \
|
||||||
picture.c subpicture.c image.c v4l2.c video.c media.c utils.c
|
request.h \
|
||||||
|
object_heap.c \
|
||||||
if WITH_MPEG2
|
object_heap.h \
|
||||||
backend_c += mpeg2.c
|
config.c \
|
||||||
endif
|
config.h \
|
||||||
|
surface.c \
|
||||||
if WITH_H264
|
surface.h \
|
||||||
backend_c += h264.c
|
context.c \
|
||||||
endif
|
context.h \
|
||||||
|
buffer.c \
|
||||||
if WITH_H265
|
buffer.h \
|
||||||
backend_c += h265.c
|
picture.c \
|
||||||
endif
|
picture.h \
|
||||||
|
subpicture.c \
|
||||||
backend_s = tiled_yuv.S
|
subpicture.h \
|
||||||
|
image.c \
|
||||||
backend_h = request.h object_heap.h config.h surface.h context.h buffer.h \
|
image.h \
|
||||||
mpeg2.h picture.h subpicture.h image.h v4l2.h video.h media.h utils.h \
|
utils.c \
|
||||||
tiled_yuv.h h264.h h265.h
|
utils.h \
|
||||||
|
tiled_yuv.S \
|
||||||
|
tiled_yuv.h \
|
||||||
|
video.c \
|
||||||
|
video.h \
|
||||||
|
media.c \
|
||||||
|
media.h \
|
||||||
|
v4l2.c \
|
||||||
|
v4l2.h \
|
||||||
|
mpeg2.c \
|
||||||
|
mpeg2.h \
|
||||||
|
h264.c \
|
||||||
|
h264.h \
|
||||||
|
h265.c \
|
||||||
|
h265.h
|
||||||
|
|
||||||
|
v4l2_request_drv_video_la_CFLAGS = $(DRM_CFLAGS) $(LIBVA_CFLAGS)
|
||||||
|
v4l2_request_drv_video_la_LDFLAGS = -module -avoid-version -no-undefined \
|
||||||
|
-Wl,--no-undefined
|
||||||
|
v4l2_request_drv_video_la_LIBADD = $(DRM_LIBS) $(LIBVA_LIBS)
|
||||||
v4l2_request_drv_video_la_LTLIBRARIES = v4l2_request_drv_video.la
|
v4l2_request_drv_video_la_LTLIBRARIES = v4l2_request_drv_video.la
|
||||||
v4l2_request_drv_video_ladir = $(LIBVA_DRIVERS_PATH)
|
v4l2_request_drv_video_ladir = /usr/lib/dri/
|
||||||
v4l2_request_drv_video_la_CFLAGS = $(backend_cflags)
|
|
||||||
v4l2_request_drv_video_la_LDFLAGS = $(backend_ldflags)
|
|
||||||
v4l2_request_drv_video_la_LIBADD = $(backend_libs)
|
|
||||||
v4l2_request_drv_video_la_SOURCES = $(backend_c) $(backend_s)
|
|
||||||
noinst_HEADERS = $(backend_h)
|
|
||||||
|
|
||||||
MAINTAINERCLEANFILES = Makefile.in autoconfig.h.in
|
MAINTAINERCLEANFILES = Makefile.in autoconfig.h.in
|
||||||
|
|||||||
@@ -114,7 +114,6 @@ VAStatus RequestQueryConfigProfiles(VADriverContextP context,
|
|||||||
unsigned int index = 0;
|
unsigned int index = 0;
|
||||||
bool found;
|
bool found;
|
||||||
|
|
||||||
#ifdef WITH_MPEG2
|
|
||||||
found = v4l2_find_format(driver_data->video_fd,
|
found = v4l2_find_format(driver_data->video_fd,
|
||||||
V4L2_BUF_TYPE_VIDEO_OUTPUT,
|
V4L2_BUF_TYPE_VIDEO_OUTPUT,
|
||||||
V4L2_PIX_FMT_MPEG2_SLICE);
|
V4L2_PIX_FMT_MPEG2_SLICE);
|
||||||
@@ -122,9 +121,7 @@ VAStatus RequestQueryConfigProfiles(VADriverContextP context,
|
|||||||
profiles[index++] = VAProfileMPEG2Simple;
|
profiles[index++] = VAProfileMPEG2Simple;
|
||||||
profiles[index++] = VAProfileMPEG2Main;
|
profiles[index++] = VAProfileMPEG2Main;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef WITH_H264
|
|
||||||
found = v4l2_find_format(driver_data->video_fd,
|
found = v4l2_find_format(driver_data->video_fd,
|
||||||
V4L2_BUF_TYPE_VIDEO_OUTPUT,
|
V4L2_BUF_TYPE_VIDEO_OUTPUT,
|
||||||
V4L2_PIX_FMT_H264_SLICE);
|
V4L2_PIX_FMT_H264_SLICE);
|
||||||
@@ -135,15 +132,12 @@ VAStatus RequestQueryConfigProfiles(VADriverContextP context,
|
|||||||
profiles[index++] = VAProfileH264MultiviewHigh;
|
profiles[index++] = VAProfileH264MultiviewHigh;
|
||||||
profiles[index++] = VAProfileH264StereoHigh;
|
profiles[index++] = VAProfileH264StereoHigh;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef WITH_H265
|
|
||||||
found = v4l2_find_format(driver_data->video_fd,
|
found = v4l2_find_format(driver_data->video_fd,
|
||||||
V4L2_BUF_TYPE_VIDEO_OUTPUT,
|
V4L2_BUF_TYPE_VIDEO_OUTPUT,
|
||||||
V4L2_PIX_FMT_HEVC_SLICE);
|
V4L2_PIX_FMT_HEVC_SLICE);
|
||||||
if (found && index < (V4L2_REQUEST_MAX_CONFIG_ATTRIBUTES - 1))
|
if (found && index < (V4L2_REQUEST_MAX_CONFIG_ATTRIBUTES - 1))
|
||||||
profiles[index++] = VAProfileHEVCMain;
|
profiles[index++] = VAProfileHEVCMain;
|
||||||
#endif
|
|
||||||
|
|
||||||
*profiles_count = index;
|
*profiles_count = index;
|
||||||
|
|
||||||
|
|||||||
@@ -90,14 +90,11 @@ VAStatus RequestCreateContext(VADriverContextP context, VAConfigID config_id,
|
|||||||
|
|
||||||
switch (config_object->profile) {
|
switch (config_object->profile) {
|
||||||
|
|
||||||
#ifdef WITH_MPEG2
|
|
||||||
case VAProfileMPEG2Simple:
|
case VAProfileMPEG2Simple:
|
||||||
case VAProfileMPEG2Main:
|
case VAProfileMPEG2Main:
|
||||||
pixelformat = V4L2_PIX_FMT_MPEG2_SLICE;
|
pixelformat = V4L2_PIX_FMT_MPEG2_SLICE;
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef WITH_H264
|
|
||||||
case VAProfileH264Main:
|
case VAProfileH264Main:
|
||||||
case VAProfileH264High:
|
case VAProfileH264High:
|
||||||
case VAProfileH264ConstrainedBaseline:
|
case VAProfileH264ConstrainedBaseline:
|
||||||
@@ -105,13 +102,10 @@ VAStatus RequestCreateContext(VADriverContextP context, VAConfigID config_id,
|
|||||||
case VAProfileH264StereoHigh:
|
case VAProfileH264StereoHigh:
|
||||||
pixelformat = V4L2_PIX_FMT_H264_SLICE;
|
pixelformat = V4L2_PIX_FMT_H264_SLICE;
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef WITH_H265
|
|
||||||
case VAProfileHEVCMain:
|
case VAProfileHEVCMain:
|
||||||
pixelformat = V4L2_PIX_FMT_HEVC_SLICE;
|
pixelformat = V4L2_PIX_FMT_HEVC_SLICE;
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
status = VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
|
status = VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
|
||||||
|
|||||||
@@ -74,16 +74,13 @@ static VAStatus codec_store_buffer(struct request_data *driver_data,
|
|||||||
|
|
||||||
case VAPictureParameterBufferType:
|
case VAPictureParameterBufferType:
|
||||||
switch (profile) {
|
switch (profile) {
|
||||||
#ifdef WITH_MPEG2
|
|
||||||
case VAProfileMPEG2Simple:
|
case VAProfileMPEG2Simple:
|
||||||
case VAProfileMPEG2Main:
|
case VAProfileMPEG2Main:
|
||||||
memcpy(&surface_object->params.mpeg2.picture,
|
memcpy(&surface_object->params.mpeg2.picture,
|
||||||
buffer_object->data,
|
buffer_object->data,
|
||||||
sizeof(surface_object->params.mpeg2.picture));
|
sizeof(surface_object->params.mpeg2.picture));
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef WITH_H264
|
|
||||||
case VAProfileH264Main:
|
case VAProfileH264Main:
|
||||||
case VAProfileH264High:
|
case VAProfileH264High:
|
||||||
case VAProfileH264ConstrainedBaseline:
|
case VAProfileH264ConstrainedBaseline:
|
||||||
@@ -93,15 +90,12 @@ static VAStatus codec_store_buffer(struct request_data *driver_data,
|
|||||||
buffer_object->data,
|
buffer_object->data,
|
||||||
sizeof(surface_object->params.h264.picture));
|
sizeof(surface_object->params.h264.picture));
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef WITH_H265
|
|
||||||
case VAProfileHEVCMain:
|
case VAProfileHEVCMain:
|
||||||
memcpy(&surface_object->params.h265.picture,
|
memcpy(&surface_object->params.h265.picture,
|
||||||
buffer_object->data,
|
buffer_object->data,
|
||||||
sizeof(surface_object->params.h265.picture));
|
sizeof(surface_object->params.h265.picture));
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -110,7 +104,6 @@ static VAStatus codec_store_buffer(struct request_data *driver_data,
|
|||||||
|
|
||||||
case VASliceParameterBufferType:
|
case VASliceParameterBufferType:
|
||||||
switch (profile) {
|
switch (profile) {
|
||||||
#ifdef WITH_H264
|
|
||||||
case VAProfileH264Main:
|
case VAProfileH264Main:
|
||||||
case VAProfileH264High:
|
case VAProfileH264High:
|
||||||
case VAProfileH264ConstrainedBaseline:
|
case VAProfileH264ConstrainedBaseline:
|
||||||
@@ -120,15 +113,12 @@ static VAStatus codec_store_buffer(struct request_data *driver_data,
|
|||||||
buffer_object->data,
|
buffer_object->data,
|
||||||
sizeof(surface_object->params.h264.slice));
|
sizeof(surface_object->params.h264.slice));
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef WITH_H265
|
|
||||||
case VAProfileHEVCMain:
|
case VAProfileHEVCMain:
|
||||||
memcpy(&surface_object->params.h265.slice,
|
memcpy(&surface_object->params.h265.slice,
|
||||||
buffer_object->data,
|
buffer_object->data,
|
||||||
sizeof(surface_object->params.h265.slice));
|
sizeof(surface_object->params.h265.slice));
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -137,7 +127,6 @@ static VAStatus codec_store_buffer(struct request_data *driver_data,
|
|||||||
|
|
||||||
case VAIQMatrixBufferType:
|
case VAIQMatrixBufferType:
|
||||||
switch (profile) {
|
switch (profile) {
|
||||||
#ifdef WITH_MPEG2
|
|
||||||
case VAProfileMPEG2Simple:
|
case VAProfileMPEG2Simple:
|
||||||
case VAProfileMPEG2Main:
|
case VAProfileMPEG2Main:
|
||||||
memcpy(&surface_object->params.mpeg2.iqmatrix,
|
memcpy(&surface_object->params.mpeg2.iqmatrix,
|
||||||
@@ -145,9 +134,7 @@ static VAStatus codec_store_buffer(struct request_data *driver_data,
|
|||||||
sizeof(surface_object->params.mpeg2.iqmatrix));
|
sizeof(surface_object->params.mpeg2.iqmatrix));
|
||||||
surface_object->params.mpeg2.iqmatrix_set = true;
|
surface_object->params.mpeg2.iqmatrix_set = true;
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef WITH_H264
|
|
||||||
case VAProfileH264Main:
|
case VAProfileH264Main:
|
||||||
case VAProfileH264High:
|
case VAProfileH264High:
|
||||||
case VAProfileH264ConstrainedBaseline:
|
case VAProfileH264ConstrainedBaseline:
|
||||||
@@ -157,16 +144,13 @@ static VAStatus codec_store_buffer(struct request_data *driver_data,
|
|||||||
buffer_object->data,
|
buffer_object->data,
|
||||||
sizeof(surface_object->params.h264.matrix));
|
sizeof(surface_object->params.h264.matrix));
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef WITH_H265
|
|
||||||
case VAProfileHEVCMain:
|
case VAProfileHEVCMain:
|
||||||
memcpy(&surface_object->params.h265.iqmatrix,
|
memcpy(&surface_object->params.h265.iqmatrix,
|
||||||
buffer_object->data,
|
buffer_object->data,
|
||||||
sizeof(surface_object->params.h265.iqmatrix));
|
sizeof(surface_object->params.h265.iqmatrix));
|
||||||
surface_object->params.h265.iqmatrix_set = true;
|
surface_object->params.h265.iqmatrix_set = true;
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -188,16 +172,13 @@ static VAStatus codec_set_controls(struct request_data *driver_data,
|
|||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
switch (profile) {
|
switch (profile) {
|
||||||
#ifdef WITH_MPEG2
|
|
||||||
case VAProfileMPEG2Simple:
|
case VAProfileMPEG2Simple:
|
||||||
case VAProfileMPEG2Main:
|
case VAProfileMPEG2Main:
|
||||||
rc = mpeg2_set_controls(driver_data, context, surface_object);
|
rc = mpeg2_set_controls(driver_data, context, surface_object);
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
return VA_STATUS_ERROR_OPERATION_FAILED;
|
return VA_STATUS_ERROR_OPERATION_FAILED;
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef WITH_H264
|
|
||||||
case VAProfileH264Main:
|
case VAProfileH264Main:
|
||||||
case VAProfileH264High:
|
case VAProfileH264High:
|
||||||
case VAProfileH264ConstrainedBaseline:
|
case VAProfileH264ConstrainedBaseline:
|
||||||
@@ -207,15 +188,12 @@ static VAStatus codec_set_controls(struct request_data *driver_data,
|
|||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
return VA_STATUS_ERROR_OPERATION_FAILED;
|
return VA_STATUS_ERROR_OPERATION_FAILED;
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef WITH_H265
|
|
||||||
case VAProfileHEVCMain:
|
case VAProfileHEVCMain:
|
||||||
rc = h265_set_controls(driver_data, context, surface_object);
|
rc = h265_set_controls(driver_data, context, surface_object);
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
return VA_STATUS_ERROR_OPERATION_FAILED;
|
return VA_STATUS_ERROR_OPERATION_FAILED;
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
|
return VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
|
||||||
|
|||||||
Reference in New Issue
Block a user