Skip to content

Commit 85054c2

Browse files
author
Clement Champetier
committed
Merge branch 'master' into coverity_scan
2 parents f956a0c + d196115 commit 85054c2

File tree

79 files changed

+2121
-1007
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+2121
-1007
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ You can also use it in Java & Python for simpliest integration in projects.
1111
###### Drone.io
1212
[![Build Status](https://drone.io/github.com/avTranscoder/avTranscoder/status.png)](https://drone.io/github.com/avTranscoder/avTranscoder/latest)
1313

14+
###### Travis
15+
[![Build Status](https://travis-ci.org/avTranscoder/avTranscoder.svg?branch=master)](https://travis-ci.org/avTranscoder/avTranscoder)
16+
17+
###### Coverity Scan
18+
<a href="https://scan.coverity.com/projects/2626">
19+
<img alt="Coverity Scan Build Status"
20+
src="https://scan.coverity.com/projects/2626/badge.svg"/>
21+
</a>
22+
1423
#### Packaging
1524

1625
###### Build openSUSE

SConstruct

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ import os
44
import sys
55
import ConfigParser
66

7+
mymode = ARGUMENTS.get('mode', 'release')
8+
9+
if not (mymode in ['debug', 'release']):
10+
print "Error: expected 'debug' or 'release', found: " + mymode
11+
Exit(1)
12+
713
config = ConfigParser.RawConfigParser()
814

915
config.read( [
@@ -85,7 +91,7 @@ envJava.Replace(
8591
libavLibDir,
8692
"#src",
8793
],
88-
JARCHDIR = env.Dir('#build/src/AvTranscoder').get_abspath(),
94+
JARCHDIR = env.Dir('#build/'+mymode+'/src/AvTranscoder').get_abspath(),
8995
)
9096

9197
envJava.Append(
@@ -153,16 +159,25 @@ envPy.Append(
153159
CXXFLAGS = resampleLibraryFlag
154160
)
155161

162+
if mymode == "release":
163+
env.Append(CCFLAGS = ['-O3'])
164+
if mymode == "debug":
165+
env.Append(CCFLAGS = ['-pg', '-g'])
166+
156167
Export( "env" )
157168
Export( "envJava" )
158169
Export( "envPy" )
159170
Export( "installPrefix" )
160171
Export( "resampleLibraryName" )
161172

162-
VariantDir( 'build/src', 'src', duplicate = 0 )
163-
VariantDir( 'build/app', 'app', duplicate = 0 )
173+
VariantDir( 'build/'+mymode+'/src', 'src', duplicate = 0 )
174+
VariantDir( 'build/'+mymode+'/app', 'app', duplicate = 0 )
164175

165-
SConscript( [
176+
sconscripts = [
166177
'build/src/SConscript',
167178
'build/app/SConscript',
168-
] )
179+
]
180+
181+
SConscript('src/SConscript', variant_dir='build/'+mymode+'/src')
182+
SConscript('app/SConscript', variant_dir='build/'+mymode+'/app')
183+

app/avInfo/avInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ int main( int argc, char** argv )
1313
std::cout << std::left;
1414
std::cout << std::setw( 15 ) << (*library).getName();
1515
std::cout << std::setw( 10 ) << (*library).getStringVersion();
16-
std::cout << std::setw( 30 ) << (*library).getLicence();
16+
std::cout << std::setw( 30 ) << (*library).getLicense();
1717
std::cout << std::endl;
1818
}
1919

app/avMeta/avMeta.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ int main( int argc, char** argv )
1717
input.analyse( p, avtranscoder::InputFile::eAnalyseLevelFull );
1818

1919
// a simply metadata display
20-
displayMetadatas( input );
20+
std::cout << input;
2121
}

app/avTranscoder/avTranscoder.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ void transcodeVideo( const char* inputfilename, const char* outputFilename )
2626

2727
// init video decoders
2828
InputVideo inputVideo( input.getStream( 0 ) );
29-
ImageDesc imageDesc = input.getStream( 0 ).getVideoDesc().getImageDesc();
30-
Image sourceImage( imageDesc );
29+
VideoFrameDesc VideoFrameDesc = input.getStream( 0 ).getVideoDesc().getVideoFrameDesc();
30+
VideoFrame sourceImage( VideoFrameDesc );
3131

3232
// init video encoder
3333
OutputVideo outputVideo;
34-
outputVideo.setProfile( profile.getProfile( "xdcamhd422" ), imageDesc );
35-
Image imageToEncode( outputVideo.getVideoDesc().getImageDesc() );
34+
outputVideo.setProfile( profile.getProfile( "xdcamhd422" ), VideoFrameDesc );
35+
VideoFrame imageToEncode( outputVideo.getVideoDesc().getVideoFrameDesc() );
3636

3737
DataStream codedImage;
3838

app/avplay/AvReader.hpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class AvReader : public Reader
2929

3030
m_inputVideo->setup();
3131

32-
m_sourceImage = new avtranscoder::Image( m_inputFile.getStream( m_videoStream ).getVideoDesc().getImageDesc() );
32+
m_sourceImage = new avtranscoder::VideoFrame( m_inputFile.getStream( m_videoStream ).getVideoDesc().getVideoFrameDesc() );
3333

3434
pixel.setBitsPerPixel( getComponents() * getBitDepth() );
3535
pixel.setComponents( getComponents() );
@@ -38,13 +38,13 @@ class AvReader : public Reader
3838
pixel.setAlpha( false );
3939
pixel.setPlanar( false );
4040

41-
imageDescToDisplay.setWidth( m_sourceImage->desc().getWidth() );
42-
imageDescToDisplay.setHeight( m_sourceImage->desc().getHeight() );
43-
imageDescToDisplay.setDar( m_sourceImage->desc().getDar() );
41+
VideoFrameDescToDisplay.setWidth( m_sourceImage->desc().getWidth() );
42+
VideoFrameDescToDisplay.setHeight( m_sourceImage->desc().getHeight() );
43+
VideoFrameDescToDisplay.setDar( m_sourceImage->desc().getDar() );
4444

45-
imageDescToDisplay.setPixel( pixel.findPixel() );
45+
VideoFrameDescToDisplay.setPixel( pixel.findPixel() );
4646

47-
m_imageToDisplay = new avtranscoder::Image( imageDescToDisplay );
47+
m_imageToDisplay = new avtranscoder::VideoFrame( VideoFrameDescToDisplay );
4848
}
4949

5050
~AvReader()
@@ -98,19 +98,19 @@ class AvReader : public Reader
9898

9999
void printMetadatas()
100100
{
101-
displayMetadatas( m_inputFile );
101+
std::cout << m_inputFile << std::endl;
102102
}
103103

104104
private:
105105
avtranscoder::InputFile m_inputFile;
106106

107107
avtranscoder::InputVideo* m_inputVideo;
108108

109-
avtranscoder::Image* m_sourceImage;
110-
avtranscoder::Image* m_imageToDisplay;
109+
avtranscoder::VideoFrame* m_sourceImage;
110+
avtranscoder::VideoFrame* m_imageToDisplay;
111111

112112
avtranscoder::Pixel pixel;
113-
avtranscoder::ImageDesc imageDescToDisplay;
113+
avtranscoder::VideoFrameDesc VideoFrameDescToDisplay;
114114

115115
avtranscoder::VideoEssenceTransform m_videoEssenceTransform;
116116
size_t m_videoStream;

app/genericProcessor/genericProcessor.cpp

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

11+
static const size_t dummyWidth = 1920;
12+
static const size_t dummyHeight = 1080;
13+
static const std::string dummyPixelFormat = "yuv420p";
14+
static const std::string dummyVideoCodec = "mpeg2video";
15+
static const std::string dummyAudioCodec = "pcm_s16le";
16+
1117
// bool verbose = false;
1218
bool verbose = true;
1319

@@ -47,9 +53,27 @@ void parseConfigFile( const std::string& configFilename, avtranscoder::Transcode
4753
std::cout << ( transcodeProfile.length() ? transcodeProfile : "rewrap" );
4854
std::cout << std::endl;
4955
}
50-
51-
transcoder.add( filename, streamIndex, subStreamIndex, transcodeProfile );
52-
56+
57+
// dummy stream, need a CodedDesc (audio or video)
58+
if( ! filename.length() )
59+
{
60+
// video
61+
avtranscoder::VideoFrameDesc imageDesc;
62+
imageDesc.setWidth( dummyWidth );
63+
imageDesc.setHeight( dummyHeight );
64+
imageDesc.setDar( dummyWidth, dummyHeight );
65+
avtranscoder::Pixel inputPixel( dummyPixelFormat );
66+
imageDesc.setPixel( inputPixel );
67+
68+
avtranscoder::VideoDesc inputVideoDesc( dummyVideoCodec );
69+
inputVideoDesc.setImageParameters( imageDesc );
70+
71+
transcoder.add( filename, streamIndex, subStreamIndex, transcodeProfile, inputVideoDesc );
72+
}
73+
else
74+
{
75+
transcoder.add( filename, streamIndex, subStreamIndex, transcodeProfile );
76+
}
5377
}
5478
}
5579
}
@@ -84,12 +108,17 @@ int main( int argc, char** argv )
84108
avtranscoder::OutputFile outputFile( argv[2] );
85109

86110
avtranscoder::Transcoder transcoder( outputFile );
87-
transcoder.setVerbose( verbose );
88111

89112
if( verbose )
90113
std::cout << "parse config file" << std::endl;
91114
parseConfigFile( inputConfigFile, transcoder, profiles );
92115

116+
// set verbose of all stream
117+
transcoder.setVerbose( verbose );
118+
transcoder.setProcessMethod( avtranscoder::eProcessMethodInfinity );
119+
//transcoder.setOutputFps( 12 );
120+
transcoder.init();
121+
93122
if( verbose )
94123
std::cout << "start Transcode" << std::endl;
95124

app/presetChecker/presetChecker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ int main( int argc, char** argv )
2525
if( profile.find( avtranscoder::Profile::avProfileType )->second == avtranscoder::Profile::avProfileTypeVideo )
2626
{
2727
avtranscoder::OutputVideo outputVideo;
28-
outputVideo.setProfile( profile, outputVideo.getVideoDesc().getImageDesc() );
28+
outputVideo.setProfile( profile, outputVideo.getVideoDesc().getVideoFrameDesc() );
2929
}
3030

3131
if( profile.find( avtranscoder::Profile::avProfileType )->second == avtranscoder::Profile::avProfileTypeAudio )

src/AvTranscoder/CodedStream/AvInputStream.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ extern "C" {
99

1010
#include <libavcodec/avcodec.h>
1111
#include <libavformat/avformat.h>
12-
#include <libavutil/avutil.h>
13-
#include <libavutil/pixdesc.h>
14-
#include <libavutil/avstring.h>
1512
}
1613

1714
#include <stdexcept>
@@ -134,6 +131,12 @@ AudioDesc AvInputStream::getAudioDesc() const
134131
return desc;
135132
}
136133

134+
DataDesc AvInputStream::getDataDesc() const
135+
{
136+
DataDesc desc;
137+
return desc;
138+
}
139+
137140
AVMediaType AvInputStream::getStreamType() const
138141
{
139142
return _inputFile->getStreamType( _streamIndex );

src/AvTranscoder/CodedStream/AvInputStream.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
#include "InputStream.hpp"
55

6+
#include <AvTranscoder/CodedStructures/DataStream.hpp>
7+
68
namespace avtranscoder
79
{
810

@@ -28,9 +30,10 @@ class AvExport AvInputStream : public InputStream
2830

2931
bool readNextPacket( DataStream& data );
3032

31-
// Stream propeerties
33+
// Stream properties
3234
VideoDesc getVideoDesc() const;
3335
AudioDesc getAudioDesc() const;
36+
DataDesc getDataDesc() const;
3437

3538
AVMediaType getStreamType() const;
3639

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy