Skip to content

Commit 8f717c5

Browse files
Merge branch 'cleanLinuxBuild'
Conflicts: src/AvTranscoder/InputStream.cpp src/AvTranscoder/OutputStreamVideo.hpp
2 parents 8ff3f2d + 058af45 commit 8f717c5

16 files changed

+55
-38
lines changed

app/SConscript

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ env = Environment().Clone()
66

77
Import( 'env' )
88

9-
env.Program(
9+
avmeta = env.Program(
1010
'avmeta',
1111
Glob( 'avMeta/*.cpp' ),
1212
LIBS = [
@@ -29,3 +29,5 @@ env.Program(
2929
'swscale',
3030
]
3131
)
32+
33+
env.Depends( avmeta, sAvTranscoder )

src/AvTranscoder/ColorTransform.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class SwsContext;
1212
namespace avtranscoder
1313
{
1414

15-
class ColorTransform
15+
class AvExport ColorTransform
1616
{
1717
public:
1818
ColorTransform();

src/AvTranscoder/DatasStructures/AudioDesc.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ extern "C" {
1818
namespace avtranscoder
1919
{
2020

21-
class AudioDesc
21+
class AvExport AudioDesc
2222
{
2323
public:
2424
AudioDesc( const std::string& codecName = "" );

src/AvTranscoder/DatasStructures/Image.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,17 @@ typedef std::vector< unsigned char > DataBuffer;
3434
// //EColorRange eColorRange;
3535
// };
3636

37-
class ImageDesc
37+
class AvExport ImageDesc
3838
{
3939
public:
4040
ImageDesc()
4141
{};
4242

4343
void setWidth ( const size_t width ) { m_width = width; }
4444
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; }
4646
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; }
4848

4949
size_t getWidth () const { return m_width; }
5050
size_t getHeight() const { return m_height; }
@@ -78,7 +78,7 @@ class ImageDesc
7878
bool m_topFieldFirst;
7979
};
8080

81-
class Image
81+
class AvExport Image
8282
{
8383
public:
8484
Image( const ImageDesc& ref )

src/AvTranscoder/DatasStructures/VideoDesc.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ extern "C" {
1818
namespace avtranscoder
1919
{
2020

21-
class VideoDesc
21+
class AvExport VideoDesc
2222
{
2323
public:
2424
VideoDesc( const std::string& codecName = "" );

src/AvTranscoder/InputFile.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ InputFile& InputFile::analyse()
6767
m_properties.formatLongName = m_formatContext->iformat->long_name;
6868
m_properties.streamsCount = m_formatContext->nb_streams;
6969
m_properties.programsCount = m_formatContext->nb_programs;
70-
m_properties.startTime = 1.0 * (uint)m_formatContext->start_time / AV_TIME_BASE;
70+
m_properties.startTime = 1.0 * (unsigned int)m_formatContext->start_time / AV_TIME_BASE;
7171
m_properties.duration = 1.0 * m_formatContext->duration / AV_TIME_BASE;
7272
m_properties.bitRate = m_formatContext->bit_rate;
7373
m_properties.packetSize = m_formatContext->packet_size;

src/AvTranscoder/InputFile.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class AVCodecContext;
2020
namespace avtranscoder
2121
{
2222

23-
class InputFile
23+
class AvExport InputFile
2424
{
2525
public:
2626
InputFile( const std::string& filename );

src/AvTranscoder/InputStream.hpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ extern "C" {
1818
namespace avtranscoder
1919
{
2020

21-
class InputStream
21+
class AvExport InputStream
2222
{
2323
public:
2424
InputStream( const std::string& filename, const size_t streamIndex );
@@ -31,13 +31,6 @@ class InputStream
3131
init( inputStream.m_formatContext->filename );
3232
}
3333

34-
InputStream( InputStream& inputStream )
35-
: m_formatContext( NULL )
36-
, m_streamIndex( inputStream.m_streamIndex )
37-
{
38-
init( inputStream.m_formatContext->filename );
39-
}
40-
4134
size_t getStreamIndex() const { return m_streamIndex; }
4235

4336
bool readNextPacket( DataStream& data ) const;

src/AvTranscoder/InputStreamAudio.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
namespace avtranscoder
88
{
99

10-
class InputStreamAudio
10+
class AvExport InputStreamAudio
1111
{
1212
public:
1313
InputStreamAudio( const InputStream& inputStream );

src/AvTranscoder/InputStreamData.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
namespace avtranscoder
77
{
88

9-
class InputStreamData
9+
class AvExport InputStreamData
1010
{
1111
public:
1212
InputStreamData(){};

src/AvTranscoder/InputStreamVideo.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class AVFrame;
1414
namespace avtranscoder
1515
{
1616

17-
class InputStreamVideo
17+
class AvExport InputStreamVideo
1818
{
1919
public:
2020
InputStreamVideo( const InputStream& inputStream );

src/AvTranscoder/OutputFile.hpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class AVCodecContext;
1717
namespace avtranscoder
1818
{
1919

20-
class OutputFile
20+
class AvExport OutputFile
2121
{
2222
public:
2323
OutputFile( const std::string& file = "" );
@@ -26,9 +26,6 @@ class OutputFile
2626

2727
void addVideoStream( const VideoDesc& videoDesc );
2828

29-
30-
void addVideoStream( const std::string& codecName );
31-
3229
bool addAudioStream( );
3330

3431
bool wrap( const DataStream& data, const size_t streamId );

src/AvTranscoder/OutputStreamVideo.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,15 @@ class AVCodecContext;
2323
namespace avtranscoder
2424
{
2525

26-
class OutputStreamVideo : public OutputStream
26+
class AvExport OutputStreamVideo : public OutputStream
2727
{
2828
public:
2929
OutputStreamVideo();
3030

3131
bool setup();
3232

33+
//void setVideoDesc( const VideoDesc& videoDesc );
34+
3335
/**
3436
* @param[out] codecFrame blabla
3537
*/

src/AvTranscoder/avTranscoder.i

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#include <AvTranscoder/DatasStructures/Pixel.hpp>
1212
#include <AvTranscoder/DatasStructures/Image.hpp>
13+
#include <AvTranscoder/DatasStructures/AudioFrame.hpp>
1314
#include <AvTranscoder/DatasStructures/VideoDesc.hpp>
1415
#include <AvTranscoder/DatasStructures/AudioDesc.hpp>
1516
#include <AvTranscoder/DatasStructures/DataStreamDesc.hpp>
@@ -40,6 +41,7 @@ namespace std {
4041

4142
%include <AvTranscoder/DatasStructures/Pixel.hpp>
4243
%include <AvTranscoder/DatasStructures/Image.hpp>
44+
%include <AvTranscoder/DatasStructures/AudioFrame.hpp>
4345
%include <AvTranscoder/DatasStructures/VideoDesc.hpp>
4446
%include <AvTranscoder/DatasStructures/AudioDesc.hpp>
4547
%include <AvTranscoder/DatasStructures/DataStreamDesc.hpp>

src/AvTranscoder/common.hpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,23 @@
33

44
#include <string>
55

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+
623
namespace avtranscoder
724
{
825

src/SConscript

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,36 +6,40 @@ Import( "envJava" )
66
Import( "envPy" )
77

88
sAvTranscoder = env.StaticLibrary(
9-
'AvTranscoder',
9+
'sAvTranscoder',
1010
Glob( 'AvTranscoder/*.cpp' ) + Glob( 'AvTranscoder/DatasStructures/*.cpp' ) ,
1111
LIBS = [
1212
'libavutil',
1313
'libavcodec',
1414
'libavformat',
1515
'libswscale',
16-
'pthread',
16+
#'pthread',
1717
]
1818
)
1919

20-
AvTranscoder = env.SharedLibrary(
20+
SharedAvTranscoder = env.SharedLibrary(
2121
'AvTranscoder',
2222
Glob( 'AvTranscoder/*.cpp' ) + Glob( 'AvTranscoder/DatasStructures/*.cpp' ) ,
2323
LIBS = [
2424
'libavutil',
2525
'libavcodec',
2626
'libavformat',
2727
'libswscale',
28-
'pthread',
28+
#'pthread',
2929
]
3030
)
3131

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+
)
3943

4044
# pyAvTranscoder = envPy.SharedLibrary(
4145
# 'pyAvTranscoder',
@@ -59,5 +63,5 @@ AvTranscoder = env.SharedLibrary(
5963
# env.Depends( avTranscoder_jar, avTranscoder_class )
6064

6165
Export( { 'sAvTranscoder' : sAvTranscoder } )
62-
Export( { 'AvTranscoder' : AvTranscoder } )
66+
Export( { 'AvTranscoder' : 'AvTranscoder' } )
6367
# Export( { 'AvTranscoder_jar': avTranscoder_class } )

0 commit comments

Comments
 (0)