gstreamer-java / gst1-java-core

Java bindings for GStreamer 1.x
GNU Lesser General Public License v3.0
188 stars 72 forks source link

Windows MSVC Build library names #229

Closed freelancer1845 closed 3 years ago

freelancer1845 commented 3 years ago

Hey, thx for creating/maintaining this!

the library names in the MSVC build follow yet another convention...

gstreamer-1.0-0.dll gobject-2.0-0.dll

Note the "-0"

At least this is what happens on my system if I install "MSVC 64-bit (VS 2019, Release CRT)r"

Windows 10.0.19042 Build 19042.

Workaround to fix this is to use JVM argument "-Dgstreamer.GNative.nameFormats=%s-0"

Current Windows formats are defined here: https://github.com/gstreamer-java/gst1-java-core/blob/712a2fee423a406742477900c1958d4ded81fad0/src/org/freedesktop/gstreamer/lowlevel/GNative.java#L40-L48

A simple fix would be to add "%s-0" although maybe there could be another mechanism to resolve this issue in a more general way?

neilcsmith-net commented 3 years ago

Thanks for the report, and thanks for the thanks. :smile:

I'm not sure there is a better way to handle this. I added the system properties so at least there are workarounds. Feel free to open a PR for this, possibly added in second - "%s|%s-0|lib%s|lib%s-0"? Depends what are more likely matches. Are you sure with your workaround that everything matches in the MSVC build?

freelancer1845 commented 3 years ago

No there are definitely some errors, as I'm getting "Invalid Memory Access" if I'm adding a Error Listener to the bus.

Also some tests fail. I will try to look into that :)

One of the problems seems to be this:

...
Error looking up function 'g_getenv': The specified procedure could not be found.
...
Error looking up function 'g_setenv': The specified procedure could not be found.
...
neilcsmith-net commented 3 years ago

Is that with the setting you originally shared, or with the one in my previous message? What's the name of the GLib library file here? Also, note there are two settings - there is also the one at https://github.com/gstreamer-java/gst1-java-core/blob/master/src/org/freedesktop/gstreamer/lowlevel/GstNative.java#L36 which is just for GStreamer libs.

freelancer1845 commented 3 years ago

I used "gstreamer.GNative.nameFormats". But if I look at the glib-2.0-0.dll with dependency-walker I can't find these functions... I will build gstreamer and report back