Loading...
Searching...
No Matches
Video::LibAVDecoder Struct Reference
Inheritance diagram for Video::LibAVDecoder:
Video::CameraInput Video::LibavStreamInput Video::VideoDecoder

Public Member Functions

ReadFrame enqueue_frame (const AVPacket *pkt) noexcept
 
std::pair< AVBufferRef *, const AVCodec * > open_hwdec (const AVCodec &) noexcept
 
int init_codec_context (const AVCodec *codec, AVBufferRef *hw_dev_ctx, const AVStream *stream, std::function< void(AVCodecContext &)> setup)
 
bool open_codec_context (VideoInterface &self, const AVStream *stream, std::function< void(AVCodecContext &)> setup)
 
void init_scaler (VideoInterface &self) noexcept
 
void load_packet_in_frame (const AVPacket &packet, AVFrame &frame)
 
ReadFrame read_one_frame (AVPacket &packet)
 
ReadFrame read_one_frame_raw (AVPacket &packet)
 
ReadFrame read_one_frame_avcodec (AVPacket &packet)
 
void landSkip (AVFrame *f) noexcept
 
void dropSkipCandidate () noexcept
 Gives the held-back frame back to the frame pool.
 
ReadFrame takeSkipCandidate () noexcept
 The held-back frame, converted as enqueue_frame converts its frames.
 

Public Attributes

DecoderConfiguration m_conf
 
AVFormatContext * m_formatContext {}
 
AVStream * m_avstream {}
 
const AVCodec * m_codec {}
 
AVCodecContext * m_codecContext {}
 
FrameQueue m_frames
 
Rescale m_rescale
 
MissingTimestamps m_missingTimestamps
 
int64_t m_ptsLead {}
 
int64_t m_skipBefore {AV_NOPTS_VALUE}
 
AVFrame * m_skipCandidate {}
 The last frame held back while m_skipBefore is set.
 
int64_t m_skipLandingPts {AV_NOPTS_VALUE}
 
std::atomic_bool m_finished {}
 Set by the decoding thread, polled by the owner waiting for the end.
 

Member Data Documentation

◆ m_ptsLead

int64_t Video::LibAVDecoder::m_ptsLead {}

The largest pts - dts seen: a seek for a time asks for that much earlier, the demuxer seeking on dts.

◆ m_skipBefore

int64_t Video::LibAVDecoder::m_skipBefore {AV_NOPTS_VALUE}

While set, enqueue_frame holds back the frames that start at or before this pts, unconverted: a seek lands on the keyframe before its target, and the frames up to the target are references, not pictures. The first frame starting after it clears it, and goes out after the last frame held back, the one shown at the target. Frame durations do not decide it: in a rounded time base (matroska's milliseconds at 30 fps) a frame can end before the next one starts.

◆ m_skipLandingPts

int64_t Video::LibAVDecoder::m_skipLandingPts {AV_NOPTS_VALUE}

The pts of the first frame given out when m_skipBefore was cleared, queued or returned by enqueue_frame: where the seek landed. The frame itself is m_frames.watched() while the consumer has not given it back.


The documentation for this struct was generated from the following files: