GST_DEBUG ("Input %d supports:", i);
while ((ret = mode_iter->Next (&mode)) == S_OK) {
- const char *name;
+ char *name;
mode->GetName ((COMSTR_T *) & name);
CONVERT_COM_STRING (name);
GST_DEBUG ("Output %d supports:", i);
while ((ret = mode_iter->Next (&mode)) == S_OK) {
- const char *name;
+ char *name;
mode->GetName ((COMSTR_T *) & name);
CONVERT_COM_STRING (name);
#define bool BOOL
#define COMSTR_T BSTR
-#define FREE_COM_STRING(s) delete[] s;
-#define CONVERT_COM_STRING(s) BSTR _s = (BSTR)s; s = _com_util::ConvertBSTRToString(_s); ::SysFreeString(_s);
+/* MinGW does not have comsuppw.lib, so no _com_util::ConvertBSTRToString */
+# ifdef __MINGW32__
+# define CONVERT_COM_STRING(s) BSTR _s = (BSTR)s; s = (char*) malloc(100); wcstombs(s, _s, 100); ::SysFreeString(_s);
+# define FREE_COM_STRING(s) free(s);
+# else
+# define CONVERT_COM_STRING(s) BSTR _s = (BSTR)s; s = _com_util::ConvertBSTRToString(_s); ::SysFreeString(_s);
+# define FREE_COM_STRING(s) delete[] s;
+# endif
#else
#define COMSTR_T const char*
-#define FREE_COM_STRING(s)
#define CONVERT_COM_STRING(s)
-#endif /* _MSC_VER */
+#define FREE_COM_STRING(s)
+#endif /* G_OS_WIN32 */
typedef enum {
GST_DECKLINK_MODE_AUTO,
if host_machine.system() == 'windows'
decklink_sources += ['win/DeckLinkAPIDispatch.cpp', 'win/DeckLinkAPI_i.c']
- # Only used by MSVC. On MinGW, this is all inlined.
- # FIXME: Use commsuppwd.lib for debug builds?
- comutil_dep = cxx.find_library('comsuppw', required : false)
- if comutil_dep.found()
+ if cxx.get_id() == 'msvc'
+ # FIXME: Use commsuppwd.lib for debug builds?
+ comutil_dep = cxx.find_library('comsuppw')
+ if comutil_dep.found()
+ build_decklink = true
+ decklink_libs = [comutil_dep]
+ endif
+ else
build_decklink = true
- decklink_libs = [comutil_dep]
endif
else
libdl = cc.find_library('dl', required: false)