gstreamer-java / gst1-java-core

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

Implement Setting Enum-Properties with their Nick-Strings #187

Closed MaZderMind closed 4 years ago

MaZderMind commented 4 years ago

fixes #182

MaZderMind commented 4 years ago

It would be interesting to also retrieve the Enum-Values as String, but I don't have a good Idea how to nicely to the public API.

neilcsmith-net commented 4 years ago

Thanks, but I'm not sure this is the right approach. We need something more generic here, I think, probably built around https://gstreamer.freedesktop.org/documentation/gstreamer/gstvalue.html?gi-language=c#gst_value_deserialize I started a wider refactor of GValue support, but maybe something short term we can get in - maybe setAsString / getAsString.

MaZderMind commented 4 years ago

Would you mind explaining what 'more generic here' means to you? More generic way to set any Property from any Input, by removing the existing switch/case within set and replacing it with something around gst_value_deserialize?

neilcsmith-net commented 4 years ago

That any property type should be settable by using a String as the Java value, and that ideally you should be able to get the String back again somehow. I'm not talking specifically about removing the if/else (not switch) chain particularly by that, although that is also on my agenda as it's replicated (badly) in different places.

MaZderMind commented 4 years ago

190 certainly looks like the better implementation. Closing this one.