TuttleOFX
1
|
#include <LibAVVideoWriter.hpp>
Public Member Functions | |
LibAVVideoWriter () | |
bool | movie () const |
int | start () |
bool | finishInit () |
int | execute (boost::uint8_t *const in_buffer, const int in_width, const int height, const PixelFormat in_fmt=PIX_FMT_RGB24) |
void | finish () |
void | setFilename (const std::string &filename) |
std::string | getFilename () const |
void | setWidth (const int width) |
int | getWidth () const |
void | setHeight (const int height) |
int | getHeight () const |
void | setAspectRatio (const double aspectRatio) |
double | getAspectRatio () const |
void | setFps (const double fps) |
double | getFps () const |
void | setPixelFormat (const PixelFormat pxlFmt) |
PixelFormat | getPixelFormat () const |
const std::string & | getFormat () const |
const std::vector< std::string > & | getFormatsShort () const |
const std::vector< std::string > & | getFormatsLong () const |
void | setFormat (const unsigned int id) |
void | setFormat (const std::string &format) |
const std::string & | getVideoCodec () const |
const std::vector< std::string > & | getVideoCodecsShort () const |
const std::vector< std::string > & | getVideoCodecsLong () const |
const std::string & | getAudioCodec () const |
const std::vector< std::string > & | getAudioCodecsShort () const |
const std::vector< std::string > & | getAudioCodecsLong () const |
const std::vector< AVPrivOption > & | getFormatPrivOpts () const |
const std::vector< AVPrivOption > & | getVideoCodecPrivOpts () const |
const std::vector< AVPrivOption > & | getAudioCodecPrivOpts () const |
void | setVideoCodec (const unsigned int id) |
void | setVideoCodec (const std::string &codec) |
void | setAudioCodec (const unsigned int id) |
void | setAudioCodec (const std::string &codec) |
void | configureFromRead (const LibAVVideoReader &reader) |
Data Fields | |
AVFormatContext * | _avFormatOptions |
AVStream * | _stream |
Private Types | |
enum | EWriterStatus { eWriterStatusSuccess = 0, eWriterStatusIgnoreFinish, eWriterStatusCleanup } |
Private Member Functions | |
void | freeFormat () |
std::string | getErrorStr (const int errnum) const |
Private Attributes | |
AVCodecContext * | _avVideoOptions |
AVCodecContext * | _avAudioOptions |
struct SwsContext * | _sws_context |
swscale: transformation context | |
AVCodec * | _videoCodec |
AVCodec * | _audioCodec |
AVOutputFormat * | _ofmt |
std::vector< AVPrivOption > | _formatPrivOpts |
std::vector< AVPrivOption > | _videoCodecPrivOpts |
std::vector< AVPrivOption > | _audioCodecPrivOpts |
std::vector< std::string > | _formatsLongNames |
std::vector< std::string > | _formatsShortNames |
std::vector< std::string > | _videoCodecsLongNames |
std::vector< std::string > | _videoCodecsShortNames |
std::vector< std::string > | _audioCodecsLongNames |
std::vector< std::string > | _audioCodecsShortNames |
EWriterStatus | _statusCode |
int | _hasFrame |
std::string | _filename |
int | _width |
int | _height |
double | _aspectRatio |
PixelFormat | _out_pixelFormat |
double | _fps |
std::string | _formatName |
std::string | _videoCodecName |
std::string | _audioCodecName |
Definition at line 19 of file LibAVVideoWriter.hpp.
enum tuttle::plugin::av::LibAVVideoWriter::EWriterStatus [private] |
Definition at line 22 of file LibAVVideoWriter.hpp.
tuttle::plugin::av::LibAVVideoWriter::LibAVVideoWriter | ( | ) | [explicit] |
Definition at line 28 of file LibAVVideoWriter.cpp.
References _audioCodecPrivOpts, _audioCodecsLongNames, _audioCodecsShortNames, _formatPrivOpts, _formatsLongNames, _formatsShortNames, _videoCodecPrivOpts, _videoCodecsLongNames, _videoCodecsShortNames, tuttle::plugin::av::AVPrivOption::class_name, and tuttle::plugin::av::AVPrivOption::o.
void tuttle::plugin::av::LibAVVideoWriter::configureFromRead | ( | const LibAVVideoReader & | reader | ) | [inline] |
Definition at line 197 of file LibAVVideoWriter.hpp.
References tuttle::plugin::av::LibAVVideoReader::aspectRatio(), tuttle::plugin::av::LibAVVideoReader::codecName(), tuttle::plugin::av::LibAVVideoReader::formatName(), tuttle::plugin::av::LibAVVideoReader::fps(), tuttle::plugin::av::LibAVVideoReader::height(), setAspectRatio(), setFormat(), setFps(), setHeight(), setVideoCodec(), setWidth(), and tuttle::plugin::av::LibAVVideoReader::width().
int tuttle::plugin::av::LibAVVideoWriter::execute | ( | boost::uint8_t *const | in_buffer, |
const int | in_width, | ||
const int | height, | ||
const PixelFormat | in_fmt = PIX_FMT_RGB24 |
||
) |
Definition at line 311 of file LibAVVideoWriter.cpp.
References _avFormatOptions, _hasFrame, _out_pixelFormat, _statusCode, _stream, _sws_context, OFX::Log::error(), eWriterStatusCleanup, eWriterStatusIgnoreFinish, eWriterStatusSuccess, getErrorStr(), getHeight(), getWidth(), tuttle::plugin::av::pts, TUTTLE_LOG_ERROR, TUTTLE_TLOG, and TUTTLE_TRACE.
void tuttle::plugin::av::LibAVVideoWriter::finish | ( | ) |
Definition at line 426 of file LibAVVideoWriter.cpp.
References _avFormatOptions, _hasFrame, _statusCode, _stream, eWriterStatusIgnoreFinish, freeFormat(), getErrorStr(), TUTTLE_LOG_ERROR, TUTTLE_TLOG, and TUTTLE_TRACE.
Referenced by tuttle::plugin::av::writer::AVWriterPlugin::endSequenceRender().
bool tuttle::plugin::av::LibAVVideoWriter::finishInit | ( | ) |
Definition at line 239 of file LibAVVideoWriter.cpp.
References _avFormatOptions, _ofmt, _out_pixelFormat, _stream, _videoCodec, OFX::Log::error(), freeFormat(), getFilename(), tuttle::plugin::av::LibAV::libavError_toString(), and TUTTLE_LOG_ERROR.
Referenced by tuttle::plugin::av::writer::AVWriterPlugin::render().
void tuttle::plugin::av::LibAVVideoWriter::freeFormat | ( | ) | [private] |
Definition at line 472 of file LibAVVideoWriter.cpp.
References _avFormatOptions, and _stream.
Referenced by finish(), and finishInit().
double tuttle::plugin::av::LibAVVideoWriter::getAspectRatio | ( | ) | const [inline] |
Definition at line 82 of file LibAVVideoWriter.hpp.
References _aspectRatio.
const std::string& tuttle::plugin::av::LibAVVideoWriter::getAudioCodec | ( | ) | const [inline] |
Definition at line 147 of file LibAVVideoWriter.hpp.
References _audioCodecName.
const std::vector<AVPrivOption>& tuttle::plugin::av::LibAVVideoWriter::getAudioCodecPrivOpts | ( | ) | const [inline] |
Definition at line 172 of file LibAVVideoWriter.hpp.
References _audioCodecPrivOpts.
Referenced by tuttle::plugin::av::writer::AVWriterPlugin::AVWriterPlugin(), and tuttle::plugin::av::writer::AVWriterPlugin::changedParam().
const std::vector<std::string>& tuttle::plugin::av::LibAVVideoWriter::getAudioCodecsLong | ( | ) | const [inline] |
Definition at line 157 of file LibAVVideoWriter.hpp.
References _audioCodecsLongNames.
const std::vector<std::string>& tuttle::plugin::av::LibAVVideoWriter::getAudioCodecsShort | ( | ) | const [inline] |
Definition at line 152 of file LibAVVideoWriter.hpp.
References _audioCodecsShortNames.
Referenced by tuttle::plugin::av::writer::AVWriterPlugin::AVWriterPlugin(), and tuttle::plugin::av::writer::AVWriterPlugin::changedParam().
std::string tuttle::plugin::av::LibAVVideoWriter::getErrorStr | ( | const int | errnum | ) | const [private] |
Definition at line 303 of file LibAVVideoWriter.cpp.
std::string tuttle::plugin::av::LibAVVideoWriter::getFilename | ( | ) | const [inline] |
Definition at line 52 of file LibAVVideoWriter.hpp.
References _filename.
Referenced by finishInit(), and start().
const std::string& tuttle::plugin::av::LibAVVideoWriter::getFormat | ( | ) | const [inline] |
Definition at line 107 of file LibAVVideoWriter.hpp.
References _formatName.
const std::vector<AVPrivOption>& tuttle::plugin::av::LibAVVideoWriter::getFormatPrivOpts | ( | ) | const [inline] |
Definition at line 162 of file LibAVVideoWriter.hpp.
References _formatPrivOpts.
Referenced by tuttle::plugin::av::writer::AVWriterPlugin::AVWriterPlugin(), tuttle::plugin::av::writer::AVWriterPlugin::changedParam(), and tuttle::plugin::av::writer::AVWriterPlugin::render().
const std::vector<std::string>& tuttle::plugin::av::LibAVVideoWriter::getFormatsLong | ( | ) | const [inline] |
Definition at line 117 of file LibAVVideoWriter.hpp.
References _formatsLongNames.
const std::vector<std::string>& tuttle::plugin::av::LibAVVideoWriter::getFormatsShort | ( | ) | const [inline] |
Definition at line 112 of file LibAVVideoWriter.hpp.
References _formatsShortNames.
Referenced by tuttle::plugin::av::writer::AVWriterPlugin::AVWriterPlugin(), tuttle::plugin::av::writer::AVWriterPlugin::changedParam(), and tuttle::plugin::av::writer::AVWriterPlugin::render().
double tuttle::plugin::av::LibAVVideoWriter::getFps | ( | ) | const [inline] |
Definition at line 92 of file LibAVVideoWriter.hpp.
References _fps.
int tuttle::plugin::av::LibAVVideoWriter::getHeight | ( | ) | const [inline] |
Definition at line 72 of file LibAVVideoWriter.hpp.
References _height.
PixelFormat tuttle::plugin::av::LibAVVideoWriter::getPixelFormat | ( | ) | const [inline] |
Definition at line 102 of file LibAVVideoWriter.hpp.
References _out_pixelFormat.
const std::string& tuttle::plugin::av::LibAVVideoWriter::getVideoCodec | ( | ) | const [inline] |
Definition at line 132 of file LibAVVideoWriter.hpp.
References _videoCodecName.
const std::vector<AVPrivOption>& tuttle::plugin::av::LibAVVideoWriter::getVideoCodecPrivOpts | ( | ) | const [inline] |
Definition at line 167 of file LibAVVideoWriter.hpp.
References _videoCodecPrivOpts.
Referenced by tuttle::plugin::av::writer::AVWriterPlugin::AVWriterPlugin(), tuttle::plugin::av::writer::AVWriterPlugin::changedParam(), and tuttle::plugin::av::writer::AVWriterPlugin::render().
const std::vector<std::string>& tuttle::plugin::av::LibAVVideoWriter::getVideoCodecsLong | ( | ) | const [inline] |
Definition at line 142 of file LibAVVideoWriter.hpp.
References _videoCodecsLongNames.
const std::vector<std::string>& tuttle::plugin::av::LibAVVideoWriter::getVideoCodecsShort | ( | ) | const [inline] |
Definition at line 137 of file LibAVVideoWriter.hpp.
References _videoCodecsShortNames.
Referenced by tuttle::plugin::av::writer::AVWriterPlugin::AVWriterPlugin(), tuttle::plugin::av::writer::AVWriterPlugin::changedParam(), and tuttle::plugin::av::writer::AVWriterPlugin::render().
int tuttle::plugin::av::LibAVVideoWriter::getWidth | ( | ) | const [inline] |
Definition at line 62 of file LibAVVideoWriter.hpp.
References _width.
bool tuttle::plugin::av::LibAVVideoWriter::movie | ( | ) | const [inline] |
Definition at line 32 of file LibAVVideoWriter.hpp.
void tuttle::plugin::av::LibAVVideoWriter::setAspectRatio | ( | const double | aspectRatio | ) | [inline] |
Definition at line 77 of file LibAVVideoWriter.hpp.
References _aspectRatio.
Referenced by tuttle::plugin::av::writer::AVWriterPlugin::beginSequenceRender(), and configureFromRead().
void tuttle::plugin::av::LibAVVideoWriter::setAudioCodec | ( | const unsigned int | id | ) | [inline] |
Definition at line 187 of file LibAVVideoWriter.hpp.
References _audioCodecName, and _audioCodecsShortNames.
void tuttle::plugin::av::LibAVVideoWriter::setAudioCodec | ( | const std::string & | codec | ) | [inline] |
Definition at line 192 of file LibAVVideoWriter.hpp.
References _audioCodecName.
void tuttle::plugin::av::LibAVVideoWriter::setFilename | ( | const std::string & | filename | ) | [inline] |
Definition at line 47 of file LibAVVideoWriter.hpp.
References _filename.
Referenced by tuttle::plugin::av::writer::AVWriterPlugin::beginSequenceRender().
void tuttle::plugin::av::LibAVVideoWriter::setFormat | ( | const unsigned int | id | ) | [inline] |
Definition at line 122 of file LibAVVideoWriter.hpp.
References _formatName, and _formatsShortNames.
Referenced by tuttle::plugin::av::writer::AVWriterPlugin::beginSequenceRender(), and configureFromRead().
void tuttle::plugin::av::LibAVVideoWriter::setFormat | ( | const std::string & | format | ) | [inline] |
Definition at line 127 of file LibAVVideoWriter.hpp.
References _formatName.
void tuttle::plugin::av::LibAVVideoWriter::setFps | ( | const double | fps | ) | [inline] |
Definition at line 87 of file LibAVVideoWriter.hpp.
References _fps.
Referenced by tuttle::plugin::av::writer::AVWriterPlugin::beginSequenceRender(), and configureFromRead().
void tuttle::plugin::av::LibAVVideoWriter::setHeight | ( | const int | height | ) | [inline] |
Definition at line 67 of file LibAVVideoWriter.hpp.
References _height, and height.
Referenced by configureFromRead(), and tuttle::plugin::av::writer::AVWriterPlugin::render().
void tuttle::plugin::av::LibAVVideoWriter::setPixelFormat | ( | const PixelFormat | pxlFmt | ) | [inline] |
Definition at line 97 of file LibAVVideoWriter.hpp.
References _out_pixelFormat.
Referenced by tuttle::plugin::av::writer::AVWriterPlugin::beginSequenceRender().
void tuttle::plugin::av::LibAVVideoWriter::setVideoCodec | ( | const unsigned int | id | ) | [inline] |
Definition at line 177 of file LibAVVideoWriter.hpp.
References _videoCodecName, and _videoCodecsShortNames.
Referenced by tuttle::plugin::av::writer::AVWriterPlugin::beginSequenceRender(), configureFromRead(), and tuttle::plugin::av::writer::AVWriterPlugin::getProcessParams().
void tuttle::plugin::av::LibAVVideoWriter::setVideoCodec | ( | const std::string & | codec | ) | [inline] |
Definition at line 182 of file LibAVVideoWriter.hpp.
References _videoCodecName.
void tuttle::plugin::av::LibAVVideoWriter::setWidth | ( | const int | width | ) | [inline] |
Definition at line 57 of file LibAVVideoWriter.hpp.
Referenced by configureFromRead(), and tuttle::plugin::av::writer::AVWriterPlugin::render().
int tuttle::plugin::av::LibAVVideoWriter::start | ( | ) |
< samples per second
< number of audio channels
Definition at line 147 of file LibAVVideoWriter.cpp.
References _avFormatOptions, _avVideoOptions, _formatName, _fps, _ofmt, _stream, _videoCodec, _videoCodecName, getFilename(), getHeight(), getWidth(), TUTTLE_LOG_ERROR, and TUTTLE_LOG_TRACE.
Referenced by tuttle::plugin::av::writer::AVWriterPlugin::render().
double tuttle::plugin::av::LibAVVideoWriter::_aspectRatio [private] |
Definition at line 241 of file LibAVVideoWriter.hpp.
Referenced by getAspectRatio(), and setAspectRatio().
AVCodec* tuttle::plugin::av::LibAVVideoWriter::_audioCodec [private] |
Definition at line 219 of file LibAVVideoWriter.hpp.
std::string tuttle::plugin::av::LibAVVideoWriter::_audioCodecName [private] |
Definition at line 247 of file LibAVVideoWriter.hpp.
Referenced by getAudioCodec(), and setAudioCodec().
std::vector<AVPrivOption> tuttle::plugin::av::LibAVVideoWriter::_audioCodecPrivOpts [private] |
Definition at line 224 of file LibAVVideoWriter.hpp.
Referenced by getAudioCodecPrivOpts(), and LibAVVideoWriter().
std::vector<std::string> tuttle::plugin::av::LibAVVideoWriter::_audioCodecsLongNames [private] |
Definition at line 232 of file LibAVVideoWriter.hpp.
Referenced by getAudioCodecsLong(), and LibAVVideoWriter().
std::vector<std::string> tuttle::plugin::av::LibAVVideoWriter::_audioCodecsShortNames [private] |
Definition at line 233 of file LibAVVideoWriter.hpp.
Referenced by getAudioCodecsShort(), LibAVVideoWriter(), and setAudioCodec().
AVCodecContext* tuttle::plugin::av::LibAVVideoWriter::_avAudioOptions [private] |
Definition at line 215 of file LibAVVideoWriter.hpp.
AVFormatContext* tuttle::plugin::av::LibAVVideoWriter::_avFormatOptions |
Definition at line 209 of file LibAVVideoWriter.hpp.
Referenced by execute(), finish(), finishInit(), freeFormat(), and start().
AVCodecContext* tuttle::plugin::av::LibAVVideoWriter::_avVideoOptions [private] |
Definition at line 214 of file LibAVVideoWriter.hpp.
Referenced by start().
std::string tuttle::plugin::av::LibAVVideoWriter::_filename [private] |
Definition at line 238 of file LibAVVideoWriter.hpp.
Referenced by getFilename(), and setFilename().
std::string tuttle::plugin::av::LibAVVideoWriter::_formatName [private] |
Definition at line 245 of file LibAVVideoWriter.hpp.
Referenced by getFormat(), setFormat(), and start().
std::vector<AVPrivOption> tuttle::plugin::av::LibAVVideoWriter::_formatPrivOpts [private] |
Definition at line 222 of file LibAVVideoWriter.hpp.
Referenced by getFormatPrivOpts(), and LibAVVideoWriter().
std::vector<std::string> tuttle::plugin::av::LibAVVideoWriter::_formatsLongNames [private] |
Definition at line 226 of file LibAVVideoWriter.hpp.
Referenced by getFormatsLong(), and LibAVVideoWriter().
std::vector<std::string> tuttle::plugin::av::LibAVVideoWriter::_formatsShortNames [private] |
Definition at line 227 of file LibAVVideoWriter.hpp.
Referenced by getFormatsShort(), LibAVVideoWriter(), and setFormat().
double tuttle::plugin::av::LibAVVideoWriter::_fps [private] |
Definition at line 244 of file LibAVVideoWriter.hpp.
int tuttle::plugin::av::LibAVVideoWriter::_hasFrame [private] |
Definition at line 236 of file LibAVVideoWriter.hpp.
int tuttle::plugin::av::LibAVVideoWriter::_height [private] |
Definition at line 240 of file LibAVVideoWriter.hpp.
Referenced by getHeight(), and setHeight().
AVOutputFormat* tuttle::plugin::av::LibAVVideoWriter::_ofmt [private] |
Definition at line 220 of file LibAVVideoWriter.hpp.
Referenced by finishInit(), and start().
PixelFormat tuttle::plugin::av::LibAVVideoWriter::_out_pixelFormat [private] |
Definition at line 242 of file LibAVVideoWriter.hpp.
Referenced by execute(), finishInit(), getPixelFormat(), and setPixelFormat().
Definition at line 235 of file LibAVVideoWriter.hpp.
Definition at line 210 of file LibAVVideoWriter.hpp.
Referenced by execute(), finish(), finishInit(), freeFormat(), and start().
struct SwsContext* tuttle::plugin::av::LibAVVideoWriter::_sws_context [private] |
swscale: transformation context
Definition at line 216 of file LibAVVideoWriter.hpp.
Referenced by execute().
AVCodec* tuttle::plugin::av::LibAVVideoWriter::_videoCodec [private] |
Definition at line 218 of file LibAVVideoWriter.hpp.
Referenced by finishInit(), and start().
std::string tuttle::plugin::av::LibAVVideoWriter::_videoCodecName [private] |
Definition at line 246 of file LibAVVideoWriter.hpp.
Referenced by getVideoCodec(), setVideoCodec(), and start().
std::vector<AVPrivOption> tuttle::plugin::av::LibAVVideoWriter::_videoCodecPrivOpts [private] |
Definition at line 223 of file LibAVVideoWriter.hpp.
Referenced by getVideoCodecPrivOpts(), and LibAVVideoWriter().
std::vector<std::string> tuttle::plugin::av::LibAVVideoWriter::_videoCodecsLongNames [private] |
Definition at line 229 of file LibAVVideoWriter.hpp.
Referenced by getVideoCodecsLong(), and LibAVVideoWriter().
std::vector<std::string> tuttle::plugin::av::LibAVVideoWriter::_videoCodecsShortNames [private] |
Definition at line 230 of file LibAVVideoWriter.hpp.
Referenced by getVideoCodecsShort(), LibAVVideoWriter(), and setVideoCodec().
int tuttle::plugin::av::LibAVVideoWriter::_width [private] |
Definition at line 239 of file LibAVVideoWriter.hpp.
Referenced by getWidth(), and setWidth().