Skip to content

Commit 59e7340

Browse files
Merge pull request #103 from cchampet/dev_clean_refactoring
Common naming nomenclature - second step
2 parents b987e8b + c3e46c1 commit 59e7340

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

+1669
-1571
lines changed

app/avTranscoder/avTranscoder.cpp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,15 @@
44

55
#include <AvTranscoder/file/InputFile.hpp>
66
#include <AvTranscoder/file/OutputFile.hpp>
7+
8+
#include <AvTranscoder/frame/Frame.hpp>
9+
710
#include <AvTranscoder/essenceStream/AvInputAudio.hpp>
811
#include <AvTranscoder/essenceStream/AvInputVideo.hpp>
912
#include <AvTranscoder/essenceStream/AvOutputAudio.hpp>
1013
#include <AvTranscoder/essenceStream/AvOutputVideo.hpp>
11-
#include <AvTranscoder/essenceTransform/VideoEssenceTransform.hpp>
14+
15+
#include <AvTranscoder/transform/VideoTransform.hpp>
1216

1317
#include <AvTranscoder/progress/ConsoleProgress.hpp>
1418

@@ -28,15 +32,15 @@ void transcodeVideo( const char* inputfilename, const char* outputFilename )
2832

2933
// init video decoders
3034
AvInputVideo inputVideo( input.getStream( 0 ) );
31-
VideoFrameDesc VideoFrameDesc = input.getStream( 0 ).getVideoDesc().getVideoFrameDesc();
35+
VideoFrameDesc VideoFrameDesc = input.getStream( 0 ).getVideoCodec().getVideoFrameDesc();
3236
VideoFrame sourceImage( VideoFrameDesc );
3337

3438
// init video encoder
3539
AvOutputVideo outputVideo;
3640
outputVideo.setProfile( profile.getProfile( "xdcamhd422" ), VideoFrameDesc );
37-
VideoFrame imageToEncode( outputVideo.getVideoDesc().getVideoFrameDesc() );
41+
VideoFrame imageToEncode( outputVideo.getVideoCodec().getVideoFrameDesc() );
3842

39-
DataStream codedImage;
43+
CodedData codedImage;
4044

4145
// setup wrapper
4246
//mxftkwrapper::MxftkOutputFile of( outputFilename );
@@ -49,11 +53,11 @@ void transcodeVideo( const char* inputfilename, const char* outputFilename )
4953
exit( -1 );
5054
}
5155

52-
of.addVideoStream( outputVideo.getVideoDesc() );
56+
of.addVideoStream( outputVideo.getVideoCodec() );
5357

5458
of.beginWrap();
5559

56-
VideoEssenceTransform ct;
60+
VideoTransform ct;
5761

5862

5963
// Encodage/transcodage

app/avplay/AvReader.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include <AvTranscoder/file/InputFile.hpp>
55
#include <AvTranscoder/essenceStream/AvInputAudio.hpp>
66
#include <AvTranscoder/essenceStream/AvInputVideo.hpp>
7-
#include <AvTranscoder/essenceTransform/VideoEssenceTransform.hpp>
7+
#include <AvTranscoder/transform/VideoTransform.hpp>
88
#include <AvTranscoder/mediaProperty/printMediaProperty.hpp>
99

1010
#include <AvTranscoder/progress/ConsoleProgress.hpp>
@@ -31,7 +31,7 @@ class AvReader : public Reader
3131

3232
_inputVideo->setup();
3333

34-
_sourceImage = new avtranscoder::VideoFrame( _inputFile.getStream( _videoStream ).getVideoDesc().getVideoFrameDesc() );
34+
_sourceImage = new avtranscoder::VideoFrame( _inputFile.getStream( _videoStream ).getVideoCodec().getVideoFrameDesc() );
3535

3636
_pixel.setBitsPerPixel( getComponents() * getBitDepth() );
3737
_pixel.setComponents( getComponents() );
@@ -80,7 +80,7 @@ class AvReader : public Reader
8080
{
8181
++_currentFrame;
8282
_inputVideo->readNextFrame( *_sourceImage );
83-
_videoEssenceTransform.convert( *_sourceImage, *_imageToDisplay );
83+
_videoTransform.convert( *_sourceImage, *_imageToDisplay );
8484
return (const char*)_imageToDisplay->getPtr();
8585
}
8686

@@ -114,7 +114,7 @@ class AvReader : public Reader
114114
avtranscoder::Pixel _pixel;
115115
avtranscoder::VideoFrameDesc _videoFrameDescToDisplay;
116116

