MythTV  master
mythdvddecoder.h
Go to the documentation of this file.
1 #ifndef AVFORMATDECODERDVD_H
2 #define AVFORMATDECODERDVD_H
3 
4 // Qt
5 #include <QList>
6 
7 // MythTV
9 
10 static constexpr uint32_t INVALID_LBA { 0xbfffffff };
11 
12 class MythDVDContext;
13 
15 {
16  public:
17  MythDVDDecoder(MythPlayer *Parent, const ProgramInfo &PGInfo, PlayerFlags Flags);
18  ~MythDVDDecoder() override;
19 
20  void Reset (bool ResetVideoData, bool SeekReset, bool ResetFile) override;
21  void UpdateFramesPlayed(void) override;
22  bool GetFrame (DecodeType Type, bool &Retry) override;
23 
24  protected:
25  int ReadPacket (AVFormatContext *Ctx, AVPacket *Pkt, bool &StorePacket) override;
26  bool ProcessVideoPacket(AVStream *Stream, AVPacket *Pkt, bool &Retry) override;
27  bool ProcessVideoFrame (AVStream *Stream, AVFrame *Frame) override;
28  bool ProcessDataPacket (AVStream *Curstream, AVPacket *Pkt, DecodeType Decodetype) override;
29 
30  private:
31  bool DoRewindSeek (long long DesiredFrame) override;
32  void DoFastForwardSeek (long long DesiredFrame, bool &NeedFlush) override;
33  void StreamChangeCheck (void) override;
34  void PostProcessTracks (void) override;
35  int GetAudioLanguage (uint AudioIndex, uint StreamIndex) override;
36  AudioTrackType GetAudioTrackType(uint Index) override;
37 
38  void CheckContext (int64_t Pts);
39  void ReleaseLastVideoPkt (void);
40  static void ReleaseContext (MythDVDContext *&Context);
41  long long DVDFindPosition(long long DesiredFrame);
42 
44  QList<MythDVDContext*> m_contextList;
45  AVPacket* m_lastVideoPkt { nullptr };
47  int m_framesReq { 0 };
49 };
50 
51 #endif
MythDVDDecoder::UpdateFramesPlayed
void UpdateFramesPlayed(void) override
Definition: mythdvddecoder.cpp:58
AudioTrackType
AudioTrackType
Definition: decoderbase.h:55
MythDVDDecoder::~MythDVDDecoder
~MythDVDDecoder() override
Definition: mythdvddecoder.cpp:22
MythDVDDecoder::m_returnContext
MythDVDContext * m_returnContext
Definition: mythdvddecoder.h:48
MythDVDDecoder::m_lbaLastVideoPkt
uint32_t m_lbaLastVideoPkt
Definition: mythdvddecoder.h:46
MythDVDDecoder::m_contextList
QList< MythDVDContext * > m_contextList
Definition: mythdvddecoder.h:44
Frame
Definition: zmdefines.h:93
MythDVDDecoder::DoRewindSeek
bool DoRewindSeek(long long DesiredFrame) override
Definition: mythdvddecoder.cpp:531
MythDVDDecoder::CheckContext
void CheckContext(int64_t Pts)
Definition: mythdvddecoder.cpp:204
PlayerFlags
PlayerFlags
Definition: mythplayer.h:64
MythDVDDecoder::ReleaseLastVideoPkt
void ReleaseLastVideoPkt(void)
Definition: mythdvddecoder.cpp:33
MythPlayer
Definition: mythplayer.h:83
AvFormatDecoder::SeekReset
void SeekReset(long long newkey, uint skipFrames, bool doFlush, bool discardFrames) override
Definition: avformatdecoder.cpp:674
MythDVDDecoder
Definition: mythdvddecoder.h:14
MythDVDDecoder::m_curContext
MythDVDContext * m_curContext
Definition: mythdvddecoder.h:43
MythDVDDecoder::ProcessDataPacket
bool ProcessDataPacket(AVStream *Curstream, AVPacket *Pkt, DecodeType Decodetype) override
Definition: mythdvddecoder.cpp:347
AVFrame
struct AVFrame AVFrame
Definition: BorderDetector.h:15
MythDVDDecoder::DVDFindPosition
long long DVDFindPosition(long long DesiredFrame)
Definition: mythdvddecoder.cpp:604
MythDVDDecoder::GetAudioTrackType
AudioTrackType GetAudioTrackType(uint Index) override
Definition: mythdvddecoder.cpp:634
DecodeType
DecodeType
Definition: decoderbase.h:47
MythDVDDecoder::m_framesReq
int m_framesReq
Definition: mythdvddecoder.h:47
MythDVDDecoder::DoFastForwardSeek
void DoFastForwardSeek(long long DesiredFrame, bool &NeedFlush) override
Seeks to the keyframe just before the desiredFrame if exact seeks is enabled, or the frame just after...
Definition: mythdvddecoder.cpp:542
MythDVDContext
Encapsulates playback context at any given moment.
Definition: mythdvdcontext.h:16
MythDVDDecoder::ProcessVideoPacket
bool ProcessVideoPacket(AVStream *Stream, AVPacket *Pkt, bool &Retry) override
Definition: mythdvddecoder.cpp:272
MythDVDDecoder::GetAudioLanguage
int GetAudioLanguage(uint AudioIndex, uint StreamIndex) override
Definition: mythdvddecoder.cpp:594
MythDVDDecoder::MythDVDDecoder
MythDVDDecoder(MythPlayer *Parent, const ProgramInfo &PGInfo, PlayerFlags Flags)
Definition: mythdvddecoder.cpp:17
AvFormatDecoder
A decoder for media files.
Definition: avformatdecoder.h:82
MythDVDDecoder::ProcessVideoFrame
bool ProcessVideoFrame(AVStream *Stream, AVFrame *Frame) override
Definition: mythdvddecoder.cpp:333
uint
unsigned int uint
Definition: compat.h:81
INVALID_LBA
static constexpr uint32_t INVALID_LBA
Definition: mythdvddecoder.h:10
MythDVDDecoder::ReleaseContext
static void ReleaseContext(MythDVDContext *&Context)
Definition: mythdvddecoder.cpp:42
ProgramInfo
Holds information on recordings and videos.
Definition: programinfo.h:67
MythDVDDecoder::StreamChangeCheck
void StreamChangeCheck(void) override
Definition: mythdvddecoder.cpp:553
MythDVDDecoder::PostProcessTracks
void PostProcessTracks(void) override
Definition: mythdvddecoder.cpp:393
MythDVDDecoder::m_lastVideoPkt
AVPacket * m_lastVideoPkt
Definition: mythdvddecoder.h:45
avformatdecoder.h
MythDVDDecoder::GetFrame
bool GetFrame(DecodeType Type, bool &Retry) override
Demux, preprocess and possibly decode a frame of video/audio.
Definition: mythdvddecoder.cpp:68
MythDVDDecoder::Reset
void Reset(bool ResetVideoData, bool SeekReset, bool ResetFile) override
Definition: mythdvddecoder.cpp:51
MythDVDDecoder::ReadPacket
int ReadPacket(AVFormatContext *Ctx, AVPacket *Pkt, bool &StorePacket) override
Definition: mythdvddecoder.cpp:74