13#ifndef __VIDEOSTREAM_H
14#define __VIDEOSTREAM_H
23#include <libavcodec/avcodec.h>
26#include <vdr/thread.h>
cMainVideoStream(cVideoRender *render, int hardwareQuirks, cQueue< cDrmBuffer > *buf, cSoftHdConfig *config, std::function< void(AVFrame *)> fn)
cPipVideoStream(cVideoRender *render, int hardwareQuirks, cQueue< cDrmBuffer > *buf, cSoftHdConfig *config, std::function< void(AVFrame *)> fn)
void SetDeinterlacerDeactivated(bool) override
size_t Size(void)
Get the current size of the queue.
std::mutex m_mutex
mutex for decoding thread control
bool m_interlaced
flag for interlaced stream
void GetVideoSize(int *, int *, double *)
Get video size and aspect ratio.
bool ParseH264Packet(AVPacket *)
Parse an H.264 packet.
void OpenDecoder(void)
Open the decoder including an H.264 parsing if needed.
int m_dropInvalidPackets
drop P-Frames with invalid references until the given number of I-Frames arrived
std::function< void(AVFrame *)> m_frameOutput
function to output the frame
const char * m_identifier
identifier string for logging
void SetDecoderFallbackToSwNumPkts(int numPackets)
cSoftHdConfig * m_pConfig
plugin config
int64_t m_inputPts
PTS of the first packet in the input buffer.
bool m_deinterlacerDeactivated
set, if the deinterlacer should be disabled temporarily (trickspeed, stillpicture,...
int m_sentTrickPkts
how many avpkt have been sent to the decoder in trickspeed mode?
int m_logPackets
parse and log all frames until the number of given I-Frames arrived
void Flush(void)
Flushes the video stream by finalizing any pending data.
bool m_parseH264Dimensions
parse width and height when starting an h264 stream
void StartDecoder()
Start the decoder.
cVideoDecoder * Decoder(void)
void CheckForcingFrameDecode(void)
Check, if we need to force the decoder to decode the frame (force a decoder drain)
bool m_startDecodingWithIFrame
wait for an I-Frame to start h264 decoding
void ClearVdrCoreToDecoderQueue(void)
Clears all video stream data, which is buffered to be decoded.
bool m_userDisabledDeinterlacer
set, if the user configured the deinterlace to be disabled
volatile bool m_newStream
flag for new stream
int m_ppsNumRefIdxL1DefaultActiveMinus1
cache NumRefIdxL1DefaultActiveMinuns1 from a previous PPS parsing
enum AVCodecID m_codecId
current codec id
int GetVideoPacketMax(void)
bool m_checkFilterThreadNeeded
set, if we have to check, if filter thread is needed at start of playback
int m_log2MaxFrameNumMinus4
cache Log2MaxFrameNumMinus4 from a previous SPS parsing
void SetStartDecodingWithIFrame(bool enable)
size_t GetAvPacketsFilled(void)
AVCodecParameters * m_pPar
current codec parameters
static constexpr int VIDEO_PACKET_MAX
max number of video packets held in the buffer
int m_decoderFallbackToSwNumPkts
fallback to sw decoder if hw decoder fails after the given number of packets sent
void DecodeInput(void)
Decodes a reassembled codec packet.
bool m_isResend
track, if we already tried to send the AVPacket to the decoder if so, skip the parsing
void Stop(void)
Stop the decoding thread.
cQueue< cDrmBuffer > * m_pDrmBufferQueue
pointer to renderer's DRM buffer queue
void DisableDeint(bool disable)
virtual void Action(void)
Decoding thread loop, which periodically tries to decode input.
bool IsDeinterlacerDeactivated(void)
void CloseDecoder(void)
Close the decoder.
int m_hardwareQuirks
hardware specific quirks
cVideoDecoder * m_pDecoder
video decoder
cVideoFilter m_videoFilter
pointer to deinterlace/scaling video filter thread
int m_maxFrameNum
= 1 << Log2MaxFrameNumMinus4 + 4
void Exit(void)
Exit video stream.
virtual ~cVideoStream(void)
std::vector< std::string > m_naluTypesAtStart
array of strings to log the H.264 frames at stream start
void CancelFilterThread(void)
Stop filter thread.
int m_ppsNumRefIdxL0DefaultActiveMinus1
cache NumRefIdxL0DefaultActiveMinuns1 from a previous PPS parsing
cVideoRender * m_pRender
video renderer
int m_trickpkts
how many avpkt does the decoder need in trickspeed mode?
void RenderFrame(AVFrame *)
Render a frame.
cQueue< AVPacket > m_packets
AVPackets queue.
void FlushDecoder(void)
Flush the decoder.
void Open(AVCodecID, AVCodecParameters *=nullptr, AVRational={ .num=1,.den=90000 })
Open a video codec.
bool PushAvPacket(AVPacket *avpkt)
Pushes a pre-assembled AVPacket directly to the processing queue.
bool IsInputBufferFull(void)
int64_t GetInputPts(void)
void ResetFilterThreadNeededCheck()
int64_t GetInputPtsMs(void)
void SetParseH264Dimensions(bool enable)
virtual void SetDeinterlacerDeactivated(bool deactivate)
int m_numIFrames
counter for the arriving I-Frames at H.264 stream start
void ResetTrickSpeedFramesSentCounter(void)
enum AVCodecID GetCodecId(void)
std::atomic< struct AVRational > m_timebase
current codec timebase
std::set< int > m_dpbFrames
private set of reference frames (internal short-time decoded picture buffer)
Deinterlace and Scaling Filters Header File.