MythTV  master
avformatdecoderdvd.h
Go to the documentation of this file.
1 #ifndef AVFORMATDECODERDVD_H
2 #define AVFORMATDECODERDVD_H
3 
4 #include <QList>
5 #include "avformatdecoder.h"
6 
7 #define INVALID_LBA 0xbfffffff
8 
9 class MythDVDContext;
10 
12 {
13  public:
14  AvFormatDecoderDVD(MythPlayer *parent, const ProgramInfo &pginfo,
15  PlayerFlags flags)
16  : AvFormatDecoder(parent, pginfo, flags) {}
17  ~AvFormatDecoderDVD() override;
18  void Reset(bool reset_video_data, bool seek_reset, bool reset_file) override; // AvFormatDecoder
19  void UpdateFramesPlayed(void) override; // AvFormatDecoder
20  bool GetFrame(DecodeType decodetype) override; // AvFormatDecoder
21 
22  protected:
23  int ReadPacket(AVFormatContext *ctx, AVPacket *pkt, bool &storePacket) override; // AvFormatDecoder
24  bool ProcessVideoPacket(AVStream *stream, AVPacket *pkt) override; // AvFormatDecoder
25  bool ProcessVideoFrame(AVStream *stream, AVFrame *mpa_pic) override; // AvFormatDecoder
26  bool ProcessDataPacket(AVStream *curstream, AVPacket *pkt,
27  DecodeType decodetype) override; // AvFormatDecoder
28 
29  private:
30  bool DoRewindSeek(long long desiredFrame) override; // AvFormatDecoder
31  void DoFastForwardSeek(long long desiredFrame, bool &needflush) override; // AvFormatDecoder
32  void StreamChangeCheck(void) override; // AvFormatDecoder
33  void PostProcessTracks(void) override; // AvFormatDecoder
34  int GetAudioLanguage(uint audio_index, uint stream_index) override; // AvFormatDecoder
35  AudioTrackType GetAudioTrackType(uint stream_index) override; // AvFormatDecoder
36 
37  void CheckContext(int64_t pts);
38  void ReleaseLastVideoPkt();
39  void ReleaseContext(MythDVDContext *&context);
40 
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 // AVFORMATDECODERDVD_H
#define INVALID_LBA
long long DVDFindPosition(long long desiredFrame)
MythDVDContext * m_curContext
Encapsulates playback context at any given moment.
Definition: dvdringbuffer.h:32
PlayerFlags
Definition: mythplayer.h:88
struct AVFrame AVFrame
bool ProcessVideoPacket(AVStream *stream, AVPacket *pkt) override
AudioTrackType
Definition: decoderbase.h:55
unsigned int uint
Definition: compat.h:140
void CheckContext(int64_t pts)
bool ProcessVideoFrame(AVStream *stream, AVFrame *mpa_pic) override
void StreamChangeCheck(void) override
void ReleaseContext(MythDVDContext *&context)
bool GetFrame(DecodeType decodetype) override
Demux, preprocess and possibly decode a frame of video/audio.
Holds information on recordings and videos.
Definition: programinfo.h:66
AvFormatDecoderDVD(MythPlayer *parent, const ProgramInfo &pginfo, PlayerFlags flags)
QList< MythDVDContext * > m_contextList
void PostProcessTracks(void) override
void Reset(bool reset_video_data, bool seek_reset, bool reset_file) override
int ReadPacket(AVFormatContext *ctx, AVPacket *pkt, bool &storePacket) override
int GetAudioLanguage(uint audio_index, uint stream_index) override
MythDVDContext * m_returnContext
bool DoRewindSeek(long long desiredFrame) override
A decoder for video files.
AudioTrackType GetAudioTrackType(uint stream_index) override
void UpdateFramesPlayed(void) override
enum DecodeTypes DecodeType
bool ProcessDataPacket(AVStream *curstream, AVPacket *pkt, DecodeType decodetype) override
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...