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

Function openMovieFromMemory

src/cinder/qtime/QuickTimeUtils.cpp:378–408  ·  view source on GitHub ↗

Refer to http://developer.apple.com/technotes/tn/tn1195.html Technical Note TN1195 "Tagging Handle and Pointer Data References in QuickTime"

Source from the content-addressed store, hash-verified

376
377// Refer to http://developer.apple.com/technotes/tn/tn1195.html Technical Note TN1195 "Tagging Handle and Pointer Data References in QuickTime"
378::Movie openMovieFromMemory( const void *data, size_t dataSize, const string &fileNameHint, const string &mimeTypeHint )
379{
380 Handle dataRefHandle = createPointerDataRefWithExtensions( const_cast<void*>( data ), dataSize, fileNameHint, mimeTypeHint );
381
382 ::Movie result;
383/* QTNewMoviePropertyElement movieProps[10];
384 ItemCount moviePropCount = 0;
385 DataReferenceRecord dataRef = {0};
386
387 moviePropCount = openMovieBaseProperties( movieProps );
388
389 // Store the movie properties in the array
390 movieProps[moviePropCount].propClass = kQTPropertyClass_DataLocation;
391 movieProps[moviePropCount].propID = kQTDataLocationPropertyID_QTDataHandler;
392 movieProps[moviePropCount].propValueSize = sizeof(aQTDataRef);
393 movieProps[moviePropCount].propValueAddress = (void*)&dataRefHandle;
394 movieProps[moviePropCount].propStatus = 0;
395 moviePropCount++;
396
397 OSErr err;
398 if( (err = NewMovieFromProperties(moviePropCount, movieProps, 0, NULL, &result) ) != noErr ) {
399 throw QuickTimeErrorLoadingExc();
400 }*/
401
402 short myResID = 0;
403 OSErr err = NewMovieFromDataRef( &result, newMovieActive | newMovieAsyncOK, &myResID, dataRefHandle, 'ptr ' );
404 if( err )
405 throw QuickTimeErrorLoadingExc();
406
407 return result;
408}
409
410Surface8uRef convertCVPixelBufferToSurface(CVPixelBufferRef pixelBufferRef)
411{

Callers 2

initFromMemoryMethod · 0.85
initFromDataSourceMethod · 0.85

Tested by

no test coverage detected