Page 1 of 1

I've got vmem + zerocopy DXVA2 working with SDL2, but what about dxva2_deinterlace_plugin?

Posted: 13 May 2017 16:31
by oviano
It doesn't seem to be getting built, for me anyway.

I can see a bunch of object files and the source, but no DLL.

So I just wanted to ask what the status of this plugin is - is it disabled deliberately, work in progress, obsolete, etc?

My modifications to vmem allow it to be setup with the D3D9 device from SDL2, and then it creates a bunch of offscreen plain textures, which get passed down untouched through some modified callbacks. My SDL2-based app then StretchRects it to the underlying D3D9 texture inside an SDL2_Texture. It works well, CPU usage drops significantly.

Next step is deinterlacing, hence the question above.

The regular CPU deinterlacer rejects the incompatible DXA9 output. Then I noticed the source file dxva2_dinterlace.c but no corresponding DLL.

Be grateful for some help.

I will share my vmem.c changes when I'm done.

Thanks

Re: I've got vmem + zerocopy DXVA2 working with SDL2, but what about dxva2_deinterlace_plugin?

Posted: 13 May 2017 17:01
by oviano
So my config has these lines in it. What do I need to do to make it find this function that appears to be disabling dxva2_deinterlace?

Code: Select all

configure:49086: checking for d3d9.h configure:49086: result: yes configure:49101: checking for IDirectXVideoProcessorService_GetVideoProcessorDeviceGuids configure:49101: x86_64-w64-mingw32-gcc -o conftest.exe -g -O2 -I/home/oliver/Perforce/Non-SI/thirdparty/sdks/vlc-windows/win64/contrib/x86_64-w64-mingw32/include -mms-bitfields -Wall -Wextra -Wsign-compare -Wundef -Wpointer-arith -Wbad-function-cast -Wwrite-strings -Wmissing-prototypes -Wvolatile-register-var -Werror-implicit-function-declaration -Winit-self -Wlogical-op -Wformat-security -pipe -O3 -fno-math-errno -funsafe-math-optimizations -fno-rounding-math -fno-signaling-nans -fcx-limited-range -funroll-loops -fomit-frame-pointer -I/home/oliver/Perforce/Non-SI/thirdparty/sdks/vlc-windows/win64/contrib/x86_64-w64-mingw32/include -D__USE_MINGW_ANSI_STDIO=1 -Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase -Wl,--high-entropy-va -Wl,--image-base,0x140000000 -L/home/oliver/Perforce/Non-SI/thirdparty/sdks/vlc-windows/win64/contrib/x86_64-w64-mingw32/lib conftest.c >&5 /tmp/ccxyDcmw.o: In function `main': /home/oliver/Perforce/Non-SI/thirdparty/sdks/vlc-windows/win64/win64/conftest.c:178: undefined reference to `IDirectXVideoProcessorService_GetVideoProcessorDeviceGuids' /home/oliver/Perforce/Non-SI/thirdparty/sdks/vlc-windows/win64/win64/conftest.c:178:(.text.startup+0xa): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `IDirectXVideoProcessorService_GetVideoProcessorDeviceGuids' collect2: error: ld returned 1 exit status configure:49101: $? = 1 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "vlc" | #define PACKAGE_TARNAME "vlc" | #define PACKAGE_VERSION "3.0.0-git" | #define PACKAGE_STRING "vlc 3.0.0-git" | #define PACKAGE_BUGREPORT "" | #define PACKAGE_URL "" | #define PACKAGE "vlc" | #define VERSION "3.0.0-git" | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define __EXTENSIONS__ 1 | #define _ALL_SOURCE 1 | #define _GNU_SOURCE 1 | #define _POSIX_PTHREAD_SEMANTICS 1 | #define _TANDEM_SOURCE 1 | #define _FORTIFY_SOURCE 2 | #define _FILE_OFFSET_BITS 64 | #define _THREAD_SAFE /**/ | #define __LIBVLC__ /**/ | #define WIN32_LEAN_AND_MEAN /**/ | #define restrict __restrict | #define _WIN32_IE 0x0600 | #define _UNICODE 1 | #define UNICODE 1 | #define _ISOC99_SOURCE 1 | #define _ISOC11_SOURCE 1 | #define _POSIX_SOURCE 1 | #define _POSIX_C_SOURCE 200809L | #define _XOPEN_SOURCE 700 | #define _XOPEN_SOURCE_EXTENDED 1 | #define _BSD_SOURCE 1 | #define _SVID_SOURCE 1 | #define VLC_WINSTORE_APP 0 | #define LT_OBJDIR ".libs/" | #define HAVE_ICONV 1 | #define ENABLE_NLS 1 | #define HAVE_GETTEXT 1 | #define HAVE_DCGETTEXT 1 | #define HAVE_ICONV 1 | #define ICONV_CONST | #define HAVE_LIBMINGW32 1 | #define LIBEXT ".dll" | #define HAVE_GETENV 1 | #define HAVE_ISATTY 1 | #define HAVE_SETLOCALE 1 | #define HAVE_STRICMP 1 | #define HAVE_STRNICMP 1 | #define HAVE_ATOF 1 | #define HAVE_ATOLL 1 | #define HAVE_GETPID 1 | #define HAVE_LLDIV 1 | #define HAVE_REWIND 1 | #define HAVE_STRCASECMP 1 | #define HAVE_STRDUP 1 | #define HAVE_STRNLEN 1 | #define HAVE_STRTOF 1 | #define HAVE_STRTOK_R 1 | #define HAVE_STRTOLL 1 | #define HAVE_SWAB 1 | #define HAVE_TFIND 1 | #define HAVE_GETTIMEOFDAY 1 | #define fdatasync fsync | #define HAVE_ASPRINTF 1 | #define HAVE_VASPRINTF 1 | #define HAVE_GMTIME_R 1 | #define HAVE_LOCALTIME_R 1 | #define HAVE_STATIC_ASSERT 1 | #define HAVE__LOCK_FILE 1 | #define HAVE_STRUCT_TIMESPEC 1 | #define HAVE_MAX_ALIGN_T 1 | #define HAVE_LRINTF 1 | #define HAVE_NANF 1 | #define HAVE_SINCOS 1 | #define HAVE_PTHREAD_H 1 | #define HAVE_SEARCH_H 1 | #define HAVE_SYS_PARAM_H 1 | #define HAVE_GETOPT_H 1 | #define HAVE_ZLIB_H 1 | #define NDEBUG 1 | #define HAVE_ATTRIBUTE_PACKED 1 | #define HAVE_MMX_INTRINSICS 1 | #define CAN_COMPILE_MMX 1 | #define CAN_COMPILE_MMXEXT 1 | #define HAVE_SSE2_INTRINSICS 1 | #define CAN_COMPILE_SSE 1 | #define CAN_COMPILE_SSE2 1 | #define CAN_COMPILE_SSE3 1 | #define CAN_COMPILE_SSSE3 1 | #define CAN_COMPILE_SSE4_1 1 | #define CAN_COMPILE_SSE4_2 1 | #define CAN_COMPILE_SSE4A 1 | #define CAN_COMPILE_3DNOW 1 | #define ENABLE_SOUT 1 | #define ENABLE_HTTPD 1 | #define ENABLE_VLM 1 | #define ENABLE_ADDONMANAGERMODULES 1 | #define HAVE_STREAM_CB_IN_DVDNAV_H 1 | #define HAVE_LIBCDDB 1 | #define HAVE_LIBVORBIS 1 | #define HAVE_MPC_MPCDEC_H 1 | #define HAVE_LIBCRYSTALHD_BC_DTS_DEFS_H 1 | #define HAVE_MAD_H 1 | #define HAVE_LIBAVCODEC_AVCODEC_H 1 | #define HAVE_LIBAVUTIL_AVUTIL_H 1 | #define HAVE_DXVA2API_H 1 | #define HAVE_LIBAVCODEC_DXVA2_H 1 | #define HAVE_ID3D11VIDEODECODER 1 | #define HAVE_DXVA2API_H 1 | #define HAVE_LIBAVCODEC_D3D11VA_H 1 | #define HAVE_AVCODEC_D3D11VA 1 | #define HAVE_DXGIDEBUG_H 1 | #define HAVE_LIBAVFORMAT_AVFORMAT_H 1 | #define HAVE_LIBAVFORMAT_AVIO_H 1 | #define HAVE_LIBAVCODEC_AVCODEC_H 1 | #define HAVE_LIBAVUTIL_AVUTIL_H 1 | #define HAVE_LIBSWSCALE_SWSCALE_H 1 | #define HAVE_LIBAVUTIL_AVUTIL_H 1 | #define HAVE_LIBSWRESAMPLE_SWRESAMPLE_H 1 | #define HAVE_LIBAVUTIL_AVUTIL_H 1 | #define HAVE_NEAACDEC_H 1 | #define HAVE_A52DEC_A52_H 1 | #define HAVE_PNG_H 1 | #define HAVE_JPEGLIB_H 1 | #define HAVE_FLUIDLITE_H 1 | #define ZVBI_COMPILED 1 | #define HAVE_FONTCONFIG_FONTCONFIG_H 1 | #define HAVE_ARIBB24 1 | #define X_DISPLAY_MISSING 1 | #define HAVE_ISPOBJECTTOKEN 1 | #define HAVE_DDRAW_H 1 | #define HAVE_GL_WGLEW_H 1 | #define HAVE_D3D11_H 1 | #define HAVE_D3D9_H 1 | /* end confdefs.h. */ | /* Define IDirectXVideoProcessorService_GetVideoProcessorDeviceGuids to an innocuous variant, in case <limits.h> declares IDirectXVideoProcessorService_GetVideoProcessorDeviceGuids. | For example, HP-UX 11i <limits.h> declares gettimeofday. */ | #define IDirectXVideoProcessorService_GetVideoProcessorDeviceGuids innocuous_IDirectXVideoProcessorService_GetVideoProcessorDeviceGuids | | /* System header to define __stub macros and hopefully few prototypes, | which can conflict with char IDirectXVideoProcessorService_GetVideoProcessorDeviceGuids (); below. | Prefer <limits.h> to <assert.h> if __STDC__ is defined, since | <limits.h> exists even on freestanding compilers. */ | | #ifdef __STDC__ | # include <limits.h> | #else | # include <assert.h> | #endif | | #undef IDirectXVideoProcessorService_GetVideoProcessorDeviceGuids | | /* Override any GCC internal prototype to avoid an error. | Use char because int might match the return type of a GCC | builtin and then its argument prototype would still apply. */ | #ifdef __cplusplus | extern "C" | #endif | char IDirectXVideoProcessorService_GetVideoProcessorDeviceGuids (); | /* The GNU C library defines this for functions which it implements | to always fail with ENOSYS. Some functions are actually named | something starting with __ and the normal name is an alias. */ | #if defined __stub_IDirectXVideoProcessorService_GetVideoProcessorDeviceGuids || defined __stub___IDirectXVideoProcessorService_GetVideoProcessorDeviceGuids | choke me | #endif | | int | main () | { | return IDirectXVideoProcessorService_GetVideoProcessorDeviceGuids (); | ; | return 0; | } configure:49101: result: no configure:49115: WARNING: Could not find required IDirectXVideoDecoder in dxva2api.h

Re: I've got vmem + zerocopy DXVA2 working with SDL2, but what about dxva2_deinterlace_plugin?

Posted: 13 May 2017 18:09
by oviano
Ok, so basically the check in configure.ac is wrong. If I forcibly make it add this plugin it builds fine and creates the DLL.

It is also missing from a recent nightly build so it's not about my setup, but for the record this is Ubuntu Zesty with the mingw toolchain built using the same commands as in the appropriate videolan docker image.

Re: I've got vmem + zerocopy DXVA2 working with SDL2, but what about dxva2_deinterlace_plugin?

Posted: 14 May 2017 11:52
by oviano
Ok, so here is an enhanced version of dxva2_deinterlace.c which now does the required frame doubling for smoother results. Previously it was just outputting a single progressive frame per interlaced frame, now it's two frames one for each set of fields. It was also hardcoded to a 29.97 source, now it should use the correct input framerate.

I used the CPU version (deinterlace.c) as a guide to how to modify it.

https://www.dropbox.com/s/utxh7hljlie5f ... ace.c?dl=0