12 , _outputFile(outputFile)
13 , _outputAVStream(outputFile.getFormatContext().getAVStream(streamIndex))
14 , _streamIndex(streamIndex)
15 , _wrappedPacketsDuration(0)
16 , _lastWrappedPacketDuration(0)
17 , _isPTSGenerated(false)
27 if(outputTimeBase.den == 0 || outputPTS.den == 0)
35 #if AVTRANSCODER_FFMPEG_DEPENDENCY && LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(55, 40, 100)
37 return av_q2d(outputTimeBase) * av_stream_get_end_pts(&
_outputAVStream);
39 return av_q2d(outputTimeBase) * (outputPTS.val + (outputPTS.num / outputPTS.den));
51 return (outputPTS.val + (outputPTS.num / outputPTS.den));
78 case AVMEDIA_TYPE_VIDEO:
83 case AVMEDIA_TYPE_AUDIO:
86 audioPacketDuration.num = 0;
87 audioPacketDuration.den = 0;
89 if(frame_size <= 0 || _outputAVStream.codec->sample_rate <= 0)
91 audioPacketDuration.num = frame_size;
size_t _streamIndex
Index of the stream in the output file.
size_t getNbFrames() const
If audio stream, returns number of packets.
IOutputStream::EWrappingStatus wrap(const CodedData &data)
Wrap a packet of data.
int _lastWrappedPacketDuration
OutputStream(OutputFile &outputFile, const size_t streamIndex)
OutputFile & _outputFile
Has link (no ownership)
Outputfile is the default implentation of wrapper which uses LibAV/FFMpeg.
size_t _wrappedPacketsDuration
EWrappingStatus
define wrapping result status
IOutputStream::EWrappingStatus wrap(const CodedData &data, const size_t streamIndex)
Wrap a packet of data in the output ressource.
const AVStream & _outputAVStream
Has link (no ownership)
int getStreamPTS() const
Get current AVStream PTS.
This class describes coded data.
float getStreamDuration() const