Open MatrixTurtle269 opened 5 months ago
Guten Tag, Hans here.
[!NOTE] New features, bugfixes, updates and other improvements are all handled mostly by
@mrousavy
in his free time. To support@mrousavy
, please consider 💖 sponsoring him on GitHub 💖. Sponsored issues will be prioritized.
That's because the FrameHostObject
is not exposed, it's a private API. Why would you need that?
@mrousavy Well, I can't build my frame processor plugin because of this. I have to write it in Objective-C++ (.mm) because of a dependency. Is there a way to make this work?
Ahh, now I get it. I thought you were including FrameHostObject.h
yourself.
Okay I see the issue. I'll think about this a bit, but this is not easy to fix. I assume __cplusplus only for internal usage.
As a workaround, you can just build an Objective-C Frame Processor plugin, which then later calls into Objective-C++ inside it's callback body.
Ahh, now I get it. I thought you were including
FrameHostObject.h
yourself.
Yeah, sorry for the confusing description.
I'll just build the plugin in Swift and write necessary methods in Obj-C++ for now.
In the future everything will be Swift. It's the direction I want to move towards with VisionCamera.
With Swift 5.9/6 you can call a lot of C++ methods directly anyways, no need for Objective-C(++) here. Also, Swift method calls are faster than Objective-C method calls ("message sends").
The only reason I need to use Objective-C++ at all is because I need the OpenCV framework, which only seems to work with Objective-C++ as of now.
I'm glad you're planning to prioritize Swift in the future, it's been a nightmare trying to learn Objective-C syntax tbh
I think OpenCV can be used from Swift. Either directly, or with some simple C++ bridging code. Either way, this should be a tiny bit faster than Objective-C.
How were you trying to build the app?
I tried to build my Frame Processor Plugin (written in Objective-C++), but it failed with
'FrameHostObject.h' file not found
. The issue seems to appear inVisionCamera/FrameProcessors/FrameProcessor.h
:This is weird, since the Xcode editor seems to recognize
FrameHostObject.h
just fine.Reopening #1682 since it was marked as stale.
Full build logs
Project dependencies
VisionCamera Version
4.4.1
Target platforms
iOS
Operating system
MacOS
Can you build the VisionCamera Example app?
Yes, I can successfully build the Example app here
Additional information