summaryrefslogtreecommitdiff
path: root/libavdevice
diff options
context:
space:
mode:
authorJon Morley <jmorley@pixsystem.com>2018-05-25 11:41:06 -0700
committerMarton Balint <cus@passwd.hu>2018-06-13 00:09:48 +0200
commitfb480a1f1e0cba88c3c7424655bacff7c465692b (patch)
tree829e3954f9081ef6af9b28b2fe0efc4114882258 /libavdevice
parentba8a1d161820f9e5f1485118a0f508e312f69a8b (diff)
downloadffmpeg-fb480a1f1e0cba88c3c7424655bacff7c465692b.tar.gz
avdevice/decklink_common: Move DECKLINK_* string functions into header
This allows other decklink source access to these cross-platform convenience functions. Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavdevice')
-rw-r--r--libavdevice/decklink_common.cpp30
-rw-r--r--libavdevice/decklink_common.h30
2 files changed, 30 insertions, 30 deletions
diff --git a/libavdevice/decklink_common.cpp b/libavdevice/decklink_common.cpp
index d8cced7c74..aab9d85b94 100644
--- a/libavdevice/decklink_common.cpp
+++ b/libavdevice/decklink_common.cpp
@@ -77,36 +77,6 @@ static IDeckLinkIterator *decklink_create_iterator(AVFormatContext *avctx)
return iter;
}
-#ifdef _WIN32
-static char *dup_wchar_to_utf8(wchar_t *w)
-{
- char *s = NULL;
- int l = WideCharToMultiByte(CP_UTF8, 0, w, -1, 0, 0, 0, 0);
- s = (char *) av_malloc(l);
- if (s)
- WideCharToMultiByte(CP_UTF8, 0, w, -1, s, l, 0, 0);
- return s;
-}
-#define DECKLINK_STR OLECHAR *
-#define DECKLINK_STRDUP dup_wchar_to_utf8
-#define DECKLINK_FREE(s) SysFreeString(s)
-#elif defined(__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) CFRelease(s)
-#else
-#define DECKLINK_STR const char *
-#define DECKLINK_STRDUP av_strdup
-/* free() is needed for a string returned by the DeckLink SDL. */
-#define DECKLINK_FREE(s) free((void *) s)
-#endif
-
HRESULT ff_decklink_get_display_name(IDeckLink *This, const char **displayName)
{
DECKLINK_STR tmpDisplayName;
diff --git a/libavdevice/decklink_common.h b/libavdevice/decklink_common.h
index f416134b8a..8064abdcb9 100644
--- a/libavdevice/decklink_common.h
+++ b/libavdevice/decklink_common.h
@@ -34,6 +34,36 @@
#define DECKLINK_BOOL bool
#endif
+#ifdef _WIN32
+static char *dup_wchar_to_utf8(wchar_t *w)
+{
+ char *s = NULL;
+ int l = WideCharToMultiByte(CP_UTF8, 0, w, -1, 0, 0, 0, 0);
+ s = (char *) av_malloc(l);
+ if (s)
+ WideCharToMultiByte(CP_UTF8, 0, w, -1, s, l, 0, 0);
+ return s;
+}
+#define DECKLINK_STR OLECHAR *
+#define DECKLINK_STRDUP dup_wchar_to_utf8
+#define DECKLINK_FREE(s) SysFreeString(s)
+#elif defined(__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) CFRelease(s)
+#else
+#define DECKLINK_STR const char *
+#define DECKLINK_STRDUP av_strdup
+/* free() is needed for a string returned by the DeckLink SDL. */
+#define DECKLINK_FREE(s) free((void *) s)
+#endif
+
class decklink_output_callback;
class decklink_input_callback;