| 
    AvTranscoder
    0.9.4
    
   C++APIforLibav/FFmpeg 
   | 
 
Outputfile is the default implentation of wrapper which uses LibAV/FFMpeg. More...
#include <OutputFile.hpp>
Public Member Functions | |
| OutputFile (const std::string &filename, const std::string &formatName="", const std::string &mimeType="") | |
| Create an output media file.  More... | |
| ~OutputFile () | |
| IOutputStream & | addVideoStream (const VideoCodec &videoDesc) | 
| Add a video output stream.  More... | |
| IOutputStream & | addAudioStream (const AudioCodec &audioDesc) | 
| Add an audio output stream.  More... | |
| IOutputStream & | addDataStream (const DataCodec &dataDesc) | 
| Add a data output stream.  More... | |
| bool | beginWrap () | 
| Open ressource, write header, and setup specific wrapping options given when call setupWrapping.  More... | |
| IOutputStream::EWrappingStatus | wrap (const CodedData &data, const size_t streamIndex) | 
| Wrap a packet of data in the output ressource.  More... | |
| bool | endWrap () | 
| Close ressource and write trailer.  More... | |
| void | addMetadata (const PropertyVector &data) | 
| Add metadata to the output file.  More... | |
| void | addMetadata (const std::string &key, const std::string &value) | 
| IOutputStream & | getStream (const size_t streamIndex) | 
| Get the output stream.  More... | |
| std::string | getFilename () const | 
| std::string | getFormatName () const | 
| A comma separated list of short names for the format, or empty if unknown.  More... | |
| std::string | getFormatLongName () const | 
| Descriptive name for the format, meant to be more human-readable than name, or empty if unknown.  More... | |
| std::string | getFormatMimeType () const | 
| Comma-separated list of mime types, or empty if unknown.  More... | |
| FormatContext & | getFormatContext () | 
| void | setupWrapping (const ProfileLoader::Profile &profile) | 
| Set the format and the generic options of the output file.  More... | |
  Public Member Functions inherited from avtranscoder::IOutputFile | |
| virtual | ~IOutputFile () | 
Private Member Functions | |
| OutputFile (const OutputFile &outputFile) | |
| OutputFile & | operator= (const OutputFile &outputFile) | 
| void | setupWrappingOptions (const ProfileLoader::Profile &profile) | 
| void | setupRemainingWrappingOptions () | 
Private Attributes | |
| FormatContext | _formatContext | 
| std::vector< OutputStream * > | _outputStreams | 
| Has ownership.  More... | |
| std::vector< size_t > | _frameCount | 
| Number of wrapped frames.  More... | |
| double | _previousProcessedStreamDuration | 
| To manage process streams order.  More... | |
| ProfileLoader::Profile | _profile | 
| To setup specific wrapping options.  More... | |
Outputfile is the default implentation of wrapper which uses LibAV/FFMpeg.
Definition at line 17 of file OutputFile.hpp.
      
  | 
  private | 
| avtranscoder::OutputFile::OutputFile | ( | const std::string & | filename, | 
| const std::string & | formatName = "",  | 
        ||
| const std::string & | mimeType = ""  | 
        ||
| ) | 
Create an output media file.
| filename | resource to access | 
| formatName | should matches with the names of the registered formats | 
| mimeType | should matches with the MIME type of the registered formats | 
Definition at line 14 of file OutputFile.cpp.
References _formatContext, avtranscoder::FormatContext::setFilename(), and avtranscoder::FormatContext::setOutputFormat().
| avtranscoder::OutputFile::~OutputFile | ( | ) | 
Definition at line 25 of file OutputFile.cpp.
References _outputStreams.
      
  | 
  virtual | 
Add an audio output stream.
| audioCodec | description of output stream | 
Reimplemented from avtranscoder::IOutputFile.
Definition at line 68 of file OutputFile.cpp.
References _formatContext, _outputStreams, avtranscoder::FormatContext::addAVStream(), avtranscoder::ICodec::getAVCodec(), avtranscoder::ICodec::getAVCodecContext(), and avtranscoder::FormatContext::getNbStreams().
      
  | 
  virtual | 
Add a data output stream.
| dataCodec | description of output stream | 
Reimplemented from avtranscoder::IOutputFile.
Definition at line 88 of file OutputFile.cpp.
References _formatContext, _outputStreams, avtranscoder::FormatContext::addAVStream(), avtranscoder::ICodec::getAVCodec(), and avtranscoder::FormatContext::getNbStreams().
| void avtranscoder::OutputFile::addMetadata | ( | const PropertyVector & | data | ) | 
Add metadata to the output file.
Definition at line 239 of file OutputFile.cpp.
| void avtranscoder::OutputFile::addMetadata | ( | const std::string & | key, | 
| const std::string & | value | ||
| ) | 
Definition at line 247 of file OutputFile.cpp.
References _formatContext, and avtranscoder::FormatContext::addMetaData().
      
  | 
  virtual | 
Add a video output stream.
| videoCodec | description of output stream | 
Reimplemented from avtranscoder::IOutputFile.
Definition at line 33 of file OutputFile.cpp.
References _formatContext, _outputStreams, avtranscoder::FormatContext::addAVStream(), FF_INPUT_BUFFER_PADDING_SIZE, avtranscoder::ICodec::getAVCodec(), avtranscoder::ICodec::getAVCodecContext(), and avtranscoder::FormatContext::getNbStreams().
      
  | 
  virtual | 
Open ressource, write header, and setup specific wrapping options given when call setupWrapping.
Implements avtranscoder::IOutputFile.
Definition at line 150 of file OutputFile.cpp.
References _formatContext, _frameCount, _outputStreams, getFilename(), LOG_DEBUG, avtranscoder::FormatContext::openRessource(), setupRemainingWrappingOptions(), and avtranscoder::FormatContext::writeHeader().
      
  | 
  virtual | 
Close ressource and write trailer.
Implements avtranscoder::IOutputFile.
Definition at line 230 of file OutputFile.cpp.
References _formatContext, avtranscoder::FormatContext::closeRessource(), LOG_DEBUG, and avtranscoder::FormatContext::writeTrailer().
| std::string avtranscoder::OutputFile::getFilename | ( | ) | const | 
Definition at line 115 of file OutputFile.cpp.
References _formatContext, and avtranscoder::FormatContext::getAVFormatContext().
Referenced by beginWrap(), getFormatLongName(), getFormatMimeType(), getFormatName(), getStream(), and setupWrapping().
      
  | 
  inline | 
Definition at line 81 of file OutputFile.hpp.
| std::string avtranscoder::OutputFile::getFormatLongName | ( | ) | const | 
Descriptive name for the format, meant to be more human-readable than name, or empty if unknown.
Definition at line 130 of file OutputFile.cpp.
References _formatContext, avtranscoder::FormatContext::getAVOutputFormat(), getFilename(), and LOG_WARN.
| std::string avtranscoder::OutputFile::getFormatMimeType | ( | ) | const | 
Comma-separated list of mime types, or empty if unknown.
Definition at line 140 of file OutputFile.cpp.
References _formatContext, avtranscoder::FormatContext::getAVOutputFormat(), getFilename(), and LOG_WARN.
| std::string avtranscoder::OutputFile::getFormatName | ( | ) | const | 
A comma separated list of short names for the format, or empty if unknown.
Definition at line 120 of file OutputFile.cpp.
References _formatContext, avtranscoder::FormatContext::getAVOutputFormat(), getFilename(), and LOG_WARN.
      
  | 
  virtual | 
Get the output stream.
| streamIndex | select the output stream | 
Implements avtranscoder::IOutputFile.
Definition at line 98 of file OutputFile.cpp.
References _outputStreams, and getFilename().
      
  | 
  private | 
      
  | 
  private | 
Definition at line 302 of file OutputFile.cpp.
References _formatContext, _profile, avtranscoder::constants::avProfileFormat, avtranscoder::constants::avProfileIdentificator, avtranscoder::constants::avProfileIdentificatorHuman, avtranscoder::constants::avProfileType, avtranscoder::FormatContext::getOption(), LOG_WARN, and avtranscoder::Option::setString().
Referenced by beginWrap().
| void avtranscoder::OutputFile::setupWrapping | ( | const ProfileLoader::Profile & | profile | ) | 
Set the format and the generic options of the output file.
| profile | the profile of the output format | 
Definition at line 252 of file OutputFile.cpp.
References _formatContext, avtranscoder::constants::avProfileFormat, avtranscoder::ProfileLoader::checkFormatProfile(), getFilename(), LOG_ERROR, LOG_INFO, avtranscoder::FormatContext::setOutputFormat(), and setupWrappingOptions().
      
  | 
  private | 
Definition at line 280 of file OutputFile.cpp.
References _formatContext, _profile, avtranscoder::constants::avProfileFormat, avtranscoder::constants::avProfileIdentificator, avtranscoder::constants::avProfileIdentificatorHuman, avtranscoder::constants::avProfileType, avtranscoder::FormatContext::getOption(), LOG_INFO, and avtranscoder::Option::setString().
Referenced by setupWrapping().
      
  | 
  virtual | 
Wrap a packet of data in the output ressource.
| data | coded packet information for the current stream | 
| streamIndex | refers to the stream in output ressource | 
Implements avtranscoder::IOutputFile.
Definition at line 166 of file OutputFile.cpp.
References _formatContext, _frameCount, _outputStreams, _previousProcessedStreamDuration, avtranscoder::IOutputStream::eWrappingSuccess, avtranscoder::IOutputStream::eWrappingWaitingForData, avtranscoder::CodedData::getAVPacket(), avtranscoder::CodedData::getAVStream(), avtranscoder::FormatContext::getAVStream(), avtranscoder::CodedData::getData(), avtranscoder::CodedData::getSize(), LOG_DEBUG, and avtranscoder::FormatContext::writeFrame().
Referenced by avtranscoder::OutputStream::wrap().
      
  | 
  private | 
Definition at line 102 of file OutputFile.hpp.
Referenced by addAudioStream(), addDataStream(), addMetadata(), addVideoStream(), beginWrap(), endWrap(), getFilename(), getFormatLongName(), getFormatMimeType(), getFormatName(), OutputFile(), setupRemainingWrappingOptions(), setupWrapping(), setupWrappingOptions(), and wrap().
      
  | 
  private | 
Number of wrapped frames.
Definition at line 104 of file OutputFile.hpp.
Referenced by beginWrap(), and wrap().
      
  | 
  private | 
Has ownership.
Definition at line 103 of file OutputFile.hpp.
Referenced by addAudioStream(), addDataStream(), addVideoStream(), beginWrap(), getStream(), wrap(), and ~OutputFile().
      
  | 
  private | 
To manage process streams order.
Definition at line 106 of file OutputFile.hpp.
Referenced by wrap().
      
  | 
  private | 
To setup specific wrapping options.
Definition at line 113 of file OutputFile.hpp.
Referenced by setupRemainingWrappingOptions(), and setupWrappingOptions().