Commit 551c6775 authored by Mark Thompson's avatar Mark Thompson Committed by Anton Khirnov

lavu: VAAPI hwcontext implementation

Signed-off-by: 's avatarAnton Khirnov <anton@khirnov.net>
parent d264c720
......@@ -4681,6 +4681,10 @@ if enabled x11grab; then
require Xfixes X11/extensions/Xfixes.h XFixesGetCursorImage -lXfixes
fi
enabled vaapi &&
check_code cc "va/va.h" "vaCreateSurfaces(0, 0, 0, 0, 0, 0, 0, 0)" ||
disable vaapi
enabled vaapi && enabled xlib &&
check_lib2 "va/va.h va/va_x11.h" vaGetDisplay -lva -lva-x11 &&
enable vaapi_x11
......
......@@ -13,6 +13,9 @@ libavutil: 2015-08-28
API changes, most recent first:
2016-xx-xx - xxxxxxx - lavu 55.9.0 - hwcontext_vaapi.h
Add new installed header with VAAPI-specific hwcontext definitions.
2016-xx-xx - xxxxxxx - lavu 55.8.0 - pixfmt.h
Deprecate all AV_PIX_FMT_VAAPI_* formats.
Replaced by AV_PIX_FMT_VAAPI.
......
......@@ -25,6 +25,7 @@ HEADERS = adler32.h \
hmac.h \
hwcontext.h \
hwcontext_cuda.h \
hwcontext_vaapi.h \
hwcontext_vdpau.h \
imgutils.h \
intfloat.h \
......@@ -108,11 +109,13 @@ OBJS = adler32.o \
OBJS-$(CONFIG_LZO) += lzo.o
OBJS-$(CONFIG_CUDA) += hwcontext_cuda.o
OBJS-$(CONFIG_VAAPI) += hwcontext_vaapi.o
OBJS-$(CONFIG_VDPAU) += hwcontext_vdpau.o
OBJS += $(COMPAT_OBJS:%=../compat/%)
SKIPHEADERS-$(CONFIG_CUDA) += hwcontext_cuda.h
SKIPHEADERS-$(CONFIG_VAAPI) += hwcontext_vaapi.h
SKIPHEADERS-$(CONFIG_VDPAU) += hwcontext_vdpau.h
SKIPHEADERS-$(HAVE_ATOMICS_GCC) += atomic_gcc.h
SKIPHEADERS-$(HAVE_ATOMICS_SUNCC) += atomic_suncc.h
......
......@@ -32,6 +32,9 @@ static const HWContextType *hw_table[] = {
#if CONFIG_CUDA
&ff_hwcontext_type_cuda,
#endif
#if CONFIG_VAAPI
&ff_hwcontext_type_vaapi,
#endif
#if CONFIG_VDPAU
&ff_hwcontext_type_vdpau,
#endif
......
......@@ -27,6 +27,7 @@
enum AVHWDeviceType {
AV_HWDEVICE_TYPE_VDPAU,
AV_HWDEVICE_TYPE_CUDA,
AV_HWDEVICE_TYPE_VAAPI,
};
typedef struct AVHWDeviceInternal AVHWDeviceInternal;
......
......@@ -97,6 +97,7 @@ struct AVHWFramesInternal {
};
extern const HWContextType ff_hwcontext_type_cuda;
extern const HWContextType ff_hwcontext_type_vaapi;
extern const HWContextType ff_hwcontext_type_vdpau;
#endif /* AVUTIL_HWCONTEXT_INTERNAL_H */
This diff is collapsed.
/*
* This file is part of Libav.
*
* Libav is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* Libav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with Libav; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVUTIL_HWCONTEXT_VAAPI_H
#define AVUTIL_HWCONTEXT_VAAPI_H
#include <va/va.h>
/**
* @file
* API-specific header for AV_HWDEVICE_TYPE_VAAPI.
*
* Dynamic frame pools are supported, but note that any pool used as a render
* target is required to be of fixed size in order to be be usable as an
* argument to vaCreateContext().
*
* For user-allocated pools, AVHWFramesContext.pool must return AVBufferRefs
* with the data pointer set to a VASurfaceID.
*/
/**
* VAAPI connection details.
*
* Allocated as AVHWDeviceContext.hwctx
*/
typedef struct AVVAAPIDeviceContext {
/**
* The VADisplay handle, to be filled by the user.
*/
VADisplay display;
} AVVAAPIDeviceContext;
/**
* VAAPI-specific data associated with a frame pool.
*
* Allocated as AVHWFramesContext.hwctx.
*/
typedef struct AVVAAPIFramesContext {
/**
* Set by the user to apply surface attributes to all surfaces in
* the frame pool. If null, default settings are used.
*/
VASurfaceAttrib *attributes;
int nb_attributes;
/**
* The surfaces IDs of all surfaces in the pool after creation.
* Only valid if AVHWFramesContext.initial_pool_size was positive.
* These are intended to be used as the render_targets arguments to
* vaCreateContext().
*/
VASurfaceID *surface_ids;
int nb_surfaces;
} AVVAAPIFramesContext;
/**
* VAAPI hardware pipeline configuration details.
*
* Allocated with av_hwdevice_hwconfig_alloc().
*/
typedef struct AVVAAPIHWConfig {
/**
* ID of a VAAPI pipeline configuration.
*/
VAConfigID config_id;
} AVVAAPIHWConfig;
#endif /* AVUTIL_HWCONTEXT_VAAPI_H */
......@@ -54,7 +54,7 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 55
#define LIBAVUTIL_VERSION_MINOR 8
#define LIBAVUTIL_VERSION_MINOR 9
#define LIBAVUTIL_VERSION_MICRO 0
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment