Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwm4 <nfxjfg@googlemail.com>2017-06-06 19:51:09 +0300
committerDiego Biurrun <diego@biurrun.de>2017-06-08 21:55:52 +0300
commit4dec101acc393fbfe9a8ce0237b9efbae3f20139 (patch)
tree36d22638bc1ce029075126c888d26bbaed42d50d /libavcodec/dxva2_vc1.c
parentbd747b9226414007f0207fa201976af7217e3b77 (diff)
dxva: preparations for new hwaccel API
The actual hwaccel code will need to access an internal context instead of avctx->hwaccel_context, so add a new DXVA_CONTEXT() macro, that will dispatch between the "old" external and the new internal context. Also, the new API requires a new D3D11 pixfmt, so all places which check for the pixfmt need to be adjusted. Introduce a ff_dxva2_is_d3d11() function, which does the check. Signed-off-by: Diego Biurrun <diego@biurrun.de>
Diffstat (limited to 'libavcodec/dxva2_vc1.c')
-rw-r--r--libavcodec/dxva2_vc1.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libavcodec/dxva2_vc1.c b/libavcodec/dxva2_vc1.c
index 0672c97a48..b63580ed2e 100644
--- a/libavcodec/dxva2_vc1.c
+++ b/libavcodec/dxva2_vc1.c
@@ -165,7 +165,7 @@ static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx,
DECODER_BUFFER_DESC *sc)
{
const VC1Context *v = avctx->priv_data;
- AVDXVAContext *ctx = avctx->hwaccel_context;
+ AVDXVAContext *ctx = DXVA_CONTEXT(avctx);
const MpegEncContext *s = &v->s;
struct dxva2_picture_context *ctx_pic = s->current_picture_ptr->hwaccel_picture_private;
@@ -184,7 +184,7 @@ static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx,
unsigned type;
#if CONFIG_D3D11VA
- if (avctx->pix_fmt == AV_PIX_FMT_D3D11VA_VLD) {
+ if (ff_dxva2_is_d3d11(avctx)) {
type = D3D11_VIDEO_DECODER_BUFFER_BITSTREAM;
if (FAILED(ID3D11VideoContext_GetDecoderBuffer(D3D11VA_CONTEXT(ctx)->video_context,
D3D11VA_CONTEXT(ctx)->decoder,
@@ -215,7 +215,7 @@ static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx,
slice->dwSliceBitsInBuffer = 8 * data_size;
}
#if CONFIG_D3D11VA
- if (avctx->pix_fmt == AV_PIX_FMT_D3D11VA_VLD)
+ if (ff_dxva2_is_d3d11(avctx))
if (FAILED(ID3D11VideoContext_ReleaseDecoderBuffer(D3D11VA_CONTEXT(ctx)->video_context, D3D11VA_CONTEXT(ctx)->decoder, type)))
return -1;
#endif
@@ -228,7 +228,7 @@ static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx,
return result;
#if CONFIG_D3D11VA
- if (avctx->pix_fmt == AV_PIX_FMT_D3D11VA_VLD) {
+ if (ff_dxva2_is_d3d11(avctx)) {
D3D11_VIDEO_DECODER_BUFFER_DESC *dsc11 = bs;
memset(dsc11, 0, sizeof(*dsc11));
dsc11->BufferType = type;
@@ -261,7 +261,7 @@ static int dxva2_vc1_start_frame(AVCodecContext *avctx,
av_unused uint32_t size)
{
const VC1Context *v = avctx->priv_data;
- AVDXVAContext *ctx = avctx->hwaccel_context;
+ AVDXVAContext *ctx = DXVA_CONTEXT(avctx);
struct dxva2_picture_context *ctx_pic = v->s.current_picture_ptr->hwaccel_picture_private;
if (!DXVA_CONTEXT_VALID(avctx, ctx))