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:
Paul Kocialkowski
2019-03-07 10:20:37 +01:00
parent 518d7a0c59
commit e29b04ccc7
7 changed files with 136 additions and 211 deletions
+61 -30
View File
@@ -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
backend_ldflags = -module -avoid-version -no-undefined -Wl,--no-undefined
backend_libs = -lpthread -ldl $(DRM_LIBS) $(LIBVA_DEPS_LIBS)
AM_CFLAGS = $(CFLAGS)
backend_c = request.c object_heap.c config.c surface.c context.c buffer.c \
picture.c subpicture.c image.c v4l2.c video.c media.c utils.c
if WITH_MPEG2
backend_c += mpeg2.c
endif
if WITH_H264
backend_c += h264.c
endif
if WITH_H265
backend_c += h265.c
endif
backend_s = tiled_yuv.S
backend_h = request.h object_heap.h config.h surface.h context.h buffer.h \
mpeg2.h picture.h subpicture.h image.h v4l2.h video.h media.h utils.h \
tiled_yuv.h h264.h h265.h
v4l2_request_drv_video_la_SOURCES = request.c \
request.h \
object_heap.c \
object_heap.h \
config.c \
config.h \
surface.c \
surface.h \
context.c \
context.h \
buffer.c \
buffer.h \
picture.c \
picture.h \
subpicture.c \
subpicture.h \
image.c \
image.h \
utils.c \
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_ladir = $(LIBVA_DRIVERS_PATH)
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)
v4l2_request_drv_video_ladir = /usr/lib/dri/
MAINTAINERCLEANFILES = Makefile.in autoconfig.h.in
-6
View File
@@ -114,7 +114,6 @@ VAStatus RequestQueryConfigProfiles(VADriverContextP context,
unsigned int index = 0;
bool found;
#ifdef WITH_MPEG2
found = v4l2_find_format(driver_data->video_fd,
V4L2_BUF_TYPE_VIDEO_OUTPUT,
V4L2_PIX_FMT_MPEG2_SLICE);
@@ -122,9 +121,7 @@ VAStatus RequestQueryConfigProfiles(VADriverContextP context,
profiles[index++] = VAProfileMPEG2Simple;
profiles[index++] = VAProfileMPEG2Main;
}
#endif
#ifdef WITH_H264
found = v4l2_find_format(driver_data->video_fd,
V4L2_BUF_TYPE_VIDEO_OUTPUT,
V4L2_PIX_FMT_H264_SLICE);
@@ -135,15 +132,12 @@ VAStatus RequestQueryConfigProfiles(VADriverContextP context,
profiles[index++] = VAProfileH264MultiviewHigh;
profiles[index++] = VAProfileH264StereoHigh;
}
#endif
#ifdef WITH_H265
found = v4l2_find_format(driver_data->video_fd,
V4L2_BUF_TYPE_VIDEO_OUTPUT,
V4L2_PIX_FMT_HEVC_SLICE);
if (found && index < (V4L2_REQUEST_MAX_CONFIG_ATTRIBUTES - 1))
profiles[index++] = VAProfileHEVCMain;
#endif
*profiles_count = index;
-6
View File
@@ -90,14 +90,11 @@ VAStatus RequestCreateContext(VADriverContextP context, VAConfigID config_id,
switch (config_object->profile) {
#ifdef WITH_MPEG2
case VAProfileMPEG2Simple:
case VAProfileMPEG2Main:
pixelformat = V4L2_PIX_FMT_MPEG2_SLICE;
break;
#endif
#ifdef WITH_H264
case VAProfileH264Main:
case VAProfileH264High:
case VAProfileH264ConstrainedBaseline:
@@ -105,13 +102,10 @@ VAStatus RequestCreateContext(VADriverContextP context, VAConfigID config_id,
case VAProfileH264StereoHigh:
pixelformat = V4L2_PIX_FMT_H264_SLICE;
break;
#endif
#ifdef WITH_H265
case VAProfileHEVCMain:
pixelformat = V4L2_PIX_FMT_HEVC_SLICE;
break;
#endif
default:
status = VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
-22
View File
@@ -74,16 +74,13 @@ static VAStatus codec_store_buffer(struct request_data *driver_data,
case VAPictureParameterBufferType:
switch (profile) {
#ifdef WITH_MPEG2
case VAProfileMPEG2Simple:
case VAProfileMPEG2Main:
memcpy(&surface_object->params.mpeg2.picture,
buffer_object->data,
sizeof(surface_object->params.mpeg2.picture));
break;
#endif
#ifdef WITH_H264
case VAProfileH264Main:
case VAProfileH264High:
case VAProfileH264ConstrainedBaseline:
@@ -93,15 +90,12 @@ static VAStatus codec_store_buffer(struct request_data *driver_data,
buffer_object->data,
sizeof(surface_object->params.h264.picture));
break;
#endif
#ifdef WITH_H265
case VAProfileHEVCMain:
memcpy(&surface_object->params.h265.picture,
buffer_object->data,
sizeof(surface_object->params.h265.picture));
break;
#endif
default:
break;
@@ -110,7 +104,6 @@ static VAStatus codec_store_buffer(struct request_data *driver_data,
case VASliceParameterBufferType:
switch (profile) {
#ifdef WITH_H264
case VAProfileH264Main:
case VAProfileH264High:
case VAProfileH264ConstrainedBaseline:
@@ -120,15 +113,12 @@ static VAStatus codec_store_buffer(struct request_data *driver_data,
buffer_object->data,
sizeof(surface_object->params.h264.slice));
break;
#endif
#ifdef WITH_H265
case VAProfileHEVCMain:
memcpy(&surface_object->params.h265.slice,
buffer_object->data,
sizeof(surface_object->params.h265.slice));
break;
#endif
default:
break;
@@ -137,7 +127,6 @@ static VAStatus codec_store_buffer(struct request_data *driver_data,
case VAIQMatrixBufferType:
switch (profile) {
#ifdef WITH_MPEG2
case VAProfileMPEG2Simple:
case VAProfileMPEG2Main:
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));
surface_object->params.mpeg2.iqmatrix_set = true;
break;
#endif
#ifdef WITH_H264
case VAProfileH264Main:
case VAProfileH264High:
case VAProfileH264ConstrainedBaseline:
@@ -157,16 +144,13 @@ static VAStatus codec_store_buffer(struct request_data *driver_data,
buffer_object->data,
sizeof(surface_object->params.h264.matrix));
break;
#endif
#ifdef WITH_H265
case VAProfileHEVCMain:
memcpy(&surface_object->params.h265.iqmatrix,
buffer_object->data,
sizeof(surface_object->params.h265.iqmatrix));
surface_object->params.h265.iqmatrix_set = true;
break;
#endif
default:
break;
@@ -188,16 +172,13 @@ static VAStatus codec_set_controls(struct request_data *driver_data,
int rc;
switch (profile) {
#ifdef WITH_MPEG2
case VAProfileMPEG2Simple:
case VAProfileMPEG2Main:
rc = mpeg2_set_controls(driver_data, context, surface_object);
if (rc < 0)
return VA_STATUS_ERROR_OPERATION_FAILED;
break;
#endif
#ifdef WITH_H264
case VAProfileH264Main:
case VAProfileH264High:
case VAProfileH264ConstrainedBaseline:
@@ -207,15 +188,12 @@ static VAStatus codec_set_controls(struct request_data *driver_data,
if (rc < 0)
return VA_STATUS_ERROR_OPERATION_FAILED;
break;
#endif
#ifdef WITH_H265
case VAProfileHEVCMain:
rc = h265_set_controls(driver_data, context, surface_object);
if (rc < 0)
return VA_STATUS_ERROR_OPERATION_FAILED;
break;
#endif
default:
return VA_STATUS_ERROR_UNSUPPORTED_PROFILE;