Skip to content

Commit b0d131c

Browse files
major cleans for build with SCons
1 parent 2f4918c commit b0d131c

28 files changed

+161
-52
lines changed

SConstruct

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ envPy = Environment().Clone()
2121
env.Append(
2222
CPPPATH = [
2323
libavInclude,
24-
"src",
24+
"#src",
2525
],
2626
CXXFLAGS = [
2727
'-Wall',
2828
],
2929
LIBPATH = [
3030
libavLibDir,
31-
"src",
31+
"#src",
3232
],
3333
)
3434

@@ -52,7 +52,10 @@ envJava.Replace(
5252
],
5353
)
5454

55-
envJava.Append( SWIGPATH = envJava['CPPPATH'] )
55+
envJava.Append(
56+
SWIGPATH = envJava['CPPPATH'],
57+
SWIGFLAGS = [ '-package', 'org.AvTranscoder' ],
58+
)
5659

5760
# Python environment
5861
envPy.Replace(
@@ -82,5 +85,10 @@ Export( "env" )
8285
Export( "envJava" )
8386
Export( "envPy" )
8487

85-
VariantDir( 'build/lib', 'src', duplicate = 0 )
86-
SConscript( 'build/lib/SConscript' )
88+
VariantDir( 'build/src', 'src', duplicate = 0 )
89+
VariantDir( 'build/app', 'app', duplicate = 0 )
90+
91+
SConscript( [
92+
'build/src/SConscript',
93+
'build/app/SConscript',
94+
] )

app/SConscript

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Import( 'AvTranscoder' )
2+
Import( 'jAvTranscoder' )
3+
4+
env = Environment().Clone()
5+
6+
Import( 'env' )
7+
8+
env.Program(
9+
'av++',
10+
Glob( 'avTranscoder/*.cpp' ),
11+
LIBS = [
12+
AvTranscoder,
13+
'avutil',
14+
'avformat',
15+
'avcodec',
16+
]
17+
)
18+
19+
#env.Java( 'jTranscoder', 'jTranscoder', LIBS=[ jAvTranscoder ] )
20+
21+
#env.Jar(target = 'jTranscoder.jar', source = 'jTranscoder')

app/avTranscoder.cpp renamed to app/avTranscoder/avTranscoder.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#include <iostream>
22

3-
#include <Media.hpp>
4-
#include <InputStream.hpp>
5-
#include <InputStreamAudio.hpp>
6-
#include <InputStreamVideo.hpp>
7-
#include <OutputStream.hpp>
8-
#include <OutputStreamAudio.hpp>
9-
#include <OutputStreamVideo.hpp>
10-
#include <OutputFile.hpp>
3+
#include <AvTranscoder/Media.hpp>
4+
#include <AvTranscoder/InputStream.hpp>
5+
#include <AvTranscoder/InputStreamAudio.hpp>
6+
#include <AvTranscoder/InputStreamVideo.hpp>
7+
#include <AvTranscoder/OutputStream.hpp>
8+
#include <AvTranscoder/OutputStreamAudio.hpp>
9+
#include <AvTranscoder/OutputStreamVideo.hpp>
10+
#include <AvTranscoder/OutputFile.hpp>
1111

1212
int main( int argc, char** argv )
1313
{

app/jTranscoder/jTranscoder.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
import avTranscoder.Media;
3+
4+
5+
public class jTranscoder {
6+
public static void main( String[] args ){
7+
System.out.println( "hello grosse buse !");
8+
Media m = new Media( "/mnt/backup/PADdef/Livraison_20131003/001_From_OpenCube/Wrapped/OpenCube_Server_BWF/PADdef_1.2.3_3\'_Rocky_DNxHD185X.mxf" );
9+
System.out.println( "C'est fini biloute ....");
10+
}
11+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/avTranscoder/Media.hpp renamed to src/AvTranscoder/Media.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ struct VideoProperties {
6666
bool asAlpha;
6767
bool isInterlaced;
6868

69-
// () frame type / is key frame )
69+
// ( frame type / is key frame )
7070
std::vector< std::pair< char, bool > > gopStructure;
7171
std::vector<Channel> channels;
7272
};
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/AvTranscoder/avTranscoder.i

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
%module AvTranscoder
2+
3+
%include "std_string.i"
4+
%include "std_vector.i"
5+
%include "std_pair.i"
6+
%include "std_map.i"
7+
8+
%{
9+
#include <AvTranscoder/Media.hpp>
10+
11+
#include <AvTranscoder/OutputFile.hpp>
12+
13+
#include <AvTranscoder/OutputStream.hpp>
14+
#include <AvTranscoder/OutputStreamAudio.hpp>
15+
#include <AvTranscoder/OutputStreamVideo.hpp>
16+
17+
#include <AvTranscoder/InputStream.hpp>
18+
#include <AvTranscoder/InputStreamAudio.hpp>
19+
#include <AvTranscoder/InputStreamVideo.hpp>
20+
%}
21+
22+
namespace std {
23+
%template(VideoVector) vector< avtranscoder::VideoProperties >;
24+
%template(AudioVector) vector< avtranscoder::AudioProperties >;
25+
%template(MetadataPair) pair< string, string >;
26+
%template(MetadatasVector) vector< pair< string, string > >;
27+
%template(GopPair) pair< char, bool >;
28+
%template(GopVector) vector< pair< char, bool > >;
29+
%template(ChannelVector) vector< avtranscoder::Channel >;
30+
}
31+
32+
%include <AvTranscoder/Media.hpp>
33+
34+
%include <AvTranscoder/OutputFile.hpp>
35+
36+
%include <AvTranscoder/OutputStream.hpp>
37+
%include <AvTranscoder/OutputStreamAudio.hpp>
38+
%include <AvTranscoder/OutputStreamVideo.hpp>
39+
40+
%include <AvTranscoder/InputStream.hpp>
41+
%include <AvTranscoder/InputStreamAudio.hpp>
42+
%include <AvTranscoder/InputStreamVideo.hpp>

src/AvTranscoder/jAvTranscoder.i

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
%module AvTranscoder
2+
3+
%include "std_string.i"
4+
%include "std_vector.i"
5+
%include "std_pair.i"
6+
%include "std_map.i"
7+
8+
%{
9+
#include <AvTranscoder/Media.hpp>
10+
11+
#include <AvTranscoder/OutputFile.hpp>
12+
13+
#include <AvTranscoder/OutputStream.hpp>
14+
#include <AvTranscoder/OutputStreamAudio.hpp>
15+
#include <AvTranscoder/OutputStreamVideo.hpp>
16+
17+
#include <AvTranscoder/InputStream.hpp>
18+
#include <AvTranscoder/InputStreamAudio.hpp>
19+
#include <AvTranscoder/InputStreamVideo.hpp>
20+
%}
21+
22+
namespace std {
23+
%template(VideoVector) vector< avtranscoder::VideoProperties >;
24+
%template(AudioVector) vector< avtranscoder::AudioProperties >;
25+
%template(MetadataPair) pair< string, string >;
26+
%template(MetadatasVector) vector< pair< string, string > >;
27+
%template(GopPair) pair< char, bool >;
28+
%template(GopVector) vector< pair< char, bool > >;
29+
%template(ChannelVector) vector< avtranscoder::Channel >;
30+
}
31+
32+
%include <AvTranscoder/Media.hpp>
33+
34+
%include <AvTranscoder/OutputFile.hpp>
35+
36+
%include <AvTranscoder/OutputStream.hpp>
37+
%include <AvTranscoder/OutputStreamAudio.hpp>
38+
%include <AvTranscoder/OutputStreamVideo.hpp>
39+
40+
%include <AvTranscoder/InputStream.hpp>
41+
%include <AvTranscoder/InputStreamAudio.hpp>
42+
%include <AvTranscoder/InputStreamVideo.hpp>

src/SConscript

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,41 @@
11

2+
import glob, re
23

34
Import( "env" )
45
Import( "envJava" )
56
Import( "envPy" )
67

7-
avTranscoder = env.SharedLibrary(
8-
'avTranscoder',
9-
Glob( 'avTranscoder/*.cpp' ),
8+
AvTranscoder = env.SharedLibrary(
9+
'AvTranscoder',
10+
Glob( 'AvTranscoder/*.cpp' ),
1011
LIBS = [
1112
'libavcodec'
1213
]
1314
)
1415

1516
jAvTranscoder = envJava.SharedLibrary(
16-
'javTranscoder',
17+
'jAvTranscoder',
1718
[
18-
'avTranscoder/avTranscoder.i'
19+
'AvTranscoder/avTranscoder.i'
1920
],
20-
LIBS=[ avTranscoder ],
21+
LIBS=[ AvTranscoder ],
2122
)
22-
23+
2324
pyAvTranscoder = envPy.SharedLibrary(
24-
'avTranscoder',
25+
'AvTranscoder',
2526
[
26-
'avTranscoder/avTranscoder.i'
27+
'AvTranscoder/avTranscoder.i'
2728
],
28-
LIBS=[ avTranscoder ],
29-
)
29+
LIBS=[ AvTranscoder ],
30+
)
31+
32+
env['JARCHDIR'] = env.Dir('#/build/src/jAvTranscoder').get_abspath()
33+
34+
compiled_classes = env.Java(
35+
target ='jAvTranscoder',
36+
source = Glob( '#/build/src/AvTranscoder' ) )
37+
38+
new_jar = env.Jar( target = "jAvTranscoder.jar", source = 'jAvTranscoder' )
39+
40+
Export( { 'AvTranscoder': AvTranscoder } )
41+
Export( { 'jAvTranscoder': jAvTranscoder } )

src/avTranscoder/avTranscoder.i

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)