Imported Upstream version 0.13.2+dsfg1

This commit is contained in:
Sebastian Ramacher 2016-02-24 00:16:51 +01:00
commit fb3990e9e5
2036 changed files with 287360 additions and 0 deletions

View 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;
}