Commit 3689efea authored by Hendrik Leppkes's avatar Hendrik Leppkes

Merge commit 'c46db38c'

* commit 'c46db38c':
  hwcontext: add a dxva2 implementation
Merged-by: 's avatarHendrik Leppkes <h.leppkes@gmail.com>
parents d0b21b28 c46db38c
...@@ -15,6 +15,9 @@ libavutil: 2015-08-28 ...@@ -15,6 +15,9 @@ libavutil: 2015-08-28
API changes, most recent first: API changes, most recent first:
2016-06-22 - xxxxxxx - lavu 55.25.100 - hwcontext_dxva2.h
Add new installed header with DXVA2-specific hwcontext definitions.
2016-04-27 - fb91871 - lavu 55.23.100 - log.h 2016-04-27 - fb91871 - lavu 55.23.100 - log.h
Add a new function av_log_format_line2() which returns number of bytes Add a new function av_log_format_line2() which returns number of bytes
written to the target buffer. written to the target buffer.
......
...@@ -34,6 +34,7 @@ HEADERS = adler32.h \ ...@@ -34,6 +34,7 @@ HEADERS = adler32.h \
hmac.h \ hmac.h \
hwcontext.h \ hwcontext.h \
hwcontext_cuda.h \ hwcontext_cuda.h \
hwcontext_dxva2.h \
hwcontext_vaapi.h \ hwcontext_vaapi.h \
hwcontext_vdpau.h \ hwcontext_vdpau.h \
imgutils.h \ imgutils.h \
...@@ -152,6 +153,7 @@ OBJS = adler32.o \ ...@@ -152,6 +153,7 @@ OBJS = adler32.o \
OBJS-$(!HAVE_ATOMICS_NATIVE) += atomic.o \ OBJS-$(!HAVE_ATOMICS_NATIVE) += atomic.o \
OBJS-$(CONFIG_CUDA) += hwcontext_cuda.o OBJS-$(CONFIG_CUDA) += hwcontext_cuda.o
OBJS-$(CONFIG_DXVA2) += hwcontext_dxva2.o
OBJS-$(CONFIG_LZO) += lzo.o OBJS-$(CONFIG_LZO) += lzo.o
OBJS-$(CONFIG_OPENCL) += opencl.o opencl_internal.o OBJS-$(CONFIG_OPENCL) += opencl.o opencl_internal.o
OBJS-$(CONFIG_VAAPI) += hwcontext_vaapi.o OBJS-$(CONFIG_VAAPI) += hwcontext_vaapi.o
...@@ -163,6 +165,7 @@ OBJS += $(COMPAT_OBJS:%=../compat/%) ...@@ -163,6 +165,7 @@ OBJS += $(COMPAT_OBJS:%=../compat/%)
SLIBOBJS-$(HAVE_GNU_WINDRES) += avutilres.o SLIBOBJS-$(HAVE_GNU_WINDRES) += avutilres.o
SKIPHEADERS-$(CONFIG_CUDA) += hwcontext_cuda.h SKIPHEADERS-$(CONFIG_CUDA) += hwcontext_cuda.h
SKIPHEADERS-$(CONFIG_DXVA2) += hwcontext_dxva2.h
SKIPHEADERS-$(CONFIG_VAAPI) += hwcontext_vaapi.h SKIPHEADERS-$(CONFIG_VAAPI) += hwcontext_vaapi.h
SKIPHEADERS-$(CONFIG_VDPAU) += hwcontext_vdpau.h SKIPHEADERS-$(CONFIG_VDPAU) += hwcontext_vdpau.h
SKIPHEADERS-$(HAVE_ATOMICS_GCC) += atomic_gcc.h SKIPHEADERS-$(HAVE_ATOMICS_GCC) += atomic_gcc.h
......
...@@ -32,6 +32,9 @@ static const HWContextType *hw_table[] = { ...@@ -32,6 +32,9 @@ static const HWContextType *hw_table[] = {
#if CONFIG_CUDA #if CONFIG_CUDA
&ff_hwcontext_type_cuda, &ff_hwcontext_type_cuda,
#endif #endif
#if CONFIG_DXVA2
&ff_hwcontext_type_dxva2,
#endif
#if CONFIG_VAAPI #if CONFIG_VAAPI
&ff_hwcontext_type_vaapi, &ff_hwcontext_type_vaapi,
#endif #endif
......
...@@ -28,6 +28,7 @@ enum AVHWDeviceType { ...@@ -28,6 +28,7 @@ enum AVHWDeviceType {
AV_HWDEVICE_TYPE_VDPAU, AV_HWDEVICE_TYPE_VDPAU,
AV_HWDEVICE_TYPE_CUDA, AV_HWDEVICE_TYPE_CUDA,
AV_HWDEVICE_TYPE_VAAPI, AV_HWDEVICE_TYPE_VAAPI,
AV_HWDEVICE_TYPE_DXVA2,
}; };
typedef struct AVHWDeviceInternal AVHWDeviceInternal; typedef struct AVHWDeviceInternal AVHWDeviceInternal;
......
This diff is collapsed.
/*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVUTIL_HWCONTEXT_DXVA2_H
#define AVUTIL_HWCONTEXT_DXVA2_H
/**
* @file
* An API-specific header for AV_HWDEVICE_TYPE_DXVA2.
*
* Only fixed-size pools are supported.
*
* For user-allocated pools, AVHWFramesContext.pool must return AVBufferRefs
* with the data pointer set to a pointer to IDirect3DSurface9.
*/
#include <d3d9.h>
#include <dxva2api.h>
/**
* This struct is allocated as AVHWDeviceContext.hwctx
*/
typedef struct AVDXVA2DeviceContext {
IDirect3DDeviceManager9 *devmgr;
} AVDXVA2DeviceContext;
/**
* This struct is allocated as AVHWFramesContext.hwctx
*/
typedef struct AVDXVA2FramesContext {
/**
* The surface type (e.g. DXVA2_VideoProcessorRenderTarget or
* DXVA2_VideoDecoderRenderTarget). Must be set by the caller.
*/
DWORD surface_type;
/**
* The surface pool. When an external pool is not provided by the caller,
* this will be managed (allocated and filled on init, freed on uninit) by
* libavutil.
*/
IDirect3DSurface9 **surfaces;
int nb_surfaces;
/**
* Certain drivers require the decoder to be destroyed before the surfaces.
* To allow internally managed pools to work properly in such cases, this
* field is provided.
*
* If it is non-NULL, libavutil will call IDirectXVideoDecoder_Release() on
* it just before the internal surface pool is freed.
*/
IDirectXVideoDecoder *decoder_to_release;
} AVDXVA2FramesContext;
#endif /* AVUTIL_HWCONTEXT_DXVA2_H */
...@@ -97,6 +97,7 @@ struct AVHWFramesInternal { ...@@ -97,6 +97,7 @@ struct AVHWFramesInternal {
}; };
extern const HWContextType ff_hwcontext_type_cuda; extern const HWContextType ff_hwcontext_type_cuda;
extern const HWContextType ff_hwcontext_type_dxva2;
extern const HWContextType ff_hwcontext_type_vaapi; extern const HWContextType ff_hwcontext_type_vaapi;
extern const HWContextType ff_hwcontext_type_vdpau; extern const HWContextType ff_hwcontext_type_vdpau;
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
*/ */
#define LIBAVUTIL_VERSION_MAJOR 55 #define LIBAVUTIL_VERSION_MAJOR 55
#define LIBAVUTIL_VERSION_MINOR 24 #define LIBAVUTIL_VERSION_MINOR 25
#define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ #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