fix: DeckLink macOS build — CFStringRef and CoreFoundation

GetDisplayName returns CFStringRef on macOS (not const char*).
Add #ifdef __APPLE__ handling in DeckLinkSender.hpp and
DeckLinkReceiver.hpp, and link -framework CoreFoundation in
decklinkin/decklinkout CMakeLists.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
JohannesItten
2026-07-07 19:58:46 +03:00
parent 8dfeeacecd
commit 32fe6aa22a
4 changed files with 40 additions and 6 deletions
+17 -3
View File
@@ -11,6 +11,9 @@
#include <string>
#include <vector>
#include <DeckLinkAPI.h>
#ifdef __APPLE__
#include <CoreFoundation/CoreFoundation.h>
#endif
#include "Signal.hpp"
namespace dmf {
@@ -268,9 +271,20 @@ private:
IDeckLinkInput* inp = nullptr;
if (device->QueryInterface(IID_IDeckLinkInput, (void**)&inp) == S_OK) {
inp->Release();
const char* name = nullptr;
device->GetDisplayName(&name);
devices.push_back({index, name ? name : "?"});
std::string name = "?";
#ifdef __APPLE__
CFStringRef cfName = nullptr;
if (device->GetDisplayName(&cfName) == S_OK && cfName) {
char buf[256] = {};
CFStringGetCString(cfName, buf, sizeof(buf), kCFStringEncodingUTF8);
name = buf;
CFRelease(cfName);
}
#else
const char* cname = nullptr;
if (device->GetDisplayName(&cname) == S_OK && cname) name = cname;
#endif
devices.push_back({index, name});
raw_devices.push_back(device);
index++;
} else {