2015-02-18 15:21:30 -08:00
|
|
|
#include "../platform.hpp"
|
2018-09-16 08:54:50 -07:00
|
|
|
#include <util/apple/cfstring-utils.h>
|
2015-02-18 15:21:30 -08:00
|
|
|
|
|
|
|
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);
|
2015-02-18 15:21:30 -08:00
|
|
|
|
2018-09-16 08:54:50 -07:00
|
|
|
if (buffer)
|
2015-02-18 15:21:30 -08:00
|
|
|
output = std::string(buffer);
|
|
|
|
|
2018-09-16 08:54:50 -07:00
|
|
|
bfree(buffer);
|
2015-02-18 15:21:30 -08:00
|
|
|
CFRelease(string);
|
|
|
|
|
2018-09-16 08:54:50 -07:00
|
|
|
return (buffer != NULL);
|
2015-02-18 15:21:30 -08:00
|
|
|
}
|