johnboiles / coremediaio-dal-minimal-example

Intended to be the most minimalistic example of a macOS CoreMediaIO DAL plugin.
MIT License
211 stars 31 forks source link

Filled the TODOs #1

Closed gxalpha closed 4 years ago

gxalpha commented 4 years ago

I filled in the TODO-Properties and added some that exist in obs-mac-virtualcam but not here. Does not change the behavior.

@johnboiles I feel like you are more into this than I am. I filled out the TODOs, but it obviously still doesn't work. Where do you think is the next place to work at? While the CoreMediaIO stuff is documented really bad, I think I could read myself into it, but I'd need some kind of starting point. :)

brinsche commented 4 years ago

Does anyone know whether having an assistant is required? The project declares one here https://github.com/johnboiles/coremediaio-dal-minimal-example/blob/master/CMIOMinimalSample/Info.plist#L35 but that doesn't exist, does it?

I'm also unsure on how to properly work with the assistant stuff, when testing with the modernised sample it seemed like the only way to test was to put the assistant plist in /Library/LaunchDaemons/ and reboot

johnboiles commented 4 years ago

@gxalpha thanks for poking around here! Here are some things I can think to try:

@brinsche I don't think we need an assistant so we could probably remove that line! The goal of this repo is to just serve blank frames from the plugin itself (without an assistant). But who knows, maybe something about CoreMediaIO wants to know about the source of the data before it will fully start the plugin. I think that's unlikely though.

gxalpha commented 4 years ago

What do you mean with "no stream shows up in Cameo"? For me it does, or do you mean that the Device shows no stream in its properties?

Bildschirmfoto 2020-04-14 um 23 56 19
brinsche commented 4 years ago

@johnboiles ok, that's what I assumed just wanted to mention it. I just tried to look at the implementation of similar apps, most seem to use an assistant but CamCamX doesn't, it's .plist also has additional keys I haven't seen before, I haven't verified that CamCamX still works though, it wasn't updated in a while

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CFBundleDevelopmentRegion</key>
    <string>English</string>
    <key>CFBundleExecutable</key>
    <string>CamCamX.CMIO</string>
    <key>CFBundleIdentifier</key>
    <string>com.b-l-a-c-k-o-p.CamCamX.CMIO</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>CamCamX.CMIO</string>
    <key>CFBundlePackageType</key>
    <string>BNDL</string>
    <key>CFBundleShortVersionString</key>
    <string>2.0.1</string>
    <key>CFBundleSignature</key>
    <string>????</string>
    <key>CFBundleVersion</key>
    <string>2.0.1</string>
    <key>CFPlugInFactories</key>
    <dict>
        <key>664A1EA9-EE29-4EE1-B5F4-C6A37D0731FA</key>
        <string>CMIO_PlugInFactory</string>
    </dict>
    <key>CFPlugInTypes</key>
    <dict>
        <key>30010C1C-93BF-11D8-8B5B-000A95AF9C6A</key>
        <array>
            <string>664A1EA9-EE29-4EE1-B5F4-C6A37D0731FA</string>
        </array>
    </dict>
    <key>CMIOHardwareAssistantServiceNames</key>
    <array>
        <string>com.b-l-a-c-k-o-p.CamCamX.CMIO.unused</string>
    </array>
    <key>NoCMIOHardwarePlugInLazyLoadingInfo</key>
    <array>
        <dict>
            <key>IOProviderClass</key>
            <string>IOVideoCamCamXVirtualDevice</string>
        </dict>
    </array>
</dict>
</plist>
johnboiles commented 4 years ago

@gxalpha thanks for the correction :) I definitely mean the latter: "the Device shows no stream in its properties"

@brinsche it's very interesting that CamCamX defines this in its plist:

    <key>CMIOHardwareAssistantServiceNames</key>
    <array>
        <string>com.b-l-a-c-k-o-p.CamCamX.CMIO.unused</string>
    </array>

The .unused suffix makes me think maybe CoreMedia wants you to register an assistant in the plist even if you don't need one.

johnboiles commented 4 years ago

Thanks for the investigation here y'all! Keep it coming!! I'm sure we can figure this out eventually.

johnboiles commented 4 years ago

I got a little further tonight. The source now shows up in apps, but it crashes the host app with EXC_BAD_ACCESS. I probably have a memory management glitch somewhere in there. But I think it's close!

gxalpha commented 4 years ago

Hey nice!

Also it seems like this PR is obsolete now so I'm going to close it. Tho feel free to reopen it if you want it as a discussion place.