CMBufferQueueCreate fail, required parameters?

Posted by Agustin on Stack Overflow See other posts from Stack Overflow or by Agustin
Published on 2011-01-14T12:49:05Z Indexed on 2011/01/14 12:53 UTC
Read the original article Hit count: 361

Filed under:
|
|

Reading the documentation about iOS SDK CMBufferQueueCreate, it says that getDuration and version are required, all the others callbacks can be NULL.

but 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 queue is:

CMBufferQueueRef* queue;

queue creations fails (queue = 0) and returns a status of:

kCMBufferQueueError_RequiredParameterMissing = -12761,

The callbacks variable is correctly initialized, at least the debugger says so.

Somebody have played arround with CMBufferQueue? google doesn't know about that!

Thanks

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c