21#ifndef __VIDEOSTREAM_H
22#define __VIDEOSTREAM_H
29#include <libavcodec/avcodec.h>
35#define VIDEO_BUFFER_SIZE (512 * 1024)
36#define VIDEO_PACKET_MAX 192
39#define QUIRK_NO_HW_DEINT 1 << 0
40#define QUIRK_CODEC_FLUSH_WORKAROUND 1 << 1
41#define QUIRK_CODEC_NEEDS_EXT_INIT 1 << 2
42#define QUIRK_CODEC_SKIP_FIRST_FRAMES 1 << 3
43#define QUIRK_CODEC_SKIP_NUM_FRAMES 2
44#define QUIRK_CODEC_DISABLE_MPEG_HW 1 << 4
45#define QUIRK_CODEC_DISABLE_H264_HW 1 << 5
62 void Open(AVCodecID, AVCodecParameters * =
nullptr, AVRational = { .num = 1, .den = 90000 });
cMainVideoStream - Main video stream class
cMainVideoStream(cVideoRender *render, cQueue< cDrmBuffer > *buf, cSoftHdConfig *config, std::function< void(AVFrame *)> fn)
cPipVideoStream - Pip video stream class
cPipVideoStream(cVideoRender *render, 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.
cVideoDecoder - VideoDecoder class
cVideoRender - Video render class
cVideoStream - Video stream class
cDecodingThread * m_pDecodingThread
pointer to decoding thread
bool m_interlaced
flag for interlaced stream
void GetVideoSize(int *, int *, double *)
Get video size and aspect ratio.
void OpenDecoder(void)
Open the decoder including an H.264 parsing if needed.
cFilterThread * m_pFilterThread
pointer to deinterlace filter thread
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?
std::string m_decodingThreadName
decoding thread name string (persists for object lifetime)
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.
void DecodingThreadResume(void)
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
enum AVCodecID m_codecId
current codec id
bool m_checkFilterThreadNeeded
set, if we have to check, if filter thread is needed at start of playback
void SetStartDecodingWithIFrame(bool enable)
size_t GetAvPacketsFilled(void)
AVCodecParameters * m_pPar
current codec parameters
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.
cQueue< cDrmBuffer > * m_pDrmBufferQueue
pointer to renderer's DRM buffer queue
void DisableDeint(bool disable)
bool IsDeinterlacerDeactivated(void)
void CloseDecoder(void)
Close the decoder.
int m_hardwareQuirks
hardware specific quirks
cVideoDecoder * m_pDecoder
video decoder
void Exit(void)
Exit video stream.
virtual ~cVideoStream(void)
cVideoStream destructor
void CancelFilterThread(void)
Stop filter thread.
void DecodingThreadHalt(void)
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 ExitDecodingThread(void)
Stop decoding thread.
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)
std::string m_filterThreadName
filter thread name string (persists for object lifetime)
virtual void SetDeinterlacerDeactivated(bool deactivate)
void ResetTrickSpeedFramesSentCounter(void)
enum AVCodecID GetCodecId(void)
std::atomic< struct AVRational > m_timebase
current codec timebase
Thread-safe queue header file.
Thread classes header file.
#define VIDEO_PACKET_MAX
max number of video packets held in the buffer