Skip to content

Conversation

@wnbittle
Copy link

As described in #36 , I'm looking to make the Devolay class more flexible so that I can control how the native libraries are loaded with the end game of getting my app to work/approved when deployed on the app store. With that in mind, there are two conceptual changes with this PR:

Allow developers to use the non-integrated Maven package
The Devolay static initializer has been changed to only extract the integrated natives (if present). Without this change the integrated maven dependency must be used. The key issue is line 32 - this will always throw unless you are using the integrated maven package because the non-integrated one doesn't have the natives. Because the static initializer throws (and you can't catch those exceptions), the Devolay class cannot be loaded, and therefore, cannot be used to do anything else (like attempting to load the natives from somewhere else).

Allow developers to load the Devolay / NDI natives from any path
The above change is a requirement for this one - you can't load the natives from somewhere else if the Devolay class never loaded. However, now that the static initializer only extracts the natives (and crucially doesn't throw), we now have the ability to allow a developer to specify the natives paths using a new loadLibraries method. In my specific use-case, to be approved by Apple to deploy on the App Store, the natives must be in a certain location in the app bundle and cannot be dynamically extracted from a jar file. To achieve this, I need to place the natives in the correct place in my app bundle and then tell Devolay to load them from that location.

While there are quite a few changes here, I've tried to ensure as much backward compatibility as possible. Developers who never called the loadLibraries() method will continue to experience the same behavior since it's called from every other Devolay class constructor. Developers who use the integrated Maven package shouldn't have to change anything, the static initializer extracts the natives as it did before and the loadLibraries() method uses the extracted paths to load the natives, again, as it did before.

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

Successfully merging this pull request may close these issues.

1 participant