117-
avtranscoder::VideoEssenceTransform _videoEssenceTransform;
117+
avtranscoder::VideoTransform _videoTransform;
118118
size_t _videoStream;
119119
};
120120

app/genericProcessor/genericProcessor.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ static const std::string dummyPixelFormat = "yuv420p";
1515
static const std::string dummyVideoCodec = "mpeg2video";
1616
static const std::string dummyAudioCodec = "pcm_s16le";
1717

18-
// bool verbose = false;
19-
bool verbose = true;
18+
bool verbose = false;
2019

2120
void parseConfigFile( const std::string& configFilename, avtranscoder::Transcoder& transcoder, avtranscoder::Profile& profile )
2221
{
@@ -55,7 +54,7 @@ void parseConfigFile( const std::string& configFilename, avtranscoder::Transcode
5554
std::cout << std::endl;
5655
}
5756

58-
// dummy stream, need a CodedDesc (audio or video)
57+
// dummy stream, need a ICodec (audio or video)
5958
if( ! filename.length() )
6059
{
6160
// video
@@ -66,10 +65,10 @@ void parseConfigFile( const std::string& configFilename, avtranscoder::Transcode
6665
avtranscoder::Pixel inputPixel( dummyPixelFormat );
6766
imageDesc.setPixel( inputPixel );
6867

69-
avtranscoder::VideoDesc inputVideoDesc( dummyVideoCodec );
70-
inputVideoDesc.setImageParameters( imageDesc );
68+
avtranscoder::VideoCodec inputVideoCodec( avtranscoder::eCodecTypeEncoder, dummyVideoCodec );
69+
inputVideoCodec.setImageParameters( imageDesc );
7170

72-
transcoder.add( filename, streamIndex, subStreamIndex, transcodeProfile, inputVideoDesc );
71+
transcoder.add( filename, streamIndex, subStreamIndex, transcodeProfile, inputVideoCodec );
7372
}
7473
else
7574
{

app/optionChecker/optionChecker.cpp

Lines changed: 57 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
#include <AvTranscoder/option/OptionLoader.hpp>
1+
#include <AvTranscoder/util.hpp>
2+
#include <AvTranscoder/option/Context.hpp>
3+
#include <AvTranscoder/option/CodecContext.hpp>
24
#include <AvTranscoder/option/Option.hpp>
5+
#include <AvTranscoder/file/InputFile.hpp>
36

47
#include <string>
58
#include <iostream>
69
#include <map>
710
#include <vector>
8-
#include <utility> //pair
11+
#include <utility>
912

10-
void displayOptions( avtranscoder::OptionLoader::OptionArray& options )
13+
void displayOptions( const std::vector<avtranscoder::Option>& options )
1114
{
1215
for( auto option : options )
1316
{
@@ -20,74 +23,89 @@ void displayOptions( avtranscoder::OptionLoader::OptionArray& options )
2023

2124
// get default value
2225

23-
if( option.getType() == avtranscoder::TypeInt )
26+
if( option.getType() == avtranscoder::eOptionBaseTypeInt )
2427
{
25-
std::cout << "DefaultValue: " << option.getDefaultValueInt() << std::endl;
28+
std::cout << "DefaultValue: " << option.getDefaultInt() << std::endl;
2629
}
27-
else if( option.getType() == avtranscoder::TypeBool )
30+
else if( option.getType() == avtranscoder::eOptionBaseTypeBool )
2831
{
29-
std::cout << "DefaultValue: " << option.getDefaultValueBool() << std::endl;
32+
std::cout << "DefaultValue: " << option.getDefaultBool() << std::endl;
3033
}
31-
else if( option.getType() == avtranscoder::TypeDouble )
34+
else if( option.getType() == avtranscoder::eOptionBaseTypeDouble )
3235
{
33-
std::cout << "DefaultValue: " << option.getDefaultValueDouble() << std::endl;
36+
std::cout << "DefaultValue: " << option.getDefaultDouble() << std::endl;
3437
}
35-
else if( option.getType() == avtranscoder::TypeRatio )
38+
else if( option.getType() == avtranscoder::eOptionBaseTypeRatio )
3639
{
37-
std::cout << "DefaultValue: " << option.getDefaultValueRatio().first << ", " << option.getDefaultValueRatio().second << std::endl;
40+
std::cout << "DefaultValue: " << option.getDefaultRatio().first << ", " << option.getDefaultRatio().second << std::endl;
3841
}
39-
else if( option.getType() == avtranscoder::TypeString )
42+
else if( option.getType() == avtranscoder::eOptionBaseTypeString )
4043
{
41-
std::cout << "DefaultValue: " << option.getDefaultValueString() << std::endl;
44+
std::cout << "DefaultValue: " << option.getDefaultString() << std::endl;
4245
}
43-
else if( option.getType() == avtranscoder::TypeChoice )
46+
else if( option.getType() == avtranscoder::eOptionBaseTypeChoice )
4447
{
45-
std::cout << "Nb choices: " << option.getNbChilds() << std::endl;
48+
std::cout << "Nb choices: " << option.getChilds().size() << std::endl;
4649
std::cout << "Default choice index: " << option.getDefaultChildIndex() << std::endl;
47-
for(size_t i = 0; i < option.getNbChilds(); ++i )
50+
for(size_t i = 0; i < option.getChilds().size(); ++i )
4851
std::cout << "Choice " << i << ": " <<
49-
option.getChild( i ).getName() << " // " <<
50-
option.getChild( i ).getHelp() << std::endl;
52+
option.getChildAtIndex( i ).getName() << " // " <<
53+
option.getChildAtIndex( i ).getHelp() << std::endl;
5154
}
52-
else if( option.getType() == avtranscoder::TypeGroup )
55+
else if( option.getType() == avtranscoder::eOptionBaseTypeGroup )
5356
{
54-
std::cout << "Nb choices: " << option.getNbChilds() << std::endl;
55-
for(size_t i = 0; i < option.getNbChilds(); ++i )
57+
std::cout << "Nb choices: " << option.getChilds().size() << std::endl;
58+
for(size_t i = 0; i < option.getChilds().size(); ++i )
5659
std::cout << "Element " << i << ": " <<
57-
option.getChild( i ).getName() << " // " <<
58-
option.getChild( i ).getDefaultValueBool() << std::endl;
60+
option.getChildAtIndex( i ).getName() << " // " <<
61+
option.getChildAtIndex( i ).getDefaultBool() << std::endl;
5962
}
6063
}
6164
}
6265

6366
void optionChecker( const std::string& inputfilename )
64-
{
65-
avtranscoder::OptionLoader optionLoader;
66-
67-
//avtranscoder::OptionLoader::OptionArray optionsArray = optionLoader.loadOptions( AV_OPT_FLAG_AUDIO_PARAM );
68-
avtranscoder::OptionLoader::OptionMap optionsMap = optionLoader.loadOutputFormatOptions();
69-
70-
//displayOptions( optionsArray );
71-
for( avtranscoder::OptionLoader::OptionMap::iterator it = optionsMap.begin();
72-
it != optionsMap.end();
73-
++it )
74-
{
75-
std::cout << "----- " << it->first << " -----" << std::endl;
76-
displayOptions( it->second );
77-
}
67+
{
68+
avtranscoder::InputFile file( inputfilename );
69+
70+
// format options
71+
avtranscoder::Context formatContext( &file.getFormatContext() );
72+
std::vector<avtranscoder::Option> formatOptions = formatContext.getOptions();
73+
displayOptions( formatOptions );
74+
75+
// codec options
76+
avtranscoder::CodecContext codecContext( AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM );
77+
std::vector<avtranscoder::Option> codecOptions = codecContext.getOptions();
78+
displayOptions( codecOptions );
79+
80+
// pixel formats
81+
// std::vector<std::string> pixelFormats = avtranscoder::getPixelFormats();
82+
// for( size_t i = 0; i < pixelFormats.size(); ++i )
83+
// {
84+
// std::cout << "----- " << pixelFormats[i] << " -----" << std::endl;
85+
// }
86+
87+
// options per format
88+
// std::map< std::string, std::vector<avtranscoder::Option> > optionsPerFormat = avtranscoder::getOutputFormatOptions();
89+
// for( std::map< std::string, std::vector<avtranscoder::Option> >::iterator it = optionsPerFormat.begin();
90+
// it != optionsPerFormat.end();
91+
// ++it )
92+
// {
93+
// std::cout << "----- " << it->first << " -----" << std::endl;
94+
// displayOptions( it->second );
95+
// }
7896
}
7997

8098
int main( int argc, char** argv )
8199
{
100+
std::cout << "start ..." << std::endl;
101+
82102
if( argc <= 1 )
83103
{
84104
std::cout << "audiorewrapper require a media filename" << std::endl;
85105
std::cout << "example: audioWrap file.ext" << std::endl;
86106
return( -1 );
87107
}
88108

89-
std::cout << "start ..." << std::endl;
90-
91109
try
92110
{
93111
optionChecker( argv[1] );

app/presetChecker/presetChecker.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ int main( int argc, char** argv )
2828
if( profile.find( avtranscoder::Profile::avProfileType )->second == avtranscoder::Profile::avProfileTypeVideo )
2929
{
3030
avtranscoder::AvOutputVideo outputVideo;
31-
outputVideo.setProfile( profile, outputVideo.getVideoDesc().getVideoFrameDesc() );
31+
outputVideo.setProfile( profile, outputVideo.getVideoCodec().getVideoFrameDesc() );
3232
}
3333

3434
if( profile.find( avtranscoder::Profile::avProfileType )->second == avtranscoder::Profile::avProfileTypeAudio )
3535
{
3636
avtranscoder::AvOutputAudio outputAudio;
37-
outputAudio.setProfile( profile, outputAudio.getAudioDesc().getFrameDesc() );
37+
outputAudio.setProfile( profile, outputAudio.getAudioCodec().getFrameDesc() );
3838
}
3939
}
4040
catch( ... )

src/AvTranscoder/Library.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
#include "Library.hpp"
22

33
extern "C" {
4-
#ifndef __STDC_CONSTANT_MACROS
5-
#define __STDC_CONSTANT_MACROS
6-
#endif
74
#include <libavutil/version.h>
85
#include <libavcodec/version.h>
96
#include <libswscale/version.h>

src/AvTranscoder/Library.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#ifndef _AV_TRANSCODER_DESCRIPTION_HPP_
22
#define _AV_TRANSCODER_DESCRIPTION_HPP_
33

4+
#include "common.hpp"
5+
46
#include <vector>
57
#include <string>
68

7-
#include "common.hpp"
8-
99
namespace avtranscoder
1010
{
1111

src/AvTranscoder/avTranscoder.i

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,15 @@
1515

1616
#include <AvTranscoder/Profile.hpp>
1717

18-
#include <AvTranscoder/essenceStructures/Pixel.hpp>
19-
#include <AvTranscoder/essenceStructures/Frame.hpp>
20-
#include <AvTranscoder/essenceStructures/VideoFrame.hpp>
21-
#include <AvTranscoder/essenceStructures/AudioFrame.hpp>
18+
#include <AvTranscoder/frame/Pixel.hpp>
19+
#include <AvTranscoder/frame/Frame.hpp>
20+
#include <AvTranscoder/frame/VideoFrame.hpp>
21+
#include <AvTranscoder/frame/AudioFrame.hpp>
2222

23-
#include <AvTranscoder/codedStructures/CodedDesc.hpp>
24-
#include <AvTranscoder/codedStructures/VideoDesc.hpp>
25-
#include <AvTranscoder/codedStructures/AudioDesc.hpp>
26-
#include <AvTranscoder/codedStructures/DataDesc.hpp>
27-
#include <AvTranscoder/codedStructures/DataStream.hpp>
23+
#include <AvTranscoder/codec/ICodec.hpp>
24+
#include <AvTranscoder/codec/VideoCodec.hpp>
25+
#include <AvTranscoder/codec/AudioCodec.hpp>
26+
#include <AvTranscoder/codec/DataCodec.hpp>
2827

2928
#include <AvTranscoder/mediaProperty/mediaProperty.hpp>
3029

@@ -89,17 +88,15 @@ namespace std {
8988

9089
%include <AvTranscoder/Profile.hpp>
9190

92-
%include <AvTranscoder/essenceStructures/Pixel.hpp>
93-
%include <AvTranscoder/essenceStructures/Frame.hpp>
94-
%include <AvTranscoder/essenceStructures/VideoFrame.hpp>
95-
%include <AvTranscoder/essenceStructures/AudioFrame.hpp>
96-
97-
%include <AvTranscoder/codedStructures/CodedDesc.hpp>
98-
%include <AvTranscoder/codedStructures/VideoDesc.hpp>
99-
%include <AvTranscoder/codedStructures/AudioDesc.hpp>
100-
%include <AvTranscoder/codedStructures/DataDesc.hpp>
101-
%include <AvTranscoder/codedStructures/DataStream.hpp>
91+
%include <AvTranscoder/frame/Pixel.hpp>
92+
%include <AvTranscoder/frame/Frame.hpp>
93+
%include <AvTranscoder/frame/VideoFrame.hpp>
94+
%include <AvTranscoder/frame/AudioFrame.hpp>
10295

96+
%include <AvTranscoder/codec/ICodec.hpp>
97+
%include <AvTranscoder/codec/VideoCodec.hpp>
98+
%include <AvTranscoder/codec/AudioCodec.hpp>
99+
%include <AvTranscoder/codec/DataCodec.hpp>
103100

104101
%include <AvTranscoder/mediaProperty/mediaProperty.hpp>
105102

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