Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit85054c2

Browse files
author
Clement Champetier
committed
Merge branch 'master' into coverity_scan
2 parentsf956a0c +d196115 commit85054c2

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+
<ahref="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
importsys
55
importConfigParser
66

7+
mymode=ARGUMENTS.get('mode','release')
8+
9+
ifnot (mymodein ['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+
ifmymode=="release":
163+
env.Append(CCFLAGS= ['-O3'])
164+
ifmymode=="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
InputVideoinputVideo( input.getStream(0 ) );
29-
ImageDesc imageDesc = input.getStream(0 ).getVideoDesc().getImageDesc();
30-
ImagesourceImage(imageDesc );
29+
VideoFrameDesc VideoFrameDesc = input.getStream(0 ).getVideoDesc().getVideoFrameDesc();
30+
VideoFramesourceImage(VideoFrameDesc );
3131

3232
// init video encoder
3333
OutputVideo outputVideo;
34-
outputVideo.setProfile( profile.getProfile("xdcamhd422" ),imageDesc );
35-
ImageimageToEncode( outputVideo.getVideoDesc().getImageDesc() );
34+
outputVideo.setProfile( profile.getProfile("xdcamhd422" ),VideoFrameDesc );
35+
VideoFrameimageToEncode( 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 =newavtranscoder::Image( m_inputFile.getStream( m_videoStream ).getVideoDesc().getImageDesc() );
32+
m_sourceImage =newavtranscoder::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 =newavtranscoder::Image( imageDescToDisplay );
47+
m_imageToDisplay =newavtranscoder::VideoFrame( VideoFrameDescToDisplay );
4848
}
4949

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

9999
voidprintMetadatas()
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+
staticconstsize_t dummyWidth =1920;
12+
staticconstsize_t dummyHeight =1080;
13+
staticconst std::string dummyPixelFormat ="yuv420p";
14+
staticconst std::string dummyVideoCodec ="mpeg2video";
15+
staticconst 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::PixelinputPixel( dummyPixelFormat );
66+
imageDesc.setPixel( inputPixel );
67+
68+
avtranscoder::VideoDescinputVideoDesc( 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::OutputFileoutputFile( argv[2] );
85109

86110
avtranscoder::Transcodertranscoder( 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+
DataDescAvInputStream::getDataDesc()const
135+
{
136+
DataDesc desc;
137+
return desc;
138+
}
139+
137140
AVMediaTypeAvInputStream::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
namespaceavtranscoder
79
{
810

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

2931
boolreadNextPacket( DataStream& data );
3032

31-
// Streampropeerties
33+
// Streamproperties
3234
VideoDescgetVideoDesc()const;
3335
AudioDescgetAudioDesc()const;
36+
DataDescgetDataDesc()const;
3437

3538
AVMediaTypegetStreamType()const;
3639

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp