Skip to content

Common naming nomenclature - second step #103

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 59 commits into from
Oct 16, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
a00e114
common: remove Ratio struct
Sep 24, 2014
0292ed4
common: rename ParamSet to Context
Sep 17, 2014
a856992
Option: constructor only need AVOption
Sep 17, 2014
d5fb40d
Option: rename enum OptionType to EOptionBaseType
Sep 17, 2014
6d4cf16
option: can access an option by a context
Sep 26, 2014
9847d50
Rename OptionLoader files to util
Sep 26, 2014
223f602
context: add FormatContext and CodecContext classes
Sep 26, 2014
133aff7
Rename CodedDesc to Codec
Sep 26, 2014
d532d17
ICodec: rename getCodec / getCodecContext to getAVCodec / getAVCodecC…
Sep 26, 2014
1f6f063
ICodec: remove default copy constructor
Sep 26, 2014
565e023
ICodec: remove warning due to forward declaration
Sep 26, 2014
3efcf2c
ICodec: rename setCodec by setEncoderCodec
Sep 26, 2014
23f5f16
context: store an AVFormatContext in FormatContext / an AVCodecContex…
cchampet Oct 3, 2014
43e3f01
optionChecker app: pass a const vector of options to displayOptions
cchampet Oct 3, 2014
3815d86
Merge branch 'master' of https://github.com/avTranscoder/avTranscoder…
Oct 6, 2014
0af9547
EssenceTransform: rename folder/files/classes whithout 'essence'
Oct 6, 2014
aaa0944
essenceStructures: rename folder to frame
Oct 6, 2014
bc363a0
Remove DataStream class
Oct 6, 2014
d57e4f5
AvInputStream: has ownership to a single codec
Oct 6, 2014
312e619
AvInputStream: clean
Oct 6, 2014
2158fa0
Option: fix ffmpeg include for AV_ERROR_MAX_STRING_SIZE
Oct 6, 2014
4ea63a1
Refactore: clean includes and forward declarations
Oct 9, 2014
eab5af0
Refactore: clean __STDC_CONSTANT_MACROS
Oct 9, 2014
fc38ac6
Option: constructor takes a reference of AvOption
Oct 9, 2014
ed0345f
Option: remove getNbChilds function
Oct 9, 2014
7c180d6
Option: rename getChild to getChildAtIndex
Oct 9, 2014
eacd0ed
Option: clean
Oct 9, 2014
18a8759
Merge branch 'master' of https://github.com/avTranscoder/avTranscoder…
Oct 9, 2014
68e08e9
common: add typedef of AVRational to Rational
cchampet Oct 12, 2014
881de92
Option: rename "get default value" and "set value" functions
cchampet Oct 12, 2014
f9e428d
Context: split Context / FormatContext / CodecContext into separate f…
cchampet Oct 12, 2014
89045a0
codec: rename macro at the beginning of headers
cchampet Oct 12, 2014
eb83793
AvOutputStream: remove unnecessary functions
cchampet Oct 12, 2014
5dc073d
codec: update copy constructors
cchampet Oct 12, 2014
fba1268
ICodec: add enum ECodecType to define if it's for encoding or decoding
cchampet Oct 12, 2014
3889d71
ICodec: update exception message in initCodecContext
cchampet Oct 12, 2014
286f602
IOutputEssence: move codec attribute to subclasses
cchampet Oct 12, 2014
75ce1be
ICodec: complete destructor implementation
cchampet Oct 12, 2014
7ad1cc9
ICodec: this class is abstract
cchampet Oct 12, 2014
4425760
AvInputAudio: use AudioCodec
cchampet Oct 12, 2014
a7b4158
AvInputVideo: use VideoCodec
cchampet Oct 12, 2014
492cd38
IInputEssence: add documentation
cchampet Oct 12, 2014
92c5d67
IOutputEssence: clean
cchampet Oct 12, 2014
92bc4ee
AvOuputVideo: clean encodeFrame
cchampet Oct 12, 2014
7cdb5d7
ICodec / CodecContext: fix include for av_free
cchampet Oct 12, 2014
15a606b
ICodec: manage case with codecId 0
Oct 13, 2014
79d010e
AvInputAudio: clean
Oct 13, 2014
e2d5796
App genericProcessor: set verbose to false by default
Oct 13, 2014
e5a8da3
Option: fix setters throw runtime_error
Oct 13, 2014
fa4efa2
ICodec: refactore setDecoderCodec and setEncoderCodec
Oct 16, 2014
302ade8
Clean avcodec_register_all: remove "Warning" comment
Oct 16, 2014
a0ec765
Transcoder: rename argument essenceCodec to codec
Oct 16, 2014
c7d0edb
Transcoder: remove unused _finalisedStreams attribute
Oct 16, 2014
0df22f0
Transcoder: add documentation
Oct 16, 2014
033e5ed
Transcoder: remove local variable in process method
Oct 16, 2014
fb77959
AudioCodec: rename getSampleFormat to getAVSampleFormat
Oct 16, 2014
7de4cbd
AudioFrame: add getSampleFormat to get it as string
Oct 16, 2014
33c4d92
GeneratorAudio: rename _audioDesc to _codec
Oct 16, 2014
c3e46c1
GeneratorVideo: rename _videoDesc to _codec
Oct 16, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions app/avTranscoder/avTranscoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@

#include <AvTranscoder/file/InputFile.hpp>
#include <AvTranscoder/file/OutputFile.hpp>

#include <AvTranscoder/frame/Frame.hpp>

#include <AvTranscoder/essenceStream/AvInputAudio.hpp>
#include <AvTranscoder/essenceStream/AvInputVideo.hpp>
#include <AvTranscoder/essenceStream/AvOutputAudio.hpp>
#include <AvTranscoder/essenceStream/AvOutputVideo.hpp>
#include <AvTranscoder/essenceTransform/VideoEssenceTransform.hpp>

#include <AvTranscoder/transform/VideoTransform.hpp>

#include <AvTranscoder/progress/ConsoleProgress.hpp>

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

// init video decoders
AvInputVideo inputVideo( input.getStream( 0 ) );
VideoFrameDesc VideoFrameDesc = input.getStream( 0 ).getVideoDesc().getVideoFrameDesc();
VideoFrameDesc VideoFrameDesc = input.getStream( 0 ).getVideoCodec().getVideoFrameDesc();
VideoFrame sourceImage( VideoFrameDesc );

// init video encoder
AvOutputVideo outputVideo;
outputVideo.setProfile( profile.getProfile( "xdcamhd422" ), VideoFrameDesc );
VideoFrame imageToEncode( outputVideo.getVideoDesc().getVideoFrameDesc() );
VideoFrame imageToEncode( outputVideo.getVideoCodec().getVideoFrameDesc() );

DataStream codedImage;
CodedData codedImage;

// setup wrapper
//mxftkwrapper::MxftkOutputFile of( outputFilename );
Expand All @@ -49,11 +53,11 @@ void transcodeVideo( const char* inputfilename, const char* outputFilename )
exit( -1 );
}

of.addVideoStream( outputVideo.getVideoDesc() );
of.addVideoStream( outputVideo.getVideoCodec() );

of.beginWrap();

VideoEssenceTransform ct;
VideoTransform ct;


// Encodage/transcodage
Expand Down
8 changes: 4 additions & 4 deletions app/avplay/AvReader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <AvTranscoder/file/InputFile.hpp>
#include <AvTranscoder/essenceStream/AvInputAudio.hpp>
#include <AvTranscoder/essenceStream/AvInputVideo.hpp>
#include <AvTranscoder/essenceTransform/VideoEssenceTransform.hpp>
#include <AvTranscoder/transform/VideoTransform.hpp>
#include <AvTranscoder/mediaProperty/printMediaProperty.hpp>

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

_inputVideo->setup();

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

_pixel.setBitsPerPixel( getComponents() * getBitDepth() );
_pixel.setComponents( getComponents() );
Expand Down Expand Up @@ -80,7 +80,7 @@ class AvReader : public Reader
{
++_currentFrame;
_inputVideo->readNextFrame( *_sourceImage );
_videoEssenceTransform.convert( *_sourceImage, *_imageToDisplay );
_videoTransform.convert( *_sourceImage, *_imageToDisplay );
return (const char*)_imageToDisplay->getPtr();
}

Expand Down Expand Up @@ -114,7 +114,7 @@ class AvReader : public Reader
avtranscoder::Pixel _pixel;
avtranscoder::VideoFrameDesc _videoFrameDescToDisplay;

avtranscoder::VideoEssenceTransform _videoEssenceTransform;
avtranscoder::VideoTransform _videoTransform;
size_t _videoStream;
};

Expand Down
11 changes: 5 additions & 6 deletions app/genericProcessor/genericProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ static const std::string dummyPixelFormat = "yuv420p";
static const std::string dummyVideoCodec = "mpeg2video";
static const std::string dummyAudioCodec = "pcm_s16le";

// bool verbose = false;
bool verbose = true;
bool verbose = false;

void parseConfigFile( const std::string& configFilename, avtranscoder::Transcoder& transcoder, avtranscoder::Profile& profile )
{
Expand Down Expand Up @@ -55,7 +54,7 @@ void parseConfigFile( const std::string& configFilename, avtranscoder::Transcode
std::cout << std::endl;
}

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

avtranscoder::VideoDesc inputVideoDesc( dummyVideoCodec );
inputVideoDesc.setImageParameters( imageDesc );
avtranscoder::VideoCodec inputVideoCodec( avtranscoder::eCodecTypeEncoder, dummyVideoCodec );
inputVideoCodec.setImageParameters( imageDesc );

transcoder.add( filename, streamIndex, subStreamIndex, transcodeProfile, inputVideoDesc );
transcoder.add( filename, streamIndex, subStreamIndex, transcodeProfile, inputVideoCodec );
}
else
{
Expand Down
96 changes: 57 additions & 39 deletions app/optionChecker/optionChecker.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
#include <AvTranscoder/option/OptionLoader.hpp>
#include <AvTranscoder/util.hpp>
#include <AvTranscoder/option/Context.hpp>
#include <AvTranscoder/option/CodecContext.hpp>
#include <AvTranscoder/option/Option.hpp>
#include <AvTranscoder/file/InputFile.hpp>

#include <string>
#include <iostream>
#include <map>
#include <vector>
#include <utility> //pair
#include <utility>

void displayOptions( avtranscoder::OptionLoader::OptionArray& options )
void displayOptions( const std::vector<avtranscoder::Option>& options )
{
for( auto option : options )
{
Expand All @@ -20,74 +23,89 @@ void displayOptions( avtranscoder::OptionLoader::OptionArray& options )

// get default value

if( option.getType() == avtranscoder::TypeInt )
if( option.getType() == avtranscoder::eOptionBaseTypeInt )
{
std::cout << "DefaultValue: " << option.getDefaultValueInt() << std::endl;
std::cout << "DefaultValue: " << option.getDefaultInt() << std::endl;
}
else if( option.getType() == avtranscoder::TypeBool )
else if( option.getType() == avtranscoder::eOptionBaseTypeBool )
{
std::cout << "DefaultValue: " << option.getDefaultValueBool() << std::endl;
std::cout << "DefaultValue: " << option.getDefaultBool() << std::endl;
}
else if( option.getType() == avtranscoder::TypeDouble )
else if( option.getType() == avtranscoder::eOptionBaseTypeDouble )
{
std::cout << "DefaultValue: " << option.getDefaultValueDouble() << std::endl;
std::cout << "DefaultValue: " << option.getDefaultDouble() << std::endl;
}
else if( option.getType() == avtranscoder::TypeRatio )
else if( option.getType() == avtranscoder::eOptionBaseTypeRatio )
{
std::cout << "DefaultValue: " << option.getDefaultValueRatio().first << ", " << option.getDefaultValueRatio().second << std::endl;
std::cout << "DefaultValue: " << option.getDefaultRatio().first << ", " << option.getDefaultRatio().second << std::endl;
}
else if( option.getType() == avtranscoder::TypeString )
else if( option.getType() == avtranscoder::eOptionBaseTypeString )
{
std::cout << "DefaultValue: " << option.getDefaultValueString() << std::endl;
std::cout << "DefaultValue: " << option.getDefaultString() << std::endl;
}
else if( option.getType() == avtranscoder::TypeChoice )
else if( option.getType() == avtranscoder::eOptionBaseTypeChoice )
{
std::cout << "Nb choices: " << option.getNbChilds() << std::endl;
std::cout << "Nb choices: " << option.getChilds().size() << std::endl;
std::cout << "Default choice index: " << option.getDefaultChildIndex() << std::endl;
for(size_t i = 0; i < option.getNbChilds(); ++i )
for(size_t i = 0; i < option.getChilds().size(); ++i )
std::cout << "Choice " << i << ": " <<
option.getChild( i ).getName() << " // " <<
option.getChild( i ).getHelp() << std::endl;
option.getChildAtIndex( i ).getName() << " // " <<
option.getChildAtIndex( i ).getHelp() << std::endl;
}
else if( option.getType() == avtranscoder::TypeGroup )
else if( option.getType() == avtranscoder::eOptionBaseTypeGroup )
{
std::cout << "Nb choices: " << option.getNbChilds() << std::endl;
for(size_t i = 0; i < option.getNbChilds(); ++i )
std::cout << "Nb choices: " << option.getChilds().size() << std::endl;
for(size_t i = 0; i < option.getChilds().size(); ++i )
std::cout << "Element " << i << ": " <<
option.getChild( i ).getName() << " // " <<
option.getChild( i ).getDefaultValueBool() << std::endl;
option.getChildAtIndex( i ).getName() << " // " <<
option.getChildAtIndex( i ).getDefaultBool() << std::endl;
}
}
}

void optionChecker( const std::string& inputfilename )
{
avtranscoder::OptionLoader optionLoader;

//avtranscoder::OptionLoader::OptionArray optionsArray = optionLoader.loadOptions( AV_OPT_FLAG_AUDIO_PARAM );
avtranscoder::OptionLoader::OptionMap optionsMap = optionLoader.loadOutputFormatOptions();

//displayOptions( optionsArray );
for( avtranscoder::OptionLoader::OptionMap::iterator it = optionsMap.begin();
it != optionsMap.end();
++it )
{
std::cout << "----- " << it->first << " -----" << std::endl;
displayOptions( it->second );
}
{
avtranscoder::InputFile file( inputfilename );

// format options
avtranscoder::Context formatContext( &file.getFormatContext() );
std::vector<avtranscoder::Option> formatOptions = formatContext.getOptions();
displayOptions( formatOptions );

// codec options
avtranscoder::CodecContext codecContext( AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM );
std::vector<avtranscoder::Option> codecOptions = codecContext.getOptions();
displayOptions( codecOptions );

// pixel formats
// std::vector<std::string> pixelFormats = avtranscoder::getPixelFormats();
// for( size_t i = 0; i < pixelFormats.size(); ++i )
// {
// std::cout << "----- " << pixelFormats[i] << " -----" << std::endl;
// }

// options per format
// std::map< std::string, std::vector<avtranscoder::Option> > optionsPerFormat = avtranscoder::getOutputFormatOptions();
// for( std::map< std::string, std::vector<avtranscoder::Option> >::iterator it = optionsPerFormat.begin();
// it != optionsPerFormat.end();
// ++it )
// {
// std::cout << "----- " << it->first << " -----" << std::endl;
// displayOptions( it->second );
// }
}

int main( int argc, char** argv )
{
std::cout << "start ..." << std::endl;

if( argc <= 1 )
{
std::cout << "audiorewrapper require a media filename" << std::endl;
std::cout << "example: audioWrap file.ext" << std::endl;
return( -1 );
}

std::cout << "start ..." << std::endl;

try
{
optionChecker( argv[1] );
Expand Down
4 changes: 2 additions & 2 deletions app/presetChecker/presetChecker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ int main( int argc, char** argv )
if( profile.find( avtranscoder::Profile::avProfileType )->second == avtranscoder::Profile::avProfileTypeVideo )
{
avtranscoder::AvOutputVideo outputVideo;
outputVideo.setProfile( profile, outputVideo.getVideoDesc().getVideoFrameDesc() );
outputVideo.setProfile( profile, outputVideo.getVideoCodec().getVideoFrameDesc() );
}

if( profile.find( avtranscoder::Profile::avProfileType )->second == avtranscoder::Profile::avProfileTypeAudio )
{
avtranscoder::AvOutputAudio outputAudio;
outputAudio.setProfile( profile, outputAudio.getAudioDesc().getFrameDesc() );
outputAudio.setProfile( profile, outputAudio.getAudioCodec().getFrameDesc() );
}
}
catch( ... )
Expand Down
3 changes: 0 additions & 3 deletions src/AvTranscoder/Library.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#include "Library.hpp"

extern "C" {
#ifndef __STDC_CONSTANT_MACROS
#define __STDC_CONSTANT_MACROS
#endif
#include <libavutil/version.h>
#include <libavcodec/version.h>
#include <libswscale/version.h>
Expand Down
4 changes: 2 additions & 2 deletions src/AvTranscoder/Library.hpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#ifndef _AV_TRANSCODER_DESCRIPTION_HPP_
#define _AV_TRANSCODER_DESCRIPTION_HPP_

#include "common.hpp"

#include <vector>
#include <string>

#include "common.hpp"

namespace avtranscoder
{

Expand Down
35 changes: 16 additions & 19 deletions src/AvTranscoder/avTranscoder.i
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,15 @@

#include <AvTranscoder/Profile.hpp>

#include <AvTranscoder/essenceStructures/Pixel.hpp>
#include <AvTranscoder/essenceStructures/Frame.hpp>
#include <AvTranscoder/essenceStructures/VideoFrame.hpp>
#include <AvTranscoder/essenceStructures/AudioFrame.hpp>
#include <AvTranscoder/frame/Pixel.hpp>
#include <AvTranscoder/frame/Frame.hpp>
#include <AvTranscoder/frame/VideoFrame.hpp>
#include <AvTranscoder/frame/AudioFrame.hpp>

#include <AvTranscoder/codedStructures/CodedDesc.hpp>
#include <AvTranscoder/codedStructures/VideoDesc.hpp>
#include <AvTranscoder/codedStructures/AudioDesc.hpp>
#include <AvTranscoder/codedStructures/DataDesc.hpp>
#include <AvTranscoder/codedStructures/DataStream.hpp>
#include <AvTranscoder/codec/ICodec.hpp>
#include <AvTranscoder/codec/VideoCodec.hpp>
#include <AvTranscoder/codec/AudioCodec.hpp>
#include <AvTranscoder/codec/DataCodec.hpp>

#include <AvTranscoder/mediaProperty/mediaProperty.hpp>

Expand Down Expand Up @@ -89,17 +88,15 @@ namespace std {

%include <AvTranscoder/Profile.hpp>

%include <AvTranscoder/essenceStructures/Pixel.hpp>
%include <AvTranscoder/essenceStructures/Frame.hpp>
%include <AvTranscoder/essenceStructures/VideoFrame.hpp>
%include <AvTranscoder/essenceStructures/AudioFrame.hpp>

%include <AvTranscoder/codedStructures/CodedDesc.hpp>
%include <AvTranscoder/codedStructures/VideoDesc.hpp>
%include <AvTranscoder/codedStructures/AudioDesc.hpp>
%include <AvTranscoder/codedStructures/DataDesc.hpp>
%include <AvTranscoder/codedStructures/DataStream.hpp>
%include <AvTranscoder/frame/Pixel.hpp>
%include <AvTranscoder/frame/Frame.hpp>
%include <AvTranscoder/frame/VideoFrame.hpp>
%include <AvTranscoder/frame/AudioFrame.hpp>

%include <AvTranscoder/codec/ICodec.hpp>
%include <AvTranscoder/codec/VideoCodec.hpp>
%include <AvTranscoder/codec/AudioCodec.hpp>
%include <AvTranscoder/codec/DataCodec.hpp>

%include <AvTranscoder/mediaProperty/mediaProperty.hpp>

Expand Down
Loading