English 中文(简体)
CMBuffer QueueCreate所需要的参数是什么?
原标题:What are the required parameters for CMBufferQueueCreate?

rel=“nofollow” 阅读文件关于SDK,其中说,getDuration和版本是需要的,所有其他呼吁可以是NUL。

但执行以下法典:

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);

时间 反馈:

CMTime timeCallback(CMBufferRef buf, void *refcon){
    return CMTimeMake(1, 1);
}

and queue is:

CMBufferQueueRef* queue;

定点设定失败(频率=0),并恢复以下地位:

kCMBufferQueueError_RequiredParameterMissing = -12761,

<编码>查询<>代码/代码>变量正确初步化,至少 de字表示。

Has anybody used the CMBufferQueue?

问题回答

假设这些参数没有任何错误。 至少与你在CMBuffer Queue.h中就所需参数所说的话相同。 但它认为,你是作为CMBuffer QueueRef* 参数的倒置者。 我对你的样本进行了如下更新,似乎创造了电文。

CMBufferQueueRef queue;
CFAllocatorRef allocator = kCFAllocatorDefault;
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);

时间退却仍然不变。

它不喜欢帮助专题的开端者,但我希望它帮助其他人。





相关问题
Code sign Error

I have created a new iPhone application.I have two mach machines. I have created the certificate for running application in iPhone in one mac. Can I use the other mac for running the application in ...

ABPersonViewController Usage for displaying contact

Created a View based Project and added a contact to the AddressBook using ABAddressBookRef,ABRecordRef now i wanted to display the added contact ABPersonViewController is the method but how to use in ...

将音频Clips从Peter改为服务器

我不禁要问,那里是否有任何实例表明从Peit向服务器发送音响。 I m不关心电话或SIP风格的解决办法,只是一个简单的袖珍流程......

• 如何将搜查线重新定位?

我正试图把图像放在搜索条左边。 但是,问题始于这里,搜索条线不能重新布署。