Skip to content

Commit 5c95657

Browse files
author
Clement Champetier
committed
Java binding: add avExport.i
Contains swig specificities to make AvTranscoder's Java binding available to other swig java binding.
1 parent 67b1937 commit 5c95657

File tree

2 files changed

+27
-24
lines changed

2 files changed

+27
-24
lines changed

src/AvTranscoder/avExport.i

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Need to modify the visibility of the constructor and getCPtr method
2+
// if you are invoking SWIG more than once and generating the wrapped classes
3+
// into different packages in each invocation.
4+
%typemap(javabody) SWIGTYPE %{
5+
protected long swigCPtr;
6+
protected boolean swigCMemOwn;
7+
8+
public $javaclassname(long cPtr, boolean cMemoryOwn) {
9+
swigCMemOwn = cMemoryOwn;
10+
swigCPtr = cPtr;
11+
}
12+
13+
public static long getCPtr($javaclassname obj) {
14+
return (obj == null) ? 0 : obj.swigCPtr;
15+
}
16+
%}
17+
18+
%typemap(javabody_derived) SWIGTYPE %{
19+
public $javaclassname(long cPtr, boolean cMemoryOwn) {
20+
super( cPtr, cMemoryOwn );
21+
}
22+
23+
public static long getCPtr($javaclassname obj) {
24+
return (obj == null) ? 0 : obj.swigCPtr;
25+
}
26+
%}

src/AvTranscoder/avTranscoder.i

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,7 @@
77

88

99
%include "AvTranscoder/avException.i"
10-
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-
%}
10+
%include "AvTranscoder/avExport.i"
3411

3512
%{
3613
#include <AvTranscoder/common.hpp>

0 commit comments

Comments
 (0)