Showing the changes to libavdevice/decklink_common.cpp (1 of 1 file). Show all
Unified · Split
| @@ -70,6 +70,16 @@ static char *dup_wchar_to_utf8(wchar_t *w) · 69 unmodified lines | |||
| 70 | #define DECKLINK_STR OLECHAR * | 70 | #define DECKLINK_STR OLECHAR * |
| 71 | #define DECKLINK_STRDUP dup_wchar_to_utf8 | 71 | #define DECKLINK_STRDUP dup_wchar_to_utf8 |
| 72 | #define DECKLINK_FREE(s) SysFreeString(s) | 72 | #define DECKLINK_FREE(s) SysFreeString(s) |
| 73 | #elif __APPLE__ | ||
| 74 | static char *dup_cfstring_to_utf8(CFStringRef w) | ||
| 75 | { | ||
| 76 | char s[256]; | ||
| 77 | CFStringGetCString(w, s, 255, kCFStringEncodingUTF8); | ||
| 78 | return av_strdup(s); | ||
| 79 | } | ||
| 80 | #define DECKLINK_STR const __CFString * | ||
| 81 | #define DECKLINK_STRDUP dup_cfstring_to_utf8 | ||
| 82 | #define DECKLINK_FREE(s) free((void *) s) | ||
| 73 | #else | 83 | #else |
| 74 | #define DECKLINK_STR const char * | 84 | #define DECKLINK_STR const char * |
| 75 | #define DECKLINK_STRDUP av_strdup | 85 | #define DECKLINK_STRDUP av_strdup |