I am reading a video file using AVFoundation framework and getting the image buffers as CMSampleBuferRef, I added the buffers in CFMutableArrayRef using CFArrayAppendValue() function.
But If I want to retrieve from that array, Is there any way?
Apple document for CFMutableArrayRef gives no method to retrive from array.
In addition to using the APIs Matt pointed out (+1),
CFMutableArray
is toll-free-bridged withNSMutableArray
. you can simply cast an instance of aCFMutableArray
to anNSMutableArray
and useNSMutableArray
's methods (or the other way around). Following the cast toNSMutableArray
, you can use-[NSArray objectAtIndex:]
.Many Foundation types have CoreFoundation counterparts which are toll free bridged. As a toll free bridged type, the cast does not introduce a promotion or conversion. Think of them as the same type, and that instances may be converted/cast to their CF-NS counterparts without introducing overhead or change to the instance. Technically, implicit reference counting may be introduced if your implementation uses NS-types rather than CF-types under ARC.
This may be useful if you are writing in ObjC, and are more familiar with the ObjC APIs.