Skip to content

Commit 32b75bb

Browse files
author
Clement Champetier
committed
2 parents e3cdebb + f9738a9 commit 32b75bb

32 files changed

+744
-614
lines changed

.travis.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
os:
2+
- linux
3+
4+
language: cpp
5+
6+
compiler:
7+
- gcc
8+
- clang
9+
10+
before_script:
11+
- date -u
12+
- uname -a
13+
- lsb_release -a
14+
- ln -s tools/scons.travis.cfg scons.cfg
15+
- sudo apt-add-repository "deb http://archive.ubuntu.com/ubuntu trusty main restricted universe multiverse"
16+
- sudo apt-add-repository "deb http://archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse"
17+
- sudo apt-add-repository "deb http://security.ubuntu.com/ubuntu trusty-security main restricted universe multiverse"
18+
- sudo apt-get update -qq
19+
- sudo apt-get install -qq gcc g++ scons swig swig2.0
20+
- sudo apt-get install -qq libavdevice-dev libavformat-dev libavcodec-dev libavutil-dev libswscale-dev libavresample-dev python-dev freeglut3-dev doxygen
21+
22+
script:
23+
- scons
24+
25+
after_failure:
26+
- cat config.log
27+

app/SConscript

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -66,19 +66,6 @@ avprocessor = env.Program(
6666
],
6767
)
6868

69-
audioRewrapper = env.Program(
70-
'audioWrap',
71-
Glob( 'audioRewrapper/*.cpp' ),
72-
LIBS = [
73-
sAvTranscoder,
74-
'avutil',
75-
'avformat',
76-
'avcodec',
77-
'swscale',
78-
resampleLibraryName,
79-
]
80-
)
81-
8269
if platform.system() != 'Windows':
8370
avplayer = env.Program(
8471
'avplayer',
@@ -128,9 +115,7 @@ avprofiles = env.Program(
128115
)
129116

130117
env.Depends( avmeta, sAvTranscoder )
131-
env.Depends( audioRewrapper, sAvTranscoder )
132118

133119
env.Alias( "install", env.Install(os.path.join( installPrefix, "bin" ), avmeta ) )
134120
env.Alias( "install", env.Install(os.path.join( installPrefix, "bin" ), avprocessor ) )
135121
env.Alias( "install", env.Install(os.path.join( installPrefix, "bin" ), avtransform ) )
136-
env.Alias( "install", env.Install(os.path.join( installPrefix, "bin" ), audioRewrapper ) )

app/audioRewrapper/audioRewrapper.cpp

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

app/avInfo/avInfo.cpp

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,15 @@
66

77
int main( int argc, char** argv )
88
{
9-
avtranscoder::AvVersions versions( avtranscoder::getVersion() );
9+
avtranscoder::Libraries libs( avtranscoder::getLibraries() );
1010

11-
for( avtranscoder::AvVersions::iterator libVersion = versions.begin(); libVersion != versions.end(); ++libVersion )
11+
for( avtranscoder::Libraries::iterator library = libs.begin(); library != libs.end(); ++library )
1212
{
13-
std::cout << std::left << std::setw( 15 ) << (*libVersion).first;
14-
std::cout << std::left << std::setw( 30 ) << avtranscoder::getLicence();
15-
16-
std::stringstream completeVersion;
17-
for( std::vector<size_t>::iterator version = (*libVersion).second.begin(); version != (*libVersion).second.end(); ++version )
18-
{
19-
completeVersion << *version << ".";
20-
}
21-
std::cout << completeVersion.str() << std::endl;
13+
std::cout << std::left;
14+
std::cout << std::setw( 15 ) << (*library).getName();
15+
std::cout << std::setw( 10 ) << (*library).getStringVersion();
16+
std::cout << std::setw( 30 ) << (*library).getLicence();
17+
std::cout << std::endl;
2218
}
2319

2420
// std::cout << "avinfo" << std::endl;

app/avplay/AvReader.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ class AvReader : public Reader
2727

2828
m_inputVideo = new avtranscoder::InputVideo( m_inputFile.getStream( m_videoStream ) );
2929

30+
m_inputVideo->setup();
31+
3032
m_sourceImage = new avtranscoder::Image( m_inputFile.getStream( m_videoStream ).getVideoDesc().getImageDesc() );
3133

3234
pixel.setBitsPerPixel( getComponents() * getBitDepth() );

app/genericProcessor/genericProcessor.cpp

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88
#include <sstream>
99
#include <cstdlib>
1010

11+
bool verbose = false;
1112

12-
void parseConfigFile( const std::string& configFilename, avtranscoder::Transcoder::InputStreamsDesc& streams )
13+
void parseConfigFile( const std::string& configFilename, avtranscoder::Transcoder& transcoder, avtranscoder::Profile& profile )
1314
{
1415
std::ifstream configFile( configFilename.c_str(), std::ifstream::in );
1516

@@ -25,8 +26,9 @@ void parseConfigFile( const std::string& configFilename, avtranscoder::Transcode
2526
{
2627
std::string transcodeProfile;
2728
std::getline( is_line, transcodeProfile );
28-
std::cout << filename << " ( " << streamId << " ) : " << transcodeProfile << std::endl;
29-
streams.push_back( avtranscoder::Transcoder::InputStreamDesc( atoi( streamId.c_str() ), filename, transcodeProfile ) );
29+
if( verbose )
30+
std::cout << filename << " ( " << streamId << " ) : " << transcodeProfile << std::endl;
31+
transcoder.add( filename, atoi( streamId.c_str() ), transcodeProfile );
3032
}
3133
}
3234
}
@@ -44,33 +46,48 @@ int main( int argc, char** argv )
4446

4547
av_log_set_level( AV_LOG_FATAL );
4648

49+
if( verbose )
50+
av_log_set_level( AV_LOG_DEBUG );
51+
4752
try
4853
{
49-
std::cout << "start ..." << std::endl;
54+
if( verbose )
55+
std::cout << "start ..." << std::endl;
5056

51-
std::string inputConfigFile( argv[1] );
52-
avtranscoder::OutputFile outputFile( argv[2] );
57+
avtranscoder::Profile profiles( true );
5358

54-
avtranscoder::Transcoder::InputStreamsDesc streams;
59+
if( verbose )
60+
std::cout << "output file: " << argv[2] << std::endl;
5561

56-
parseConfigFile( inputConfigFile, streams );
62+
std::string inputConfigFile( argv[1] );
63+
avtranscoder::OutputFile outputFile( argv[2] );
5764

5865
avtranscoder::Transcoder transcoder( outputFile );
66+
transcoder.setVerbose( verbose );
5967

60-
transcoder.add( streams );
68+
if( verbose )
69+
std::cout << "parse config file" << std::endl;
70+
parseConfigFile( inputConfigFile, transcoder, profiles );
6171

62-
std::cout << "start Transcode" << std::endl;
72+
if( verbose )
73+
std::cout << "start Transcode" << std::endl;
6374

6475
avtranscoder::ProgressListener progress;
6576

6677
// video re-wrapping or transcoding if necessary
6778
transcoder.process( progress );
6879

69-
std::cout << std::endl << "end ..." << std::endl;
80+
std::cout << std::endl;
81+
if( verbose )
82+
std::cout << "end ..." << std::endl;
7083
}
7184
catch( std::exception& e )
7285
{
73-
std::cerr << "ERROR: during process, an error occured:" << std::endl << e.what() << std::endl;
86+
std::cerr << "ERROR: during process, an error occured: " << e.what() << std::endl;
87+
}
88+
catch( ... )
89+
{
90+
std::cerr << "ERROR: during process, an unknown error occured" << std::endl;
7491
}
7592

7693
}

src/AvTranscoder/CodedStream/AvInputStream.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class AvExport AvInputStream : public InputStream
4040
void addPacket( AVPacket& packet );
4141

4242
void setBufferred( const bool bufferized ){ _bufferized = bufferized; };
43+
bool getBufferred() const { return _bufferized; };
4344

4445
void clearBuffering();
4546

src/AvTranscoder/CodedStream/AvOutputStream.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,22 @@
22

33
#include <AvTranscoder/File/OutputFile.hpp>
44

5+
#include <cassert>
6+
#include <iostream>
7+
58
namespace avtranscoder
69
{
710

811
AvOutputStream::AvOutputStream( )
9-
: _outputFile( NULL )
12+
: OutputStream()
13+
, _outputFile( NULL )
1014
, _streamIndex( 0 )
1115
{
1216
}
1317

1418
AvOutputStream::AvOutputStream( OutputFile& outputFile, const size_t streamIndex )
15-
: _outputFile( &outputFile )
19+
: OutputStream()
20+
, _outputFile( &outputFile )
1621
, _streamIndex( streamIndex )
1722
{
1823
}
@@ -23,6 +28,8 @@ AvOutputStream::~AvOutputStream()
2328

2429
bool AvOutputStream::wrap( DataStream& data )
2530
{
31+
assert( _outputFile != NULL );
32+
2633
return _outputFile->wrap( data, _streamIndex );
2734
}
2835

0 commit comments

Comments
 (0)