MCPcopy Create free account
hub / github.com/cinder/Cinder / openMovieFromPath

Function openMovieFromPath

src/cinder/qtime/QuickTimeUtils.cpp:213–242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

211}
212
213::Movie openMovieFromPath( const fs::path &path )
214{
215 ::Movie result;
216 QTNewMoviePropertyElement movieProps[10];
217 ItemCount moviePropCount = 0;
218
219 moviePropCount = openMovieBaseProperties( movieProps );
220
221#if defined( CINDER_MSW )
222 std::string pathUtf8 = msw::toUtf8String( path.wstring() );
223 ::CFStringRef basePathCF = ::CFStringCreateWithCString( kCFAllocatorDefault, pathUtf8.c_str(), kCFStringEncodingUTF8 );
224#else
225 ::CFStringRef basePathCF = ::CFStringCreateWithCString( kCFAllocatorDefault, path.string().c_str(), kCFStringEncodingUTF8 );
226#endif
227 shared_ptr<const __CFString> pathCF = shared_ptr<const __CFString>( basePathCF, ::CFRelease );
228 // Store the movie properties in the array
229 movieProps[moviePropCount].propClass = kQTPropertyClass_DataLocation;
230 movieProps[moviePropCount].propID = kQTDataLocationPropertyID_CFStringNativePath;
231 movieProps[moviePropCount].propValueSize = sizeof(CFStringRef);
232 movieProps[moviePropCount].propValueAddress = (void*)&basePathCF;
233 movieProps[moviePropCount].propStatus = 0;
234 moviePropCount++;
235
236 OSStatus err;
237 if( (err = ::NewMovieFromProperties( moviePropCount, movieProps, 0, NULL, &result ) ) != noErr ) {
238 throw QuickTimePathInvalidExc();
239 }
240
241 return result;
242}
243
244Handle createPointerReferenceHandle( void *data, Size dataSize )
245{

Callers 2

initFromPathMethod · 0.85
initFromDataSourceMethod · 0.85

Calls 6

openMovieBasePropertiesFunction · 0.85
toUtf8StringFunction · 0.85
wstringMethod · 0.80
c_strMethod · 0.45
stringMethod · 0.45

Tested by

no test coverage detected