iPhone视频缓冲区 [英] iPhone video buffer

查看:98
本文介绍了iPhone视频缓冲区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试构建一个没有越狱我的iPhone录像机(我是开发人员许可证)。
我开始使用PhotoLibrary私有框架,但我只能达到2ftp(太慢)。
Cycoder应用程序的fps为15,我认为它使用了不同的方法。
我试图从CameraController的previewView创建一个位图,但它总是返回e黑色位图。

I'm trying to build a video recorder without jailbreaking my iPhone (i've a Developer license). I began using PhotoLibrary private framework, but i can only reach 2ftp (too slow). Cycoder app have a fps of 15, i think it uses a different approach. I tried to create a bitmap from the previewView of the CameraController, but it always returns e black bitmap.

我想知道是否有办法直接访问视频缓冲区,可能带有IOKit框架。

I wonder if there's a way to directly access the video buffer, maybe with IOKit framework.

谢谢
Marco

Thanks Marco

推荐答案

这是一个大问题。到目前为止,我已经解决了使用一些临时固定大小的缓冲区并在满时为每个缓冲区分离一个线程。该线程将缓冲区内容保存在闪存中。启动一些重线程,因为每个线程访问闪存都很重,会降低设备速度并刷新摄像机视图。
缓冲区不能大,因为你会得到内存警告,并且因为你会冻结设备,因为一次有太多线程和访问闪存,所以不能小。
解决方案在于平衡缓冲区大小和线程数。

That is the big problem. So far i've solved using some temp fixed size buffers and detach a thread for every buffer when is full. The thread will save the buffer content in the Flash memory. Launching some heavy threads, heavy beacause each thread access the flash, will slow the device down and the refresh of the camera view. Buffers cannot be big, because you will get memory warning, and cannot be small because you will freeze the device, because of too many threads and accesses to the flash memory at a time. The solution resides in balancing buffer size and number of threads.

我还没有尝试使用sqlite3 db来存储图像二进制数据,但我不知道如果将是一个更好的解决方案。

I haven't already tried to use sqlite3 db to store images binary data, but i don't if will be a better solution.

PS:加快类方法调用,避免常见的解决方案[对象方法]因为方法调用如何工作,但请尝试获取并保存方法地址如下。

PS: to speed up class methods call, avoid the common solution [object method] because of how method call works, but try to get and save the method address as below.

来自Apple ObjC doc:

From Apple ObjC doc:

以下示例显示如何实现setFilled:方法的过程可能是
调用:

"The example below shows how the procedure that implements the setFilled: method might be called:

void (*setter)(id, SEL, BOOL); 
int i; 
setter = (void (*)(id, SEL, BOOL))[target methodForSelector:@selector(setFilled:)]; 
for ( i = 0; i < 1000, i++ ) 
setter(targetList[i], @selector(setFilled:), YES); "

Marco

这篇关于iPhone视频缓冲区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