Objective c 如何在以编程方式拍摄快照时关闭相机灯光?
我正在开发一个应用程序,希望在运行时捕获图像。 它必须同时适用于MAC PRO和MAC mini(如果连接了网络摄像头)。当相机拍照时,拍摄快照时,小灯光将出现,但不应出现。这与闪光灯无关。 代码片段:Objective c 如何在以编程方式拍摄快照时关闭相机灯光?,objective-c,macos,camera,Objective C,Macos,Camera,我正在开发一个应用程序,希望在运行时捕获图像。 它必须同时适用于MAC PRO和MAC mini(如果连接了网络摄像头)。当相机拍照时,拍摄快照时,小灯光将出现,但不应出现。这与闪光灯无关。 代码片段: - (void)captureOutput:(QTCaptureOutput *)captureOutput didOutputVideoFrame:(CVImageBufferRef)videoFrame withSampleBuffer:(QTSampleBuffer *)sampleBuf
- (void)captureOutput:(QTCaptureOutput *)captureOutput didOutputVideoFrame:(CVImageBufferRef)videoFrame withSampleBuffer:(QTSampleBuffer *)sampleBuffer fromConnection:(QTCaptureConnection *)connection
{
// If we already have an image we should use that instead
if ( currentImage ) return;
// Retain the videoFrame so it won't disappear
// don't forget to release!
CVBufferRetain(videoFrame);
// The Apple docs state that this action must be synchronized
// as this method will be run on another thread
@synchronized (self) {
currentImage = videoFrame;
}
// As stated above, this method will be called on another thread, so
// we perform the selector that handles the image on the main thread
[self performSelectorOnMainThread:@selector(saveImage) withObject:nil waitUntilDone:NO];
}
为了拍摄这张照片,我正在使用上面的方法。提前感谢据介绍,通过直接连接到电路板逻辑,可以绕过几款旧款MacBook的摄像头LED
据我所知,不再存在这种安全漏洞,Objective-C中也没有API可用于禁用摄像头LED。Hm,现在您想怎么做?也许是为了掩盖摄像机正在使用的事实?很可能,当摄像头处于活动状态时,指示灯会自动打开,要更改,您必须更改摄像头本身的固件。只是我想在应用程序运行期间关闭指示灯…Mac Pro没有内置摄像头,您是说MacBook Pro吗?是的,是的,是的,是的,是的,是的,是的,是的,是的,是你不知道摄像机的活动灯变成绿色,你需要黑客的司机。灯光的作用是让用户意识到使用了摄像头。关闭它看起来很可疑,好像你想秘密拍摄图像/视频。但在我的应用程序中,我想在用户不知情的情况下关闭它。任何我们可以通过that@YogeeshHT不,没有API可以提供在不提醒用户的情况下拍照的方法。这就是重点所在,也是为什么它是在固件(或硬件,可能是在较新的型号中)中实现的。