Reading the documentation über iOS SDK CMBufferQueueCreate
, es heißt, dass getDuration
und Version erforderlich sind, können alle anderen Rückrufe NULL sein.Welche Parameter sind für CMBufferQueueCreate erforderlich?
Aber Sie den folgenden Code:
CFAllocatorRef allocator;
CMBufferCallbacks *callbacks;
callbacks = malloc(sizeof(CMBufferCallbacks));
callbacks->version = 0;
callbacks->getDuration = timeCallback;
callbacks->refcon = NULL;
callbacks->getDecodeTimeStamp = NULL;
callbacks->getPresentationTimeStamp = NULL;
callbacks->isDataReady = NULL;
callbacks->compare = NULL;
callbacks->dataBecameReadyNotification = NULL;
CMItemCount capacity = 4;
OSStatus s = CMBufferQueueCreate(allocator, capacity, callbacks, queue);
NSLog(@"QUEUE: %x", queue);
NSLog(@"STATUS: %i", s);
mit timeCallback:
CMTime timeCallback(CMBufferRef buf, void *refcon){
return CMTimeMake(1, 1);
}
und Warteschlange ist:
CMBufferQueueRef* queue;
Warteschlange Kreationen fehlschlägt (Warteschlange = 0) und gibt einen Status von:
kCMBufferQueueError_RequiredParameterMissing = -12761,
Die callbacks
Variable ist korrekt initialisiert, zumindest sagt der Debugger.
Hat jemand die CMBufferQueue
verwendet?