Я использую Apple VideoTool Box (iOS) для сжатия необработанных кадров, снятых камерой устройства.
Мой обратный вызов вызывается с объектом CMSampleBufferRef, который содержит CMBlockBuffer.
Объект CMBlockBuffer содержит элементарный поток H264, но я не нашел способа получить указатель на элементарный поток.
Когда я напечатал в консоли объект CMSampleBufferRef, я получил:
(lldb) po blockBufferRef
CMBlockBuffer 0x1701193e0 totalDataLength: 4264 retainCount: 1 allocator: 0x1957c2c80 subBlockCapacity: 2
[0] 4264 bytes @ offset 128 Buffer Reference:
CMBlockBuffer 0x170119350 totalDataLength: 4632 retainCount: 1 allocator: 0x1957c2c80 subBlockCapacity: 2
[0] 4632 bytes @ offset 0 Memory Block 0x10295c000, 4632 bytes (custom V=0 A=0x0 F=0x18498bb44 R=0x0)