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
8 #include "avformatdecoder.h"
9 
10 #define 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:60
AudioTrackType
AudioTrackType
Definition: decoderbase.h:56
MythDVDDecoder::~MythDVDDecoder
~MythDVDDecoder() override
Definition: mythdvddecoder.cpp:22
MythDVDDecoder::m_returnContext
MythDVDContext * m_returnContext
Definition: mythdvddecoder.h:48
INVALID_LBA
#define INVALID_LBA
Definition: mythdvddecoder.h:10
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:94
MythDVDDecoder::DoRewindSeek
bool DoRewindSeek(long long DesiredFrame) override
Definition: mythdvddecoder.cpp:530
MythDVDDecoder::CheckContext
void CheckContext(int64_t Pts)
Definition: mythdvddecoder.cpp:200
Context
QHash< QString, Action * > Context
Definition: action.h:77
PlayerFlags
PlayerFlags
Definition: mythplayer.h:62
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:15
MythDVDDecoder::m_curContext
MythDVDContext * m_curContext
Definition: mythdvddecoder.h:43
MythDVDDecoder::ProcessDataPacket
bool ProcessDataPacket(AVStream *Curstream, AVPacket *Pkt, DecodeType Decodetype) override
Definition: mythdvddecoder.cpp:345
AVFrame
struct AVFrame AVFrame
Definition: BorderDetector.h:15
MythDVDDecoder::DVDFindPosition
long long DVDFindPosition(long long DesiredFrame)
Definition: mythdvddecoder.cpp:603
MythDVDDecoder::GetAudioTrackType
AudioTrackType GetAudioTrackType(uint Index) override
Definition: mythdvddecoder.cpp:633
DecodeType
DecodeType
Definition: decoderbase.h:48
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:541
MythDVDContext
Encapsulates playback context at any given moment.
Definition: mythdvdcontext.h:17
MythDVDDecoder::ProcessVideoPacket
bool ProcessVideoPacket(AVStream *Stream, AVPacket *Pkt, bool &Retry) override
Definition: mythdvddecoder.cpp:268
MythDVDDecoder::GetAudioLanguage
int GetAudioLanguage(uint AudioIndex, uint StreamIndex) override
Definition: mythdvddecoder.cpp:593
MythDVDDecoder::MythDVDDecoder
MythDVDDecoder(MythPlayer *Parent, const ProgramInfo &PGInfo, PlayerFlags Flags)
Definition: mythdvddecoder.cpp:17
AvFormatDecoder
A decoder for media files.
Definition: avformatdecoder.h:87
MythDVDDecoder::ProcessVideoFrame
bool ProcessVideoFrame(AVStream *Stream, AVFrame *Frame) override
Definition: mythdvddecoder.cpp:331
uint
unsigned int uint
Definition: compat.h:141
MythDVDDecoder::ReleaseContext
static void ReleaseContext(MythDVDContext *&Context)
Definition: mythdvddecoder.cpp:44
ProgramInfo
Holds information on recordings and videos.
Definition: programinfo.h:68
MythDVDDecoder::StreamChangeCheck
void StreamChangeCheck(void) override
Definition: mythdvddecoder.cpp:552
MythDVDDecoder::PostProcessTracks
void PostProcessTracks(void) override
Definition: mythdvddecoder.cpp:391
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:70
MythDVDDecoder::Reset
void Reset(bool ResetVideoData, bool SeekReset, bool ResetFile) override
Definition: mythdvddecoder.cpp:53
MythDVDDecoder::ReadPacket
int ReadPacket(AVFormatContext *Ctx, AVPacket *Pkt, bool &StorePacket) override
Definition: mythdvddecoder.cpp:76