简体   繁体   English

如何在iOS 8和Yosemite之间设置镜像会话?

[英]How do I set up a mirroring session between iOS 8 and Yosemite?

On OS X Yosemite, the screen of an iOS 8 device can be mirrored to the OS X machine and saved as a media file. 在OS X Yosemite上,iOS 8设备的屏幕可以镜像到OS X计算机并保存为媒体文件。 This can be done manually using QuickTime Player, but I want to do the same programatically. 这可以使用QuickTime Player手动完成,但我想以编程方式执行相同的操作。

Reading the docs, the iOS 8 device should be exposed as a webcam. 阅读文档时,iOS 8设备应该作为网络摄像头公开。

Calling [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo] on my Mac returns an NSArray with no elements. 在我的Mac上调用[AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo]返回一个没有元素的NSArray

How can I setup a mirroring session using iOS 8 and Yosemite? 如何使用iOS 8和Yosemite设置镜像会话? How can I detect the capture device for the mirroring session? 如何检测镜像会话的捕获设备?

Quoting from p28 of the PDF transcript for WWDC 2014 session #508 “Camera Capture: Manual Controls” : 引自2014年WWDC会议#508“相机捕获:手动控制”的PDF成绩单第28页

iOS devices are presented as CoreMedia IO “DAL” plug-ins iOS设备显示为CoreMedia IO“DAL”插件

You must opt in to see iOS screen devices in your OS X app 您必须选择在OS X应用中查看iOS屏幕设备

 CMIOObjectPropertyAddress prop = { kCMIOHardwarePropertyAllowScreenCaptureDevices, kCMIOObjectPropertyScopeGlobal, kCMIOObjectPropertyElementMaster }; UInt32 allow = 1; CMIOObjectSetPropertyData( kCMIOObjectSystemObject, &prop, 0, NULL, sizeof(allow), &allow ); 

Also, see my blog for CoreMediaIO capture sample to directly intercept the raw compressed payload sent out from the device 另外,请参阅我的博客,了解CoreMediaIO捕获示例,以直接拦截从设备发出的原始压缩有效负载

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM