Opened 8 years ago

Closed 8 years ago

#5669 closed defect (fixed)

FFmpeg fails building with Decklink

Reported by: RiCON Owned by:
Priority: important Component: avdevice
Version: git-master Keywords: decklink regression
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Using Decklink SDK 10.6.6 with MinGW GCC x86_64.

First bad commit is 8f9fa49, found using git bisect.

% ./configure --enable-decklink --disable-w32threads --extra-cflags=-DPTW32_STATIC_LIB --extra-libs="-lpthread -lwsock32"
% make
CC	libavdevice/alldevices.o
CC	libavdevice/avdevice.o
CXX	libavdevice/decklink_common.o
cc1plus.exe: warning: command line option '-Wdeclaration-after-statement' is valid for C/ObjC but not for C++
cc1plus.exe: warning: command line option '-Wmissing-prototypes' is valid for C/ObjC but not for C++
cc1plus.exe: warning: command line option '-Wno-pointer-to-int-cast' is valid for C/ObjC but not for C++
cc1plus.exe: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus.exe: warning: command line option '-Wno-pointer-sign' is valid for C/ObjC but not for C++
cc1plus.exe: warning: command line option '-std=c99' is valid for C/ObjC but not for C++
In file included from C:/builds/ab-full/build/ffmpeg-git/libavformat/os_support.h:112:0,
                 from C:/builds/ab-full/build/ffmpeg-git/libavformat/internal.h:28,
                 from C:/builds/ab-full/build/ffmpeg-git/libavdevice/decklink_common.cpp:34:
C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:15:2: warning: #warning Please include winsock2.h before windows.h [-Wcpp]
 #warning Please include winsock2.h before windows.h
  ^
In file included from C:/builds/ab-full/build/ffmpeg-git/libavdevice/decklink_common.cpp:22:0:
C:/builds/ab-full/local64/include/DeckLinkAPI.h:20697:69: warning: redundant redeclaration of 'ULONG BSTR_UserSize(ULONG*, ULONG, OLECHAR**)' in same scope [-Wredundant-decls]
 ULONG           __RPC_USER BSTR_UserSize     (ULONG *, ULONG, BSTR *);
                                                                     ^
In file included from C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/objbase.h:164:0,
                 from C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/ole2.h:17,
                 from C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/wtypes.h:12,
                 from C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/winscard.h:10,
                 from C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:97,
                 from C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/rpc.h:16,
                 from C:/builds/ab-full/local64/include/DeckLinkAPI.h:7,
                 from C:/builds/ab-full/build/ffmpeg-git/libavdevice/decklink_common.cpp:22:
C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/propidl.h:1287:28: note: previous declaration of 'ULONG BSTR_UserSize(ULONG*, ULONG, OLECHAR**)'
 ULONG           __RPC_USER BSTR_UserSize     (ULONG *, ULONG, BSTR *);
                            ^
In file included from C:/builds/ab-full/build/ffmpeg-git/libavdevice/decklink_common.cpp:22:0:
C:/builds/ab-full/local64/include/DeckLinkAPI.h:20698:79: warning: redundant redeclaration of 'unsigned char* BSTR_UserMarshal(ULONG*, unsigned char*, OLECHAR**)' in same scope [-Wredundant-decls]
 unsigned char * __RPC_USER BSTR_UserMarshal  (ULONG *, unsigned char *, BSTR *);
                                                                               ^
In file included from C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/objbase.h:164:0,
                 from C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/ole2.h:17,
                 from C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/wtypes.h:12,
                 from C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/winscard.h:10,
                 from C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:97,
                 from C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/rpc.h:16,
                 from C:/builds/ab-full/local64/include/DeckLinkAPI.h:7,
                 from C:/builds/ab-full/build/ffmpeg-git/libavdevice/decklink_common.cpp:22:
C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/propidl.h:1288:28: note: previous declaration of 'unsigned char* BSTR_UserMarshal(ULONG*, unsigned char*, OLECHAR**)'
 unsigned char * __RPC_USER BSTR_UserMarshal  (ULONG *, unsigned char *, BSTR *);
                            ^
In file included from C:/builds/ab-full/build/ffmpeg-git/libavdevice/decklink_common.cpp:22:0:
C:/builds/ab-full/local64/include/DeckLinkAPI.h:20699:79: warning: redundant redeclaration of 'unsigned char* BSTR_UserUnmarshal(ULONG*, unsigned char*, OLECHAR**)' in same scope [-Wredundant-decls]
 unsigned char * __RPC_USER BSTR_UserUnmarshal(ULONG *, unsigned char *, BSTR *);
                                                                               ^
In file included from C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/objbase.h:164:0,
                 from C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/ole2.h:17,
                 from C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/wtypes.h:12,
                 from C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/winscard.h:10,
                 from C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:97,
                 from C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/rpc.h:16,
                 from C:/builds/ab-full/local64/include/DeckLinkAPI.h:7,
                 from C:/builds/ab-full/build/ffmpeg-git/libavdevice/decklink_common.cpp:22:
C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/propidl.h:1289:28: note: previous declaration of 'unsigned char* BSTR_UserUnmarshal(ULONG*, unsigned char*, OLECHAR**)'
 unsigned char * __RPC_USER BSTR_UserUnmarshal(ULONG *, unsigned char *, BSTR *);
                            ^
In file included from C:/builds/ab-full/build/ffmpeg-git/libavdevice/decklink_common.cpp:22:0:
C:/builds/ab-full/local64/include/DeckLinkAPI.h:20700:62: warning: redundant redeclaration of 'void BSTR_UserFree(ULONG*, OLECHAR**)' in same scope [-Wredundant-decls]
 void            __RPC_USER BSTR_UserFree     (ULONG *, BSTR *);
                                                              ^
In file included from C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/objbase.h:164:0,
                 from C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/ole2.h:17,
                 from C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/wtypes.h:12,
                 from C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/winscard.h:10,
                 from C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:97,
                 from C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/rpc.h:16,
                 from C:/builds/ab-full/local64/include/DeckLinkAPI.h:7,
                 from C:/builds/ab-full/build/ffmpeg-git/libavdevice/decklink_common.cpp:22:
C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/propidl.h:1290:28: note: previous declaration of 'void BSTR_UserFree(ULONG*, OLECHAR**)'
 void            __RPC_USER BSTR_UserFree     (ULONG *, BSTR *);
                            ^
C:/builds/ab-full/build/ffmpeg-git/libavdevice/decklink_common.cpp: In function 'int ff_decklink_set_format(AVFormatContext*, int, int, int, int, decklink_direction_t, int)':
C:/builds/ab-full/build/ffmpeg-git/libavdevice/decklink_common.cpp:117:93: error: no matching function for call to 'IDeckLinkAttributes::GetFlag(_BMDDeckLinkAttributeID, bool*)'
         if (ctx->attr->GetFlag(BMDDeckLinkSupportsDuplexModeConfiguration, &duplex_supported) != S_OK)
                                                                                             ^
In file included from C:/builds/ab-full/build/ffmpeg-git/libavdevice/decklink_common.cpp:22:0:
C:/builds/ab-full/local64/include/DeckLinkAPI.h:9945:39: note: candidate: virtual HRESULT IDeckLinkAttributes::GetFlag(BMDDeckLinkAttributeID, BOOL*)
     virtual HRESULT STDMETHODCALLTYPE GetFlag(
                                       ^
C:/builds/ab-full/local64/include/DeckLinkAPI.h:9945:39: note:   no known conversion for argument 2 from 'bool*' to 'BOOL* {aka int*}'
make: *** [/build/ffmpeg-git/common.mak:63: libavdevice/decklink_common.o] Error 1

Change History (10)

comment:1 by Carl Eugen Hoyos, 8 years ago

Keywords: regression added
Priority: normalimportant

comment:2 by RiCON, 8 years ago

Additional errors with the next commit (da89c6e3):

CC	libavdevice/alldevices.o
CC	libavdevice/avdevice.o
CXX	libavdevice/decklink_common.o
cc1plus.exe: warning: command line option '-Wdeclaration-after-statement' is valid for C/ObjC but not for C++
cc1plus.exe: warning: command line option '-Wmissing-prototypes' is valid for C/ObjC but not for C++
cc1plus.exe: warning: command line option '-Wno-pointer-to-int-cast' is valid for C/ObjC but not for C++
cc1plus.exe: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
cc1plus.exe: warning: command line option '-Wno-pointer-sign' is valid for C/ObjC but not for C++
cc1plus.exe: warning: command line option '-std=c99' is valid for C/ObjC but not for C++
In file included from C:/builds/ab-full/build/ffmpeg-git/libavformat/os_support.h:112:0,
                 from C:/builds/ab-full/build/ffmpeg-git/libavformat/internal.h:28,
                 from C:/builds/ab-full/build/ffmpeg-git/libavdevice/decklink_common.cpp:34:
C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:15:2: warning: #warning Please include winsock2.h before windows.h [-Wcpp]
 #warning Please include winsock2.h before windows.h
  ^
In file included from C:/builds/ab-full/build/ffmpeg-git/libavdevice/decklink_common.cpp:22:0:
C:/builds/ab-full/local64/include/DeckLinkAPI.h:20697:69: warning: redundant redeclaration of 'ULONG BSTR_UserSize(ULONG*, ULONG, OLECHAR**)' in same scope [-Wredundant-decls]
 ULONG           __RPC_USER BSTR_UserSize     (ULONG *, ULONG, BSTR *);
                                                                     ^
In file included from C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/objbase.h:164:0,
                 from C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/ole2.h:17,
                 from C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/wtypes.h:12,
                 from C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/winscard.h:10,
                 from C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:97,
                 from C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/rpc.h:16,
                 from C:/builds/ab-full/local64/include/DeckLinkAPI.h:7,
                 from C:/builds/ab-full/build/ffmpeg-git/libavdevice/decklink_common.cpp:22:
C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/propidl.h:1287:28: note: previous declaration of 'ULONG BSTR_UserSize(ULONG*, ULONG, OLECHAR**)'
 ULONG           __RPC_USER BSTR_UserSize     (ULONG *, ULONG, BSTR *);
                            ^
In file included from C:/builds/ab-full/build/ffmpeg-git/libavdevice/decklink_common.cpp:22:0:
C:/builds/ab-full/local64/include/DeckLinkAPI.h:20698:79: warning: redundant redeclaration of 'unsigned char* BSTR_UserMarshal(ULONG*, unsigned char*, OLECHAR**)' in same scope [-Wredundant-decls]
 unsigned char * __RPC_USER BSTR_UserMarshal  (ULONG *, unsigned char *, BSTR *);
                                                                               ^
In file included from C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/objbase.h:164:0,
                 from C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/ole2.h:17,
                 from C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/wtypes.h:12,
                 from C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/winscard.h:10,
                 from C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:97,
                 from C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/rpc.h:16,
                 from C:/builds/ab-full/local64/include/DeckLinkAPI.h:7,
                 from C:/builds/ab-full/build/ffmpeg-git/libavdevice/decklink_common.cpp:22:
C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/propidl.h:1288:28: note: previous declaration of 'unsigned char* BSTR_UserMarshal(ULONG*, unsigned char*, OLECHAR**)'
 unsigned char * __RPC_USER BSTR_UserMarshal  (ULONG *, unsigned char *, BSTR *);
                            ^
In file included from C:/builds/ab-full/build/ffmpeg-git/libavdevice/decklink_common.cpp:22:0:
C:/builds/ab-full/local64/include/DeckLinkAPI.h:20699:79: warning: redundant redeclaration of 'unsigned char* BSTR_UserUnmarshal(ULONG*, unsigned char*, OLECHAR**)' in same scope [-Wredundant-decls]
 unsigned char * __RPC_USER BSTR_UserUnmarshal(ULONG *, unsigned char *, BSTR *);
                                                                               ^
In file included from C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/objbase.h:164:0,
                 from C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/ole2.h:17,
                 from C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/wtypes.h:12,
                 from C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/winscard.h:10,
                 from C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:97,
                 from C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/rpc.h:16,
                 from C:/builds/ab-full/local64/include/DeckLinkAPI.h:7,
                 from C:/builds/ab-full/build/ffmpeg-git/libavdevice/decklink_common.cpp:22:
C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/propidl.h:1289:28: note: previous declaration of 'unsigned char* BSTR_UserUnmarshal(ULONG*, unsigned char*, OLECHAR**)'
 unsigned char * __RPC_USER BSTR_UserUnmarshal(ULONG *, unsigned char *, BSTR *);
                            ^
In file included from C:/builds/ab-full/build/ffmpeg-git/libavdevice/decklink_common.cpp:22:0:
C:/builds/ab-full/local64/include/DeckLinkAPI.h:20700:62: warning: redundant redeclaration of 'void BSTR_UserFree(ULONG*, OLECHAR**)' in same scope [-Wredundant-decls]
 void            __RPC_USER BSTR_UserFree     (ULONG *, BSTR *);
                                                              ^
In file included from C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/objbase.h:164:0,
                 from C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/ole2.h:17,
                 from C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/wtypes.h:12,
                 from C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/winscard.h:10,
                 from C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:97,
                 from C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/rpc.h:16,
                 from C:/builds/ab-full/local64/include/DeckLinkAPI.h:7,
                 from C:/builds/ab-full/build/ffmpeg-git/libavdevice/decklink_common.cpp:22:
C:/builds/ab-full/msys64/mingw64/x86_64-w64-mingw32/include/propidl.h:1290:28: note: previous declaration of 'void BSTR_UserFree(ULONG*, OLECHAR**)'
 void            __RPC_USER BSTR_UserFree     (ULONG *, BSTR *);
                            ^
In file included from C:/builds/ab-full/build/ffmpeg-git/libavdevice/decklink_common.cpp:38:0:
C:/builds/ab-full/build/ffmpeg-git/libavdevice/decklink_common.h:115:1: error: invalid conversion from 'int' to 'BMDAudioConnection {aka _BMDAudioConnection}' [-fpermissive]
 };
 ^
C:/builds/ab-full/build/ffmpeg-git/libavdevice/decklink_common.h:125:1: error: invalid conversion from 'int' to 'BMDVideoConnection {aka _BMDVideoConnection}' [-fpermissive]
 };
 ^
C:/builds/ab-full/build/ffmpeg-git/libavdevice/decklink_common.cpp: In function 'int decklink_select_input(AVFormatContext*, BMDDeckLinkConfigurationID)':
C:/builds/ab-full/build/ffmpeg-git/libavdevice/decklink_common.cpp:106:88: warning: enumeral mismatch in conditional expression: 'BMDAudioConnection {aka _BMDAudioConnection}' vs 'BMDVideoConnection {aka _BMDVideoConnection}' [-Wenum-compare]
     int64_t bmd_input              = (cfg_id == bmdDeckLinkConfigAudioInputConnection) ? ctx->audio_input : ctx->video_input;
                                                                                        ^
C:/builds/ab-full/build/ffmpeg-git/libavdevice/decklink_common.cpp: In function 'int ff_decklink_set_format(AVFormatContext*, int, int, int, int, decklink_direction_t, int)':
C:/builds/ab-full/build/ffmpeg-git/libavdevice/decklink_common.cpp:146:93: error: no matching function for call to 'IDeckLinkAttributes::GetFlag(_BMDDeckLinkAttributeID, bool*)'
         if (ctx->attr->GetFlag(BMDDeckLinkSupportsDuplexModeConfiguration, &duplex_supported) != S_OK)
                                                                                             ^
In file included from C:/builds/ab-full/build/ffmpeg-git/libavdevice/decklink_common.cpp:22:0:
C:/builds/ab-full/local64/include/DeckLinkAPI.h:9945:39: note: candidate: virtual HRESULT IDeckLinkAttributes::GetFlag(BMDDeckLinkAttributeID, BOOL*)
     virtual HRESULT STDMETHODCALLTYPE GetFlag(
                                       ^
C:/builds/ab-full/local64/include/DeckLinkAPI.h:9945:39: note:   no known conversion for argument 2 from 'bool*' to 'BOOL* {aka int*}'
make: *** [/build/ffmpeg-git/common.mak:63: libavdevice/decklink_common.o] Error 1

comment:3 by Michael Niedermayer, 8 years ago

Where can Decklink SDK 10.6.6 be found ?

comment:4 by RiCON, 8 years ago

Official link is https://www.blackmagicdesign.com/support, look for "Decklink SDK". It's behind a registration form, so you can also get the needed headers from https://github.com/jb-alvarado/media-autobuild_suite/tree/gh-pages/extras, but I'm not sure if they only work for Windows/MinGW.

Last edited 8 years ago by RiCON (previous) (diff)

comment:5 by Marton Balint, 8 years ago

I've sent a patch to ffmpeg-devel which should fix this.

comment:6 by Michael Niedermayer, 8 years ago

seems not all mingw versions are affected
i copied the stuff from extra into the system header directory and with
x86_64-w64-mingw32-gcc (GCC) 4.6.3
it seems to build fine

comment:7 by Michael Niedermayer, 8 years ago

same sucess with i686-w64-mingw32-gcc (GCC) 4.6.3

comment:8 by Michael Niedermayer, 8 years ago

Note, i tested with release/3.1 not master, master fails too with my mingw

comment:9 by RiCON, 8 years ago

I can confirm the patch fixes the issue building for me.

comment:10 by Marton Balint, 8 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.