File tree Expand file tree Collapse file tree 10 files changed +21
-11
lines changed Expand file tree Collapse file tree 10 files changed +21
-11
lines changed Original file line number Diff line number Diff line change 13
13
%include " AvTranscoder/swig/avMediaType.i"
14
14
%include " AvTranscoder/swig/avRational.i"
15
15
%include " AvTranscoder/swig/avLogLevel.i"
16
+ %include " AvTranscoder/swig/avOperator.i"
16
17
17
18
%{
18
19
#include < AvTranscoder/Library.hpp>
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ ICodec::~ICodec()
51
51
_avCodecContext = NULL ;
52
52
}
53
53
54
- void ICodec::open ()
54
+ void ICodec::openCodec ()
55
55
{
56
56
if ( ! _avCodecContext )
57
57
throw std::runtime_error ( " unable to open a codec with no codec context" );
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ class AvExport ICodec
36
36
virtual ~ICodec () = 0 ;
37
37
38
38
// / Initialize the codec context.
39
- void open ();
39
+ void openCodec ();
40
40
41
41
std::string getCodecName () const ;
42
42
AVCodecID getCodecId () const ;
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ AudioDecoder::~AudioDecoder()
52
52
53
53
void AudioDecoder::setup ()
54
54
{
55
- _inputStream->getAudioCodec ().open ();
55
+ _inputStream->getAudioCodec ().openCodec ();
56
56
}
57
57
58
58
bool AudioDecoder::decodeNextFrame ( Frame& frameBuffer )
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ VideoDecoder::~VideoDecoder()
50
50
51
51
void VideoDecoder::setup ()
52
52
{
53
- _inputStream->getVideoCodec ().open ();
53
+ _inputStream->getVideoCodec ().openCodec ();
54
54
}
55
55
56
56
bool VideoDecoder::decodeNextFrame ( Frame& frameBuffer )
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ AudioEncoder::~AudioEncoder()
37
37
38
38
void AudioEncoder::setup ()
39
39
{
40
- _codec.open ();
40
+ _codec.openCodec ();
41
41
}
42
42
43
43
bool AudioEncoder::encodeFrame ( const Frame& sourceFrame, Frame& codedFrame )
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ VideoEncoder::~VideoEncoder()
38
38
39
39
void VideoEncoder::setup ()
40
40
{
41
- _codec.open ();
41
+ _codec.openCodec ();
42
42
}
43
43
44
44
Original file line number Diff line number Diff line change @@ -19,8 +19,10 @@ class AvExport Frame
19
19
// / Create a frame with a the given buffer size
20
20
Frame ( const size_t dataSize );
21
21
22
+ #ifndef SWIG
22
23
// / Create a frame from the given AVPAcket (copy data of given packet)
23
24
Frame ( const AVPacket& avPacket );
25
+ #endif
24
26
25
27
// / Override copy constructor in order to copy AVPacket data
26
28
Frame ( const Frame& other );
@@ -52,11 +54,11 @@ class AvExport Frame
52
54
// / Clear existing data and set size to 0
53
55
void clear ();
54
56
55
- AVPacket& getAVPacket () { return _packet; }
56
57
unsigned char * getData () { return _packet.data ; }
57
58
size_t getSize () const { return _packet.size ; }
58
59
59
60
#ifndef SWIG
61
+ AVPacket& getAVPacket () { return _packet; }
60
62
const AVPacket& getAVPacket () const { return _packet; }
61
63
const unsigned char * getData () const { return _packet.data ; }
62
64
#endif
Original file line number Diff line number Diff line change
1
+ #if SWIGPYTHON
2
+ %rename(__assign__) *::operator =;
3
+ #endif
4
+
5
+ #if SWIGJAVA
6
+ %rename(clone) *::operator =;
7
+ #endif
Original file line number Diff line number Diff line change @@ -76,6 +76,9 @@ if(SWIG_FOUND)
76
76
set (AVTRANSCODER_BINDING_FILE "AvTranscoder/avTranscoder.i" )
77
77
set_source_files_properties (${AVTRANSCODER_BINDING_FILE} PROPERTIES CPLUSPLUS ON )
78
78
79
+ # Swig flags
80
+ set (CMAKE_SWIG_FLAGS -c++ -fcompact -small -O -Werror )
81
+
79
82
### PYTHON BINDING
80
83
if (AVTRANSCODER_DISABLE_PYTHON_BINDING )
81
84
message ("PYTHON binding disabled, will not build python binding." )
@@ -84,9 +87,6 @@ if(SWIG_FOUND)
84
87
if (PYTHONLIBS_FOUND )
85
88
include_directories (${PYTHON_INCLUDE_PATH} )
86
89
87
- # Swig flags
88
- set (CMAKE_SWIG_FLAGS -c++ -fcompact )
89
-
90
90
# Create '_avtranscoder' shared lib (python)
91
91
swig_add_module (avtranscoder-py python ${AVTRANSCODER_BINDING_FILE} )
92
92
# For Python binding, need to compile the wrapper into a lib called "_<module_name>.so"
@@ -131,7 +131,7 @@ if(SWIG_FOUND)
131
131
include_directories (${JNI_INCLUDE_DIRS} )
132
132
133
133
# Swig flags
134
- set (CMAKE_SWIG_FLAGS -c++ -fcompact -package org.avtranscoder )
134
+ set (CMAKE_SWIG_FLAGS ${CMAKE_SWIG_FLAGS} -package org.avtranscoder )
135
135
136
136
# Create 'avtranscoder-java' shared lib
137
137
swig_add_module (avtranscoder-java java ${AVTRANSCODER_BINDING_FILE} )
You can’t perform that action at this time.
0 commit comments