Skip to content
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

CVPixelBuffer not supported #8

Open
cyberhenoch opened this issue Jun 15, 2023 · 0 comments
Open

CVPixelBuffer not supported #8

cyberhenoch opened this issue Jun 15, 2023 · 0 comments

Comments

@cyberhenoch
Copy link

cyberhenoch commented Jun 15, 2023

Hi there! Firstly thanks for sharing this concept. It may be very useful and much more convenient than exporting framework from xcode. 👍

I have an issue though with passing CVPixelBuffer parameter to function. A minimal example:

import Foundation
import CoreVideo
import CoreImage

@objc(HelloWorld)
public class HelloWorld : NSObject {
    @objc(helloWorldWithPixelBuffer:)
    public class func helloWorld(pixelBuffer: CVPixelBuffer) -> String {
        return "HeLLo WorLd!"
    }
}

During sync with gradle I get:

Task :shared:cinteropSwiftIosArm64
Warning: Failed to generate cinterop for :shared:cinteropSwiftIosArm64: Process 'command '/Applications/Android Studio Preview 3.app/Contents/jbr/Contents/Home/bin/java'' finished with non-zero exit value 1
org.gradle.process.internal.ExecException: Process 'command '/Applications/Android Studio Preview 3.app/Contents/jbr/Contents/Home/bin/java'' finished with non-zero exit value 1
	at org.gradle.process.internal.DefaultExecHandle$ExecResultImpl.assertNormalExitValue(DefaultExecHandle.java:415)
	at org.gradle.process.internal.DefaultJavaExecAction.execute(DefaultJavaExecAction.java:52)
	at org.gradle.process.internal.DefaultExecActionFactory.javaexec(DefaultExecActionFactory.java:195)
	at org.gradle.process.internal.DefaultExecOperations.javaexec(DefaultExecOperations.java:42)
...

Exception in thread "main" java.lang.Error: /Users/......./shared/build/swiftklib/swift/iosArm64/swiftBuild/.build/arm64-apple-macosx/release/swift.build/swift-Swift.h:287:51: error: expected a type
	at org.jetbrains.kotlin.native.interop.indexer.UtilsKt.ensureNoCompileErrors(Utils.kt:275)
	at org.jetbrains.kotlin.native.interop.indexer.IndexerKt.indexDeclarations(Indexer.kt:1244)
	at org.jetbrains.kotlin.native.interop.indexer.IndexerKt.buildNativeIndexImpl(Indexer.kt:1227)
	at org.jetbrains.kotlin.native.interop.indexer.IndexerKt.buildNativeIndexImpl(Indexer.kt:1223)
	at org.jetbrains.kotlin.native.interop.gen.jvm.DefaultPlugin.buildNativeIndex(Plugins.kt:33)
	at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLib(main.kt:321)
	at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLibSafe(main.kt:242)
	at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.access$processCLibSafe(main.kt:1)
	at org.jetbrains.kotlin.native.interop.gen.jvm.Interop.interop(main.kt:100)
	at org.jetbrains.kotlin.cli.utilities.InteropCompilerKt.invokeInterop(InteropCompiler.kt:45)
	at org.jetbrains.kotlin.cli.utilities.MainKt.mainImpl(main.kt:23)
	at org.jetbrains.kotlin.cli.utilities.MainKt.main(main.kt:45)

generated header is:

SWIFT_CLASS_NAMED("HelloWorld")
@interface HelloWorld : NSObject
+ (NSString * _Nonnull)helloWorldWithPixelBuffer:(**[ERROR POINTS HERE]**CVPixelBufferRef _Nonnull)pixelBuffer SWIFT_WARN_UNUSED_RESULT;
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end

When I change CVPixelBuffer to String it works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant