Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
732 views
in Technique[技术] by (71.8m points)

macos - 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. This can be done manually using QuickTime Player, but I want to do the same programatically.

Reading the docs, the iOS 8 device should be exposed as a webcam.

Calling [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo] on my Mac returns an NSArray with no elements.

How can I setup a mirroring session using iOS 8 and Yosemite? How can I detect the capture device for the mirroring session?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Quoting from p28 of the PDF transcript for WWDC 2014 session #508 “Camera Capture: Manual Controls”:

iOS devices are presented as CoreMedia IO “DAL” plug-ins

You must opt in to see iOS screen devices in your OS X app

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...