X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavutil%2Fhwcontext.c;h=615f1f71da8a2bba0a86aca8bedf78234d3ff23d;hb=911417f0b34e611bf084319c5b5a4e4e630da940;hp=1e9e91329cd27cb821756a089f91f73af30d9868;hpb=f013ba475b0dbf71e2804c57e67bf308ae636f2b;p=ffmpeg diff --git a/libavutil/hwcontext.c b/libavutil/hwcontext.c index 1e9e91329cd..615f1f71da8 100644 --- a/libavutil/hwcontext.c +++ b/libavutil/hwcontext.c @@ -35,6 +35,9 @@ static const HWContextType *hw_table[] = { #if CONFIG_DXVA2 &ff_hwcontext_type_dxva2, #endif +#if CONFIG_QSV + &ff_hwcontext_type_qsv, +#endif #if CONFIG_VAAPI &ff_hwcontext_type_vaapi, #endif @@ -318,6 +321,7 @@ int av_hwframe_transfer_get_formats(AVBufferRef *hwframe_ref, static int transfer_data_alloc(AVFrame *dst, const AVFrame *src, int flags) { + AVHWFramesContext *ctx = (AVHWFramesContext*)src->hw_frames_ctx->data; AVFrame *frame_tmp; int ret = 0; @@ -340,8 +344,8 @@ static int transfer_data_alloc(AVFrame *dst, const AVFrame *src, int flags) frame_tmp->format = formats[0]; av_freep(&formats); } - frame_tmp->width = src->width; - frame_tmp->height = src->height; + frame_tmp->width = ctx->width; + frame_tmp->height = ctx->height; ret = av_frame_get_buffer(frame_tmp, 32); if (ret < 0) @@ -351,6 +355,9 @@ static int transfer_data_alloc(AVFrame *dst, const AVFrame *src, int flags) if (ret < 0) goto fail; + frame_tmp->width = src->width; + frame_tmp->height = src->height; + av_frame_move_ref(dst, frame_tmp); fail: