ios zxing 带前置或后置摄像头

发布于 2024-12-27 14:21:57 字数 341 浏览 3 评论 0原文

我正在使用 ZXing,在我的新应用程序上运行良好,但我想集成前置或后置摄像头的选项,

到目前为止,我发现的唯一参考是 google group

但不太清楚他们的意思那么,

关于我必须做什么才能实现这一目标有什么指示吗?

谢谢 !

Im using ZXing, is working fine on my new app, but i would like to integrate the option of front or rear camera,

so far the only reference to this i've found is on the google group

But is not very clear what they mean with that,

so any pointers on what i have to do to accomplish this?

thanks !

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

风筝在阴天搁浅。 2025-01-03 14:21:57

ZXWidgetController 不提供该功能,并且它的设置并没有真正使其易于更改。

需要更改的代码位于- (void)initCapture中。它调用[AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo]。这将返回默认相机,而您不需要默认相机。

您需要类似于 ZXCapture.mm。该代码不能开箱即用(它被设计为与 AVFF 和 QTKit 一起使用),但它是相同的想法。不要使用默认的视频输入设备,而是浏览设备并查看设备位置以找到所需的设备。

很高兴将该代码移植到小部件中,但目前还没有发生。

ZXWidgetController doesn't provide that functionality and it's not really set up to make it easy to change.

The code that needs to change is in - (void)initCapture. It calls [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo]. This returns the default camera and you don't want the defalt.

You need code similar to that in - (ZXCaptureDevice*)device in ZXCapture.mm. That code won't work out of the box (it's designed to work with both AVFF and QTKit) but it's the same idea. Instead of using the default video input device, go through the devices and look at device position to find the device you want.

Be nice to port that code to the widget but that hasn't happened at this point.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文