Skip to content

Commit

Permalink
Merge pull request #985 from OpenShot/java-package
Browse files Browse the repository at this point in the history
Java Swig Support (org.openshot package + wrap shared pointers)
  • Loading branch information
jonoomph authored Dec 31, 2024
2 parents 6d8db5c + 5cb74f4 commit dd2a70c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions bindings/java/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ message(STATUS "JNI_LIBRARIES=${JNI_LIBRARIES}")
set_property(SOURCE openshot.i PROPERTY CPLUSPLUS ON)
set_property(SOURCE openshot.i PROPERTY SWIG_MODULE_NAME openshot)

### Set the swig package name for the JAR
set_source_files_properties(openshot.i PROPERTIES
SWIG_FLAGS "-package;org.openshot"
)

### Suppress a ton of warnings in the generated SWIG C++ code
set(SWIG_CXX_FLAGS "-Wno-unused-variable -Wno-unused-function \
-Wno-deprecated-copy -Wno-class-memaccess -Wno-cast-function-type \
Expand Down
8 changes: 4 additions & 4 deletions bindings/java/openshot.i
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@
%include <std_except.i>

/* Include shared pointer code */
#%include <std_shared_ptr.i>
%include <std_shared_ptr.i>

/* Mark these classes as shared_ptr classes */
#ifdef USE_IMAGEMAGICK
#%shared_ptr(Magick::Image)
%shared_ptr(Magick::Image)
#endif
#%shared_ptr(juce::AudioBuffer<float>)
#%shared_ptr(openshot::Frame)
%shared_ptr(juce::AudioBuffer<float>)
%shared_ptr(openshot::Frame)

/* Instantiate the required template specializations */
%template() std::map<std::string, int>;
Expand Down

0 comments on commit dd2a70c

Please sign in to comment.