https://kotlinlang.org logo
Title
s

Shabinder Singh

02/21/2021, 8:41 PM
Hello Guys , I am building a desktop app , and I want to ship FFmpeg libs within app , as there are different different libs for Mac,Windows,etc , how would you suggest I accomplish this?
j

jim

02/21/2021, 8:59 PM
KotlinNative allows you to write a platform-independent wrapper in Kotlin (expects), which will bind to platform-specific implementations (actuals) when you build for a particular platform.
s

Shabinder Singh

02/21/2021, 9:09 PM
@jim as I am now developing the desktop application with JVM target , I am using a java wrapper for FFmpeg for these platforms where I do need to provide A Path to FFmpeg libs So, Things I want to do , get ffmpeg binaries for all three and have them in my project . declare expect Path fun , which will return string for Mac/Win/Linux FFmpeg binary.(How do Declare expect /actual for mac/win/linux etc as I am compiling for jvm in desk-compose gradle(only jvmMain and jvmTest source sets present).(sample plz). when building distributable packages , I want only platform specific Binaries to package along them(like windows only ffmpeg in .msi , and so on)
k

Kirill Grouchnikov

02/21/2021, 9:10 PM
I'd say that Skiko or Skija would be your samples, as they have bindings to underlying platform-specific libraries
👆 1
👍 1
j

jim

02/22/2021, 3:53 AM
Yeah, as @Kirill Grouchnikov mentioned, skiko binds to different builds of skia on mac/windows/linux respectively, and serves as a good example of this configuration.