On Thu, May 04, 2017 at 08:44:04AM +0200, wm4 wrote:
> --- a/configure
> +++ b/configure
> @@ -1712,6 +1712,7 @@ HAVE_LIST="
> $THREADS_LIST
> $TOOLCHAIN_FEATURES
> $TYPES_LIST
> + d3d11va_lib
> dos_paths
> dxva2_lib
> libc_msvcrt
> @@ -2166,6 +2167,7 @@ zmbv_encoder_deps="zlib"
>
> # hardware accelerators
> d3d11va_deps="d3d11_h dxva_h ID3D11VideoDecoder"
> +d3d11va_lib_deps="d3d11va"
> dxva2_deps="dxva2api_h DXVA2_ConfigPictureDecode"
> dxva2_lib_deps="dxva2"
> vda_deps="VideoDecodeAcceleration_VDADecoder_h blocks_extension pthreads"
> @@ -4861,6 +4863,10 @@ if enabled libxcb; then
> check_pkg_config libxcb_xfixes xcb-xfixes xcb/xfixes.h
> xcb_xfixes_get_cursor_image
> fi
>
> +enabled d3d11va &&
trailing whitespace
> + check_type "windows.h d3d11.h" ID3D11VideoDevice &&
> + enable d3d11va_lib
> +
> enabled dxva2 &&
> check_lib dxva2_lib windows.h CoTaskMemFree -lole32
I'm not sure why you add the d3d11va_lib configure variable instead of
just checking for the type. It seems to me like what you are doing here
is different enough from the dxva2_lib case to not warrant emulating it.
> --- /dev/null
> +++ b/libavutil/hwcontext_d3d11va.c
> @@ -0,0 +1,488 @@
> +
> +#include <windows.h>
> +
> +#if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600
> +#undef _WIN32_WINNT
> +#define _WIN32_WINNT 0x0600
> +#endif
> +#define COBJMACROS
Only marginally related: We have this in multiple places, perhaps it's time
to unify it in some suitable place?
> +static AVBufferRef *wrap_texture_buf(ID3D11Texture2D *tex, int index)
> +{
> +
> + desc->texture = tex;
> + desc->index = index;
nit: align
> +static int d3d11va_get_buffer(AVHWFramesContext *ctx, AVFrame *frame)
> +{
> + frame->data[1] = (uint8_t *)(intptr_t)desc->index;
double cast?
> +static int d3d11va_transfer_get_formats(AVHWFramesContext *ctx,
> + enum AVHWFrameTransferDirection dir,
> + enum AVPixelFormat **formats)
Indentation is off.
> +static int d3d11va_transfer_data(AVHWFramesContext *ctx, AVFrame *dst,
> + const AVFrame *src)
> +{
> + ID3D11Resource *texture = (ID3D11Resource *)(ID3D11Texture2D
> *)frame->data[0];
double cast?
> + int index = (intptr_t)frame->data[1];
Implicit double cast by casting to intptr_t, then assigning to int?
> --- /dev/null
> +++ b/libavutil/hwcontext_d3d11va.h
> @@ -0,0 +1,158 @@
> + *
> + * 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_D3D11VA_H
> +#define AVUTIL_HWCONTEXT_D3D11VA_H
nit: stray double empty line
Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel