-
Notifications
You must be signed in to change notification settings - Fork 747
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Preset: Black Magic Decklink API #528
Comments
You'll probably need to add more |
Still getting the same error above. The parser is failing on a brace of the structure IUnknown. It is declared in the file Unknwnbase.h, which is part of the Windows SDK. Relevant parts below:
I did some probing into the parser using the debugger. Item 18 in Parser.declList has the definition of IUnknown, which is just the basic type. So it is at least finding the typedef, which is good. I also stepped through the parsing of the line with IUnknown on it. Was expecting it to go into the group(...) function, but it failed. I figured it would start heading down. Here are some things I've tried:
I tried creating the structure myself inside the presets .java file and ignoring Unknwnbase.h . Didn't seem to count as a real definition; is this something that can/should done when I only want to use a piece of the file? It's also possible that this is actually an error with the Parser. Any advice is greatly appreciated; I will continue slugging in the meantime. |
You'll need to ignore .put(new Info("MIDL_INTERFACE", "__clrcall", "STDMETHODCALLTYPE").annotations().cppTypes()) You'll also need to override the .put(new Info("BEGIN_INTERFACE").cppText("#define BEGIN_INTERFACE"))
.put(new Info("END_INTERFACE").cppText("#define END_INTERFACE")) |
Hi Sam, I've actually made decent progress on building bindings for BMD SDK; see the following project: I have what appears to be last issue remaining and I'm not sure what magic incantation to use to alleviate it. Given the following struct:
The structures generated by javacpp for callbacks have JNI constructs (jlong) rather than their original values: Snippets from jnidecklink.cpp
As a result, I get the following compilation error:
Is there some way to overcome this using Info and InfoMap? |
We'll probably need to add a cast for this to work, with something like this: infoMap.putFirst(new Info("long").cast().valueTypes("long").pointerTypes("CLongPointer")) |
Success! This was the secret sauce I was missing:
Now the structures are finally being recognized as structures and I don't have to CINTERFACE flag. I have a card at home and was able to easily verify the API is working by mirroring some samples. Here's my current plan of attack now that I have a working prototype:
Thanks for the help Sam; this project just keeps getting better and easier to use! |
Awesome! Looking forward to your update at pull #543! BTW, there's no cross-platform API that doesn't require COM? I don't see how we're supposed to be using COM on Linux and Mac... |
They provide COM emulation in the form of headers within their SDK. As for #543, the licensing is a non-starter. I plan on closing it once I've completed the Decklink Bindings. Licensing shouldn't be a problem for the bindings since we can use a more permissive license here (or simply duplicate the SDK license). |
I'm working on building a Windows x64 preset for the Desktop Video SDK, which interfaces with several Black Magic devices including Decklink cards. Currently, I'm running into an issue where the Parser seems to choke on a particular class definition in the Windows SDK.
I've experimented with the headers a bit, but ultimately the Parser cannot figure out the IUnknown interface (which is COM).
Here is the error I get from Maven:
[ERROR] Failed to execute goal org.bytedeco:javacpp:1.4.1-SNAPSHOT:build (javacp p.parser) on project bmddecklink: Failed to execute JavaCPP Builder: C:\Program Files (x86)\Windows Kits\10\Include\10.0.16299.0\um\Unknwnbase.h:110:Could not parse declaration at '{' -> [Help 1]
I followed the instructions for building on Windows very thoroughly, and was able to build and install cuda successfully, so I'm pretty sure the environment is setup right.
If you get a moment, take a quick peek at my fork which has the bmddecklink project it in; maybe there is something glaring obvious.
Some info about my system:
Win 10 Pro
JavaCPP 1.4.1.SNAPSHOT
Visual Studio 2017 Community
Oracle Java 1.8.0_162
The text was updated successfully, but these errors were encountered: