[vlc-commits] Decklink: Use typedef instead of macro

Marvin Scholz git at videolan.org
Mon Oct 22 18:47:18 CEST 2018


vlc | branch: master | Marvin Scholz <epirat07 at gmail.com> | Mon Oct 22 09:27:21 2018 +0200| [703f9af966fbd0f0aad241f2bf63acba968cccb6] | committer: Marvin Scholz

Decklink: Use typedef instead of macro

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=703f9af966fbd0f0aad241f2bf63acba968cccb6
---

 modules/access/decklink.cpp             | 6 +++---
 modules/access/vlc_decklink.h           | 4 ++--
 modules/stream_out/sdi/DBMSDIOutput.cpp | 4 ++--
 modules/video_output/decklink.cpp       | 4 ++--
 4 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/modules/access/decklink.cpp b/modules/access/decklink.cpp
index e1def76adc..66d9c85108 100644
--- a/modules/access/decklink.cpp
+++ b/modules/access/decklink.cpp
@@ -261,7 +261,7 @@ public:
         if( !(events & bmdVideoInputDisplayModeChanged ))
             return S_OK;
 
-        DECKLINK_STR tmp_name;
+        decklink_str_t tmp_name;
         char *mode_name;
         if (mode->GetName(&tmp_name) != S_OK) {
             mode_name = strdup("unknown");
@@ -561,7 +561,7 @@ static int Open(vlc_object_t *p_this)
         }
     }
 
-    DECKLINK_STR tmp_name;
+    decklink_str_t tmp_name;
     char *model_name;
     if (sys->card->GetModelName(&tmp_name) != S_OK) {
         model_name = strdup("unknown");
@@ -648,7 +648,7 @@ static int Open(vlc_object_t *p_this)
         uint32_t field_flags;
         const char *field = GetFieldDominance(m->GetFieldDominance(), &field_flags);
         BMDDisplayMode id = ntohl(m->GetDisplayMode());
-        DECKLINK_STR tmp_name;
+        decklink_str_t tmp_name;
 
         if (m->GetName(&tmp_name) != S_OK) {
             mode_name = "unknown";
diff --git a/modules/access/vlc_decklink.h b/modules/access/vlc_decklink.h
index 4b59557996..cb61d40a40 100644
--- a/modules/access/vlc_decklink.h
+++ b/modules/access/vlc_decklink.h
@@ -37,11 +37,11 @@
 #elif defined(__APPLE__)
 #include <vlc_common.h>
 #include <vlc_charset.h>
-#define DECKLINK_STR    const __CFString *
+typedef CFStringRef decklink_str_t;
 #define DECKLINK_STRDUP(s) FromCFString(s, kCFStringEncodingUTF8)
 #define DECKLINK_FREE(s) CFRelease(s)
 #else
-#define DECKLINK_STR    const char *
+typedef char* decklink_str_t;
 #define DECKLINK_STRDUP strdup
 #define DECKLINK_FREE(s) free((void *) s)
 #endif
diff --git a/modules/stream_out/sdi/DBMSDIOutput.cpp b/modules/stream_out/sdi/DBMSDIOutput.cpp
index 956ed2a08f..5bbbcdf177 100644
--- a/modules/stream_out/sdi/DBMSDIOutput.cpp
+++ b/modules/stream_out/sdi/DBMSDIOutput.cpp
@@ -107,7 +107,7 @@ IDeckLinkDisplayMode * DBMSDIOutput::MatchDisplayMode(const video_format_t *fmt,
                 BMDTimeValue frameduration;
                 BMDTimeScale timescale;
                 const char *psz_mode_name;
-                DECKLINK_STR tmp_name;
+                decklink_str_t tmp_name;
 
                 if(p_mode->GetFrameRate(&frameduration, &timescale) == S_OK &&
                         p_mode->GetName(&tmp_name) == S_OK)
@@ -243,7 +243,7 @@ int DBMSDIOutput::Open()
         CHECK("Card not found");
     }
 
-    DECKLINK_STR tmp_name;
+    decklink_str_t tmp_name;
     const char *psz_model_name;
     result = p_card->GetModelName(&tmp_name);
     CHECK("Unknown model name");
diff --git a/modules/video_output/decklink.cpp b/modules/video_output/decklink.cpp
index a0b29606d1..7f1c0d0660 100644
--- a/modules/video_output/decklink.cpp
+++ b/modules/video_output/decklink.cpp
@@ -493,7 +493,7 @@ static IDeckLinkDisplayMode * MatchDisplayMode(vout_display_t *vd,
                 BMDTimeScale timescale;
                 char *psz_mode_name;
 
-                DECKLINK_STR tmp_name;
+                decklink_str_t tmp_name;
                 if(p_mode->GetFrameRate(&frameduration, &timescale) == S_OK &&
                         p_mode->GetName(&tmp_name) == S_OK)
                 {
@@ -626,7 +626,7 @@ static int OpenDecklink(vout_display_t *vd, decklink_sys_t *sys)
         CHECK("Card not found");
     }
 
-    DECKLINK_STR tmp_name;
+    decklink_str_t tmp_name;
     char *psz_model_name;
     result = p_card->GetModelName(&tmp_name);
     CHECK("Unknown model name");



More information about the vlc-commits mailing list