Camera device on MAC OS - macos

Having my webcam plugged in, I'm able to manipulate the video/audio stream in my MAC OS app.
Now I'd like to output it as a new virtual video/audio device that I can select as a camera input in apps like "Skype" or QuickTime.
I've looked into i/o kit framework and the reference webpage says this:
"To add digital video capabilities to your software, use the QuickTime
APIs."
I believe this needs to be updated because QuickTime APIs have been replaced by CoreMedia IO.
So I looked into CoreMediaIO and found a sample code from Apple dev website that also is obsolete and won't run on XCode 7.x with OS Yosemite+.
I've also looked in AVFoundation but it seems like a dead end.
I'm lost at this point. I know it's doable since CamTwist software is doing it.
Anyone has an idea how to approach this?

CoreMediaIO is definitely the way to go, as that's what Apple currently uses in its hardware. On my system (2015 rMBP), /Library/CoreMediaIO/Plug-Ins/DAL/ contains AppleCamera.plugin and iOSScreenCapture.plugin, for the webcam and capturing from iDevice.
I assume the example you're referring to is this one?
It doesn't quite compile out of the box, but I got it to build with the OSX 10.11 SDK eventually. You need Apple's Core Audio Utility Classes, point the 'Sources/Extras/CoreAudio/PublicUtility' group in the Xcode project at those, and then fix a variable initialisation (remove the = NULL where it complains about a private constructor) and comment out a few lines in SamplePrefix.h. I haven't run it, but I see no reason why it wouldn't. If you don't have a kext signing certificate, you may need to take steps to load unsigned kexts to run the sample.

Is your webcam using the old video-digitaizer driver (driver .component file is located in /Library/QuickTime)? I was able to see my UVC-camera and DAL camera in QuickTime player. My understanding is that Apps written in AVFoundation will not recongize old vdig driver. On the contrary, Apps written using Sequence Grabber (very old) / QTCapture (old) will recongize your device.
Hope this helps.

Related

Keychain viewers - what does DPFMate do?

Got this Digital Keychain Photo viewer thingy. Comes with DPFMate which does not run under Windows 10. Does anyone know where DPFMate places the images on the keychain, so I could possibly write my own program to do the move?
i know this thread dates back to April but i have a device that uses DPFmate and it was packaged with it in memory. the software came with a windows and a mac version. fortunately most of the code is literally available in an uncompiled form in the mac app package. i have included everything from that package in a mediafire link. https://www.mediafire.com/file/ebyxepk013k18pd/Resources.rar
from what i gathered it loads a virtual drive from the machine using a SCSI connection driver of some sorts. i hope you can make sens of it more than me since i am not familiar with the programming language used.

JavaFX MediaPlayer stutters on Mac with mp4 files

To reproduce the problem you can use the JavaFX sample project AdvancedMedia. Replace the flv video with a mp4 one which encoding type is supported by JavaFX.
Edit: I thought maybe people are having trouble to edit the sample. Just place a video in the project root folder and set MEDIA_URL to new File("video.mp4").toURI().toString().
It works great on Windows platforms. However, on Mac the video stutters in the beginning and before it ends. When running the project on terminal with java -jar AdvancedMedia.jar it shows the following messages:
AVF info: checkDecoderUsage, vaCodecString: <Gen6>
AVF info: pp_hw_name: RenderingEngine, id: 3ea, m_pp_nowait: 1
AVF info: RingBufferPool wr:0, rd:108, reset:93, warning:0
I saw this error occurs with MacBook Pro, Air, i5/i7 processors etc. Is there any way to solve the stuttering/error messages?
I tested running with -Dprism.verbose=true and I saw a major difference between Windows and Mac platforms: on Windows the Prism platform init order is d3d sw while on Mac it is es2 sw; the Prism pipeline name is com.sun.prism.d3d.D3DPipeline and com.sun.prism.es2.ES2Pipeline respectively.
Maybe a possible solution is to use the same D3D pipeline on Mac? But if running with -Dprism.order=d3d,sw it gives java.lang.ClassNotFoundException: com.sun.prism.d3d.D3DPipeline.
I also tried to increase JVM memory with the -Xms option but it had no effect. So it really seems to be a codecs issue even though the videos play smoothly on other platforms.
I was testing a Windows generated jar on Mac, so now I also tried to build the AdvancedMedia example on Mac thinking it could make some difference, but nothing changed.
It seems that maybe this is more like a JavaFX bug report than a question.
A little off-topic, but I have to say that before this I tried C++ and VLCj approaches for my application and I changed it only because of Mac functionality issues...
I found out that this bug happens on Mac with any H.264 encoded video, regardless of the file extension. So as described on the docs, the only other alternative JavaFX offers is to use VP6 encoding, which is not easy to get - see my other question - but at least the videos will run smoothly and without any rendering error messages.

Simple HID OSX Application

I am getting started with coding for HID devices. I got started with reading Apple documents and sample code. The code provided are terribly outdated that it doesn't even open in Xcode8.
Download Sample Code from Apple
I need help in finding a sample project / snippet for getting started with HID Services! Open a handle, read and write reports to device, Listen to reports generated by device in a run loop.
OS X/macOS's HID stack is called IOHIDFamily, and much of it is open source. This includes kernel and userspace components. You can find the code for various different OS X/macOS releases at
https://opensource.apple.com/
For 10.12.2 (latest code released at time of writing) you can browse the IOHIDFamily code here:
https://opensource.apple.com/source/IOHIDFamily/IOHIDFamily-870.31.1/
or download it as a zip file here:
https://opensource.apple.com/tarballs/IOHIDFamily/IOHIDFamily-870.31.1.tar.gz
The "tools" directory contains some userspace sample/test code which might help with what you're trying to do.
As for sample code not being updated, documentation being incomplete/outdated/missing, and provided code requiring a lot of effort to build: welcome to Mac systems & driver development. That's unfortunately how it is. I've been doing OS X kernel/driver work for 7 years, and while some things get easier with experience, downloading code from Apple and building it still feels like playing the lottery.

Accessing iOS filesystem for Mac

I was trying out the mac app DiskAid and found it does everything that I need to be able to do in the app I am writing. DiskAid appears to have complete access to the filesystem on my iPad. This is not limited to the shared files by the applications on the iPad - not by a long shot. DiskAid sees all the files for every app on the device (sharer or otherwise). It is also not limited to files in the Documents directory for each app. It sees all files down to root level.
I was also amazed when I discovered that iTunes doesn't even have to be running for all of this to work. Also I don't recall having to authenticate in any way (apple ID or anything like that) I just plug in the device via usb and away she goes.
I've been searching for days now and have not found anything that even hints that this is even possible. Yet we know it is.
Does anyone have any idea how they are pulling this off. By the way my device is not jailbroken.
Any help with this would be greatly appreciated. Thanks.
There is info DigiDNA blog that what they use is Apple Mobile Device Service library, which they say function as driver to Apple device. A google search to the library brought me to the Iphone Wiki site about reverse engineered C header files needed to link to the library. Hope it will be useful.

What is the state of TWAIN on the Macintosh today?

I'm currently working on a project where we want to interface with TWAIN scanners on both the PC (Windows) and the Macintosh.
On Windows, we basically have everything squared away and the code works successfully with the vast majority of scanners.
On Mac OS X, we also basically have everything working and with the main scanner we used to develop the application with works perfectly, but we're not having a ton of luck with other scanners. As a byproduct of development on this project, we have a fair number of scanners from various manufacturers on-hand to test with. The results vary wildly:
The scanner we used to develop with works perfectly on Mac OS X as it does in Windows. Ironically this scanner is the cheapest and crappiest scanner (speed-wise) we've ever encountered but it's been a dream to work with.
Another scanner works great - until the second or third scan, at which point the application crashes with no clear indication of what happened (we get an EXEC_BAD_ACCESS from the debugger)
Another scanner apparently has no TWAIN support on Mac OS X (no data sources in the "Image Capture/TWAIN Data Sources" folder), although it does have TWAIN support in Windows.
Another scanner has a generic data source that I'm thinking is supposed to cover all the possible scanners from this manufacturer but when we try to initiate a native scan (which is a requirement for all TWAIN data sources) we get no results. Also, trying to install a second scanner from this manufacturer gums everything up and requires a manual uninstall for everything from this company.
Another scanner has a TWAIN data source that appears to be specific to the manufacturer, but it also fails to initiate a native scan (but a scan using the native GUI - which is incompatible with our project - works)
So I'm not sure where to go with this. I'm still digging into the code to figure out what, if anything, we're doing wrong but in checking against the TWAIN standard it really does look like we're doing everything right, but we're getting very hit-or-miss results on most of the scanners we're testing against.
Also, as part of the new Cocoa/Carbon Events model there's this additional consideration of a "callback" function that Mac OS X TWAIN data sources are supposed to implement and I'm not seeing it called from most of these data source/drivers.
So all of this leads me to wonder - is it that we're just doing something wrong or is TWAIN just not supported properly by and large on the Macintosh?
I'm really not seeing a lot of information on TWAIN on the Macintosh online - the occasional sporadic inquiry on twainforum.org tends to go unanswered. Windows also has a thing called WIA - Windows Image Acquisition - and on the Windows side we also include this as an option. Is there something else on the Mac we should be exploring instead of or in addition to TWAIN?
You can try ImageCaptureCore.framework. But you have to verify that the company/model scanners to which you are giving solution have ImageCapture support.
If any vendor has given support then a ImageCapture module will be present in location '/Library/Image Capture/Devices'. You can also check the plists inside modules for supported models.
Hope it helps :-)

Resources