obs-studio/plugins/decklink/mac/platform.cpp

18 lines
385 B
C++
Raw Normal View History

#include "../platform.hpp"
2018-09-16 08:54:50 -07:00
#include <util/apple/cfstring-utils.h>
bool DeckLinkStringToStdString(decklink_string_t input, std::string& output)
{
const CFStringRef string = static_cast<CFStringRef>(input);
2018-09-16 08:54:50 -07:00
char *buffer = cfstr_copy_cstr(string, kCFStringEncodingASCII);
2018-09-16 08:54:50 -07:00
if (buffer)
output = std::string(buffer);
2018-09-16 08:54:50 -07:00
bfree(buffer);
CFRelease(string);
2018-09-16 08:54:50 -07:00
return (buffer != NULL);
}