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

It seems jmf library coming with j-ogg-all is not required? #1958

Closed
Ali-RS opened this issue Feb 20, 2023 · 4 comments · Fixed by #1962
Closed

It seems jmf library coming with j-ogg-all is not required? #1958

Ali-RS opened this issue Feb 20, 2023 · 4 comments · Fixed by #1962
Labels
Milestone

Comments

@Ali-RS
Copy link
Member

Ali-RS commented Feb 20, 2023

I noticed if I exclude the jmf library coming with j-ogg-all, I can still play ogg sound in JME. Looks like jmf is not required for decoding ogg files(?) if so, we may safely exclude it in jme3-jogg. (the jmf jar size is 1.8 MB!)

From a quick glance at ogg package, I could not find any class using jmf package.

@stephengold can you please confirm if jmf library is required for decoding ogg files in JME?

@Ali-RS Ali-RS added this to the Future Release milestone Feb 20, 2023
@Ali-RS Ali-RS changed the title It seems jmf libray comming with j-ogg-all is unused It seems jmf libray comming with j-ogg-all is not used? Feb 20, 2023
@Ali-RS Ali-RS changed the title It seems jmf libray comming with j-ogg-all is not used? It seems jmf libray comming with j-ogg-all is not required? Feb 20, 2023
@stephengold
Copy link
Member

stephengold commented Feb 20, 2023

if jmf library is required for decoding ogg files in JME?

I don't see an easy way to check whether JMF is required. The runtime checks you did are encouraging but they didn't cover all code paths. "jmf-2.1.1e.jar" contains 993 class files in over 100 packages with a wide variety of names, so grepping for names would be a huge undertaking.

I'm sure jme3-jogg utilizes only a fraction of j-ogg-all's capabilities. If the goal is to minimize application size, one might copy code from j-ogg-all to jme3-jogg on an as-required basis and see where the process leads. That would be intellectually satisfying, but my experience with shrinking JME apps has convinced me that the big wins are in reducing texture sizes, not deleting unused code.

@stephengold stephengold changed the title It seems jmf libray comming with j-ogg-all is not required? It seems jmf libray coming with j-ogg-all is not required? Feb 20, 2023
@stephengold stephengold changed the title It seems jmf libray coming with j-ogg-all is not required? It seems jmf library coming with j-ogg-all is not required? Feb 20, 2023
@pavly-gerges
Copy link
Contributor

pavly-gerges commented Feb 20, 2023

Jmf has a lot of functions rather than just code used by j-ogg-all, so i think the only way to reduce the size of the jmf library is by maintaining the jmf library and re-distributing it into multiple modules and so the jogg-all can selectively implement the essential code only....

@Ali-RS
Copy link
Member Author

Ali-RS commented Feb 20, 2023

If the goal is to minimize application size, one might copy code from j-ogg-all to jme3-jogg on an as-required basis and see where the process leads.

The goal is to remove unrequired libraries. It is a good idea to copy only the required classes to jme3-jogg but until someone does that, considering that j-ogg-all jar size is only 150 KB I would rather go with the simplest path and exclude the unrequired library.

   api ('com.github.stephengold:j-ogg-all:1.0.2') {
        exclude module: "jmf"
    }

@stephengold
Copy link
Member

one might copy code from j-ogg-all to jme3-jogg on an as-required basis and see where the process leads.

I performed this experiment and found that jme3-jogg needs only 3 packages from j-ogg-all in order to compile:

  • de.jarnbjo.ogg
  • de.jarnbjo.util.io and
  • de.jarnbjo.vorbis

Those 3 packages all compile without JMF. So unless there are hidden runtime dependencies (via reflection), we can safely exclude JMF as proposed above.

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