Imported Upstream version 0.13.2+dsfg1
This commit is contained in:
commit
fb3990e9e5
2036 changed files with 287360 additions and 0 deletions
22
plugins/decklink/mac/platform.cpp
Normal file
22
plugins/decklink/mac/platform.cpp
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
#include "../platform.hpp"
|
||||
|
||||
bool DeckLinkStringToStdString(decklink_string_t input, std::string& output)
|
||||
{
|
||||
const CFStringRef string = static_cast<CFStringRef>(input);
|
||||
const CFIndex length = CFStringGetLength(string);
|
||||
const CFIndex maxLength = CFStringGetMaximumSizeForEncoding(length,
|
||||
kCFStringEncodingASCII) + 1;
|
||||
|
||||
char * const buffer = new char[maxLength];
|
||||
|
||||
const bool result = CFStringGetCString(string, buffer, maxLength,
|
||||
kCFStringEncodingASCII);
|
||||
|
||||
if (result)
|
||||
output = std::string(buffer);
|
||||
|
||||
delete[] buffer;
|
||||
CFRelease(string);
|
||||
|
||||
return result;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue