AvTranscoder
0.9.4
C++APIforLibav/FFmpeg
|
Wrapper of AVOption. Get its type to know what the option is about: Int, Double, Ratio, Choice... Parse its array of options to get the potential childs (Choice and Group). More...
#include <Option.hpp>
Public Member Functions | |
Option (AVOption &avOption, void *avContext) | |
~Option () | |
EOptionBaseType | getType () const |
std::string | getName () const |
std::string | getHelp () const |
std::string | getUnit () const |
int | getOffset () const |
double | getMin () const |
double | getMax () const |
int | getFlags () const |
bool | isEncodingOpt () const |
bool | isDecodingOpt () const |
bool | isAudioOpt () const |
bool | isVideoOpt () const |
bool | isSubtitleOpt () const |
bool | getDefaultBool () const |
int | getDefaultInt () const |
double | getDefaultDouble () const |
std::string | getDefaultString () const |
std::pair< int, int > | getDefaultRatio () const |
bool | getBool () const |
int | getInt () const |
double | getDouble () const |
std::string | getString () const |
std::pair< int, int > | getRatio () const |
void | setFlag (const std::string &flag, const bool enable) |
void | setBool (const bool value) |
void | setInt (const int value) |
void | setDouble (const double value) |
void | setString (const std::string &value) |
void | setRatio (const int num, const int den) |
bool | hasChild () const |
const std::vector< Option > & | getChilds () const |
const Option & | getChildAtIndex (const size_t index) const |
int | getDefaultChildIndex () const |
void | setDefaultChildIndex (size_t index) |
void | appendChild (const Option &child) |
Private Member Functions | |
EOptionBaseType | getTypeFromAVOption (const std::string &unit, const AVOptionType avType) |
void | checkFFmpegGetOption (const int ffmpegReturnCode) const |
Check the return value from FFmpeg functions. More... | |
void | checkFFmpegSetOption (const int ffmpegReturnCode, const std::string &optionValue) |
Private Attributes | |
AVOption * | _avOption |
Has link (no ownership) More... | |
EOptionBaseType | _type |
void * | _avContext |
Pointer to the corresponding context. Need it to set and get the option values. More... | |
std::vector< Option > | _childOptions |
size_t | _defaultChildIndex |
Wrapper of AVOption. Get its type to know what the option is about: Int, Double, Ratio, Choice... Parse its array of options to get the potential childs (Choice and Group).
Definition at line 36 of file Option.hpp.
avtranscoder::Option::Option | ( | AVOption & | avOption, |
void * | avContext | ||
) |
Definition at line 14 of file Option.cpp.
References _avOption, _type, getTypeFromAVOption(), and getUnit().
|
inline |
Definition at line 40 of file Option.hpp.
void avtranscoder::Option::appendChild | ( | const Option & | child | ) |
Definition at line 205 of file Option.cpp.
References _childOptions.
Referenced by avtranscoder::loadOptions().
|
private |
Check the return value from FFmpeg functions.
Definition at line 210 of file Option.cpp.
References avtranscoder::getDescriptionFromErrorCode(), and getName().
Referenced by getBool(), getDouble(), getInt(), getRatio(), getString(), and setFlag().
|
private |
Definition at line 218 of file Option.cpp.
References avtranscoder::getDescriptionFromErrorCode(), and getName().
Referenced by setBool(), setDouble(), setFlag(), setInt(), setRatio(), and setString().
bool avtranscoder::Option::getBool | ( | ) | const |
Definition at line 95 of file Option.cpp.
References _avContext, checkFFmpegGetOption(), and getName().
|
inline |
Definition at line 84 of file Option.hpp.
|
inline |
Definition at line 83 of file Option.hpp.
Referenced by avtranscoder::loadOptions().
bool avtranscoder::Option::getDefaultBool | ( | ) | const |
Definition at line 70 of file Option.cpp.
References _avOption.
|
inline |
Definition at line 85 of file Option.hpp.
double avtranscoder::Option::getDefaultDouble | ( | ) | const |
Definition at line 80 of file Option.cpp.
References _avOption.
int avtranscoder::Option::getDefaultInt | ( | ) | const |
Definition at line 75 of file Option.cpp.
References _avOption.
Referenced by avtranscoder::loadOptions().
std::pair< int, int > avtranscoder::Option::getDefaultRatio | ( | ) | const |
Definition at line 90 of file Option.cpp.
References _avOption.
std::string avtranscoder::Option::getDefaultString | ( | ) | const |
Definition at line 85 of file Option.cpp.
References _avOption.
double avtranscoder::Option::getDouble | ( | ) | const |
Definition at line 113 of file Option.cpp.
References _avContext, checkFFmpegGetOption(), and getName().
|
inline |
Definition at line 52 of file Option.hpp.
|
inline |
Definition at line 45 of file Option.hpp.
int avtranscoder::Option::getInt | ( | ) | const |
Definition at line 104 of file Option.cpp.
References _avContext, checkFFmpegGetOption(), and getName().
|
inline |
Definition at line 49 of file Option.hpp.
|
inline |
Definition at line 48 of file Option.hpp.
|
inline |
Definition at line 44 of file Option.hpp.
Referenced by checkFFmpegGetOption(), checkFFmpegSetOption(), getBool(), getDouble(), getInt(), getRatio(), getString(), avtranscoder::loadOptions(), setBool(), setDouble(), setFlag(), setInt(), setRatio(), and setString().
|
inline |
Definition at line 47 of file Option.hpp.
std::pair< int, int > avtranscoder::Option::getRatio | ( | ) | const |
Definition at line 136 of file Option.cpp.
References _avContext, checkFFmpegGetOption(), and getName().
std::string avtranscoder::Option::getString | ( | ) | const |
Definition at line 122 of file Option.cpp.
References _avContext, checkFFmpegGetOption(), and getName().
EOptionBaseType avtranscoder::Option::getType | ( | ) | const |
Definition at line 65 of file Option.cpp.
References _type.
Referenced by avtranscoder::loadOptions().
|
private |
Definition at line 23 of file Option.cpp.
References avtranscoder::eOptionBaseTypeBool, avtranscoder::eOptionBaseTypeChild, avtranscoder::eOptionBaseTypeChoice, avtranscoder::eOptionBaseTypeDouble, avtranscoder::eOptionBaseTypeGroup, avtranscoder::eOptionBaseTypeInt, avtranscoder::eOptionBaseTypeRatio, avtranscoder::eOptionBaseTypeString, and avtranscoder::eOptionBaseTypeUnknown.
Referenced by Option().
|
inline |
Definition at line 46 of file Option.hpp.
Referenced by avtranscoder::loadOptions(), and Option().
|
inline |
Definition at line 82 of file Option.hpp.
|
inline |
Definition at line 55 of file Option.hpp.
|
inline |
Definition at line 54 of file Option.hpp.
|
inline |
Definition at line 53 of file Option.hpp.
|
inline |
Definition at line 57 of file Option.hpp.
|
inline |
Definition at line 56 of file Option.hpp.
void avtranscoder::Option::setBool | ( | const bool | value | ) |
Definition at line 160 of file Option.cpp.
References _avContext, checkFFmpegSetOption(), and getName().
|
inline |
Definition at line 87 of file Option.hpp.
Referenced by avtranscoder::loadOptions().
void avtranscoder::Option::setDouble | ( | const double | value | ) |
Definition at line 178 of file Option.cpp.
References _avContext, checkFFmpegSetOption(), and getName().
void avtranscoder::Option::setFlag | ( | const std::string & | flag, |
const bool | enable | ||
) |
Definition at line 145 of file Option.cpp.
References _avContext, _avOption, checkFFmpegGetOption(), checkFFmpegSetOption(), and getName().
void avtranscoder::Option::setInt | ( | const int | value | ) |
Definition at line 169 of file Option.cpp.
References _avContext, checkFFmpegSetOption(), and getName().
Referenced by avtranscoder::AudioDecoder::setupDecoder(), avtranscoder::VideoDecoder::setupDecoder(), avtranscoder::AudioEncoder::setupEncoder(), and avtranscoder::VideoEncoder::setupEncoder().
void avtranscoder::Option::setRatio | ( | const int | num, |
const int | den | ||
) |
Definition at line 193 of file Option.cpp.
References _avContext, checkFFmpegSetOption(), and getName().
void avtranscoder::Option::setString | ( | const std::string & | value | ) |
Definition at line 187 of file Option.cpp.
References _avContext, checkFFmpegSetOption(), and getName().
Referenced by avtranscoder::AudioDecoder::setupDecoder(), avtranscoder::VideoDecoder::setupDecoder(), avtranscoder::VideoEncoder::setupEncoder(), avtranscoder::AudioEncoder::setupEncoder(), avtranscoder::OutputFile::setupRemainingWrappingOptions(), avtranscoder::InputFile::setupUnwrapping(), and avtranscoder::OutputFile::setupWrappingOptions().
|
private |
Pointer to the corresponding context. Need it to set and get the option values.
Has link (no ownership)
Definition at line 108 of file Option.hpp.
Referenced by getBool(), getDouble(), getInt(), getRatio(), getString(), setBool(), setDouble(), setFlag(), setInt(), setRatio(), and setString().
|
private |
Has link (no ownership)
Definition at line 101 of file Option.hpp.
Referenced by getDefaultBool(), getDefaultDouble(), getDefaultInt(), getDefaultRatio(), getDefaultString(), Option(), and setFlag().
|
private |
If the option corresponds to a Choice or a Group, it can contain childs, which are also options.
Definition at line 114 of file Option.hpp.
Referenced by appendChild().
|
private |
Definition at line 115 of file Option.hpp.
|
private |
Definition at line 102 of file Option.hpp.