File tree Expand file tree Collapse file tree 17 files changed +59
-32
lines changed Expand file tree Collapse file tree 17 files changed +59
-32
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ env = Environment().Clone()
6
6
7
7
Import ( 'env' )
8
8
9
- env .Program (
9
+ avmeta = env .Program (
10
10
'avmeta' ,
11
11
Glob ( 'avMeta/*.cpp' ),
12
12
LIBS = [
@@ -29,3 +29,5 @@ env.Program(
29
29
'swscale' ,
30
30
]
31
31
)
32
+
33
+ env .Depends ( avmeta , sAvTranscoder )
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ class SwsContext;
12
12
namespace avtranscoder
13
13
{
14
14
15
- class ColorTransform
15
+ AvExport class ColorTransform
16
16
{
17
17
public:
18
18
ColorTransform ();
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ extern "C" {
18
18
namespace avtranscoder
19
19
{
20
20
21
- class AudioDesc
21
+ class AvExport AudioDesc
22
22
{
23
23
public:
24
24
AudioDesc ( const std::string& codecName = " " );
Original file line number Diff line number Diff line change @@ -34,17 +34,17 @@ typedef std::vector< unsigned char > DataBuffer;
34
34
// //EColorRange eColorRange;
35
35
// };
36
36
37
- class ImageDesc
37
+ class AvExport ImageDesc
38
38
{
39
39
public:
40
40
ImageDesc ()
41
41
{};
42
42
43
43
void setWidth ( const size_t width ) { m_width = width; }
44
44
void setHeight ( const size_t height ) { m_height = height; }
45
- void setPixel ( const Pixel& pixel ) { m_pixel = pixel; }
45
+ void setPixel ( const Pixel pixel ) { m_pixel = pixel; }
46
46
void setDar ( const size_t num, const size_t den ) { m_displayAspectRatio.num = num; m_displayAspectRatio.den = den; }
47
- void setDar ( const Ratio ratio ) { m_displayAspectRatio = ratio; }
47
+ void setDar ( const Ratio ratio ) { m_displayAspectRatio = ratio; }
48
48
49
49
size_t getWidth () const { return m_width; }
50
50
size_t getHeight () const { return m_height; }
@@ -78,7 +78,7 @@ class ImageDesc
78
78
bool m_topFieldFirst;
79
79
};
80
80
81
- class Image
81
+ class AvExport Image
82
82
{
83
83
public:
84
84
Image ( const ImageDesc& ref )
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ extern "C" {
18
18
namespace avtranscoder
19
19
{
20
20
21
- class VideoDesc
21
+ class AvExport VideoDesc
22
22
{
23
23
public:
24
24
VideoDesc ( const std::string& codecName = " " );
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ InputFile& InputFile::analyse()
62
62
m_properties.formatLongName = m_formatContext->iformat ->long_name ;
63
63
m_properties.streamsCount = m_formatContext->nb_streams ;
64
64
m_properties.programsCount = m_formatContext->nb_programs ;
65
- m_properties.startTime = 1.0 * (uint )m_formatContext->start_time / AV_TIME_BASE;
65
+ m_properties.startTime = 1.0 * (unsigned int )m_formatContext->start_time / AV_TIME_BASE;
66
66
m_properties.duration = 1.0 * m_formatContext->duration / AV_TIME_BASE;
67
67
m_properties.bitRate = m_formatContext->bit_rate ;
68
68
m_properties.packetSize = m_formatContext->packet_size ;
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ class AVCodecContext;
20
20
namespace avtranscoder
21
21
{
22
22
23
- class InputFile
23
+ class AvExport InputFile
24
24
{
25
25
public:
26
26
InputFile ( const std::string& filename );
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ extern "C" {
18
18
namespace avtranscoder
19
19
{
20
20
21
- class InputStream
21
+ class AvExport InputStream
22
22
{
23
23
public:
24
24
InputStream ( const std::string& filename, const size_t streamIndex );
Original file line number Diff line number Diff line change 7
7
namespace avtranscoder
8
8
{
9
9
10
- class InputStreamAudio
10
+ class AvExport InputStreamAudio
11
11
{
12
12
public:
13
13
InputStreamAudio ( const InputStream& inputStream );
Original file line number Diff line number Diff line change 6
6
namespace avtranscoder
7
7
{
8
8
9
- class InputStreamData
9
+ class AvExport InputStreamData
10
10
{
11
11
public:
12
12
InputStreamData (){};
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ class AVFrame;
14
14
namespace avtranscoder
15
15
{
16
16
17
- class InputStreamVideo
17
+ class AvExport InputStreamVideo
18
18
{
19
19
public:
20
20
InputStreamVideo ( const InputStream& inputStream );
Original file line number Diff line number Diff line change @@ -11,6 +11,11 @@ extern "C" {
11
11
#include < libavutil/pixdesc.h>
12
12
}
13
13
#include < iostream>
14
+ #ifdef _MSC_VER
15
+ #include < float.h>
16
+ #define isnan _isnan
17
+ #define isinf (x ) (!_finite(x))
18
+ #endif
14
19
15
20
namespace avtranscoder
16
21
{
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ class AVCodecContext;
17
17
namespace avtranscoder
18
18
{
19
19
20
- class OutputFile
20
+ class AvExport OutputFile
21
21
{
22
22
public:
23
23
OutputFile ( const std::string& file = " " );
@@ -26,9 +26,6 @@ class OutputFile
26
26
27
27
void addVideoStream ( const VideoDesc& videoDesc );
28
28
29
-
30
- void addVideoStream ( const std::string& codecName );
31
-
32
29
bool addAudioStream ( );
33
30
34
31
bool wrap ( const DataStream& data, const size_t streamId );
Original file line number Diff line number Diff line change @@ -23,14 +23,14 @@ class AVCodecContext;
23
23
namespace avtranscoder
24
24
{
25
25
26
- class OutputStreamVideo : public OutputStream
26
+ class AvExport OutputStreamVideo : public OutputStream
27
27
{
28
28
public:
29
29
OutputStreamVideo ();
30
30
31
31
bool setup ();
32
32
33
- void setVideoDesc ( const VideoDesc& videoDesc );
33
+ // void setVideoDesc( const VideoDesc& videoDesc );
34
34
35
35
/* *
36
36
* @param[out] codecFrame blabla
Original file line number Diff line number Diff line change 10
10
11
11
#include < AvTranscoder/DatasStructures/Pixel.hpp>
12
12
#include < AvTranscoder/DatasStructures/Image.hpp>
13
+ #include < AvTranscoder/DatasStructures/AudioFrame.hpp>
13
14
#include < AvTranscoder/DatasStructures/VideoDesc.hpp>
14
15
#include < AvTranscoder/DatasStructures/AudioDesc.hpp>
15
16
#include < AvTranscoder/DatasStructures/DataStreamDesc.hpp>
@@ -40,6 +41,7 @@ namespace std {
40
41
41
42
%include <AvTranscoder/DatasStructures/Pixel.hpp>
42
43
%include <AvTranscoder/DatasStructures/Image.hpp>
44
+ %include <AvTranscoder/DatasStructures/AudioFrame.hpp>
43
45
%include <AvTranscoder/DatasStructures/VideoDesc.hpp>
44
46
%include <AvTranscoder/DatasStructures/AudioDesc.hpp>
45
47
%include <AvTranscoder/DatasStructures/DataStreamDesc.hpp>
Original file line number Diff line number Diff line change 3
3
4
4
#include < string>
5
5
6
+ #ifdef SWIG
7
+ #define AvExport
8
+ #else
9
+ #if ( defined( WIN32 ) || defined( WIN64 ) || defined( _WIN32 ) || defined( _WIN64 ) || defined( __WINDOWS__ ) || defined( __TOS_WIN__ ) || defined( __WIN32__ ) )
10
+ #define AvExport __declspec ( dllexport )
11
+ #elif defined( __GNUC__ ) // Add compiler definition here...
12
+ #if __GNUC__ - 0 > 3 || ( __GNUC__ - 0 == 3 && __GNUC_MINOR__ - 0 > 2 )
13
+ #define AvExport __attribute__ ( ( visibility( " default" ) ) )
14
+ #else
15
+ #define AvExport
16
+ #warning "AvExport not set because of a too old gcc version. The plug-in may not compile with the option -fvisible=hidden."
17
+ #endif
18
+ #else
19
+ #error "AvExport not defined for this compiler..."
20
+ #endif
21
+ #endif
22
+
6
23
namespace avtranscoder
7
24
{
8
25
Original file line number Diff line number Diff line change @@ -6,36 +6,40 @@ Import( "envJava" )
6
6
Import ( "envPy" )
7
7
8
8
sAvTranscoder = env .StaticLibrary (
9
- 'AvTranscoder ' ,
9
+ 'sAvTranscoder ' ,
10
10
Glob ( 'AvTranscoder/*.cpp' ) + Glob ( 'AvTranscoder/DatasStructures/*.cpp' ) ,
11
11
LIBS = [
12
12
'libavutil' ,
13
13
'libavcodec' ,
14
14
'libavformat' ,
15
15
'libswscale' ,
16
- 'pthread' ,
16
+ # 'pthread',
17
17
]
18
18
)
19
19
20
- AvTranscoder = env .SharedLibrary (
20
+ SharedAvTranscoder = env .SharedLibrary (
21
21
'AvTranscoder' ,
22
22
Glob ( 'AvTranscoder/*.cpp' ) + Glob ( 'AvTranscoder/DatasStructures/*.cpp' ) ,
23
23
LIBS = [
24
24
'libavutil' ,
25
25
'libavcodec' ,
26
26
'libavformat' ,
27
27
'libswscale' ,
28
- 'pthread' ,
28
+ # 'pthread',
29
29
]
30
30
)
31
31
32
- # jAvTranscoder = envJava.SharedLibrary(
33
- # 'jAvTranscoder',
34
- # source=['AvTranscoder/avTranscoder.i'],
35
- # LIBS=[
36
- # sAvTranscoder
37
- # ],
38
- # )
32
+ jAvTranscoder = envJava .SharedLibrary (
33
+ 'jAvTranscoder' ,
34
+ source = ['AvTranscoder/avTranscoder.i' ],
35
+ LIBS = [
36
+ sAvTranscoder ,
37
+ 'libavutil' ,
38
+ 'libavcodec' ,
39
+ 'libavformat' ,
40
+ 'libswscale' ,
41
+ ],
42
+ )
39
43
40
44
# pyAvTranscoder = envPy.SharedLibrary(
41
45
# 'pyAvTranscoder',
@@ -59,5 +63,5 @@ AvTranscoder = env.SharedLibrary(
59
63
# env.Depends( avTranscoder_jar, avTranscoder_class )
60
64
61
65
Export ( { 'sAvTranscoder' : sAvTranscoder } )
62
- Export ( { 'AvTranscoder' : AvTranscoder } )
66
+ Export ( { 'AvTranscoder' : ' AvTranscoder' } )
63
67
# Export( { 'AvTranscoder_jar': avTranscoder_class } )
You can’t perform that action at this time.
0 commit comments