6 #include <libavcodec/avcodec.h>
7 #include <libavformat/avformat.h>
18 , _inputFile(&inputFile)
21 , _streamIndex(streamIndex)
26 switch(context->codec_type)
28 case AVMEDIA_TYPE_VIDEO:
33 case AVMEDIA_TYPE_AUDIO:
38 case AVMEDIA_TYPE_DATA:
56 throw std::runtime_error(
"Can't read packet on non-activated input stream.");
77 assert(_streamIndex <= _inputFile->getFormatContext().getNbStreams());
81 throw std::runtime_error(
"unable to get video descriptor on non-video stream");
89 assert(_streamIndex <= _inputFile->getFormatContext().getNbStreams());
93 throw std::runtime_error(
"unable to get audio descriptor on non-audio stream");
101 assert(_streamIndex <= _inputFile->getFormatContext().getNbStreams());
105 throw std::runtime_error(
"unable to get data descriptor on non-data stream");
121 LOG_DEBUG(
"Do not add a packet data for the stream " <<
_streamIndex <<
" to the cache: stream not activated")
void copyData(unsigned char *buffer, const size_t size)
Copy external data buffer.
const avtranscoder::StreamProperties & getStreamPropertiesWithIndex(const size_t streamIndex) const
Virtual based class of properties for all types of stream.
This class describes coded data.
AVStream & getAVStream(size_t index) const