Skip to content

Commit 05738c3

Browse files
author
Clement Champetier
committed
Java binding: make it available to other swig java binding
* If more than one module is used and SWIG proxy classes need constructing/using across modules, there is no other option than expose the getCPtr() of AvTranscoder java binding to public. * See this link: http://sourceforge.net/p/swig/mailman/swig- devel/thread/4ED006FD.6020403@fultondesigns.co.uk/
1 parent 237d703 commit 05738c3

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

src/AvTranscoder/avTranscoder.i

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,30 @@
88

99
%include "AvTranscoder/avException.i"
1010

11+
// Need to modify the visibility of the constructor and getCPtr method
12+
// if you are invoking SWIG more than once and generating the wrapped classes
13+
// into different packages in each invocation.
14+
%typemap(javabody) SWIGTYPE %{
15+
protected long swigCPtr;
16+
protected boolean swigCMemOwn;
17+
18+
public $javaclassname(long cPtr, boolean cMemoryOwn) {
19+
swigCMemOwn = cMemoryOwn;
20+
swigCPtr = cPtr;
21+
}
22+
public static long getCPtr($javaclassname obj) {
23+
return (obj == null) ? 0 : obj.swigCPtr;
24+
}
25+
%}
26+
%typemap(javabody_derived) SWIGTYPE %{
27+
public $javaclassname(long cPtr, boolean cMemoryOwn) {
28+
super( cPtr, cMemoryOwn );
29+
}
30+
public static long getCPtr($javaclassname obj) {
31+
return (obj == null) ? 0 : obj.swigCPtr;
32+
}
33+
%}
34+
1135
%{
1236
#include <AvTranscoder/common.hpp>
1337

0 commit comments

Comments
 (0)