Reading the documentation on the iOS SDK CMBufferQueueCreate, it says that a getDurationversion is needed, all other callbacks can be NULL.
By running the following 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);
with timeCallback:
CMTime timeCallback(CMBufferRef buf, void *refcon){
return CMTimeMake(1, 1);
}
and turn:
CMBufferQueueRef* queue;
failures to create the queue (queue = 0) and returns the status:
kCMBufferQueueError_RequiredParameterMissing = -12761,
The variable is callbackscorrectly initialized, at least the debugger talks about it.
Has anyone used CMBufferQueue?
source
share