avdevice/decklink_common: Fix Decklink for Mac
authorGeorg Lippitsch <georg.lippitsch@gmx.at>
Sun, 11 Jan 2015 14:38:46 +0000 (15:38 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 8 Feb 2015 03:43:54 +0000 (04:43 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavdevice/decklink_common.cpp

index 07e1651..82b8bdb 100644 (file)
@@ -70,6 +70,16 @@ static char *dup_wchar_to_utf8(wchar_t *w)
 #define DECKLINK_STR    OLECHAR *
 #define DECKLINK_STRDUP dup_wchar_to_utf8
 #define DECKLINK_FREE(s) SysFreeString(s)
+#elif __APPLE__
+static char *dup_cfstring_to_utf8(CFStringRef w)
+{
+    char s[256];
+    CFStringGetCString(w, s, 255, kCFStringEncodingUTF8);
+    return av_strdup(s);
+}
+#define DECKLINK_STR    const __CFString *
+#define DECKLINK_STRDUP dup_cfstring_to_utf8
+#define DECKLINK_FREE(s) free((void *) s)
 #else
 #define DECKLINK_STR    const char *
 #define DECKLINK_STRDUP av_strdup