File: platform.cpp

package info (click to toggle)
obs-studio 29.0.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 35,920 kB
  • sloc: ansic: 182,921; cpp: 98,959; sh: 1,591; python: 945; makefile: 858; javascript: 19
file content (17 lines) | stat: -rw-r--r-- 385 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include "../platform.hpp"
#include <util/apple/cfstring-utils.h>

bool DeckLinkStringToStdString(decklink_string_t input, std::string &output)
{
	const CFStringRef string = static_cast<CFStringRef>(input);

	char *buffer = cfstr_copy_cstr(string, kCFStringEncodingASCII);

	if (buffer)
		output = std::string(buffer);

	bfree(buffer);
	CFRelease(string);

	return (buffer != NULL);
}