MythTV  master
avformatdecoder.h
Go to the documentation of this file.
1 
2 #ifndef AVFORMATDECODER_H_
3 #define AVFORMATDECODER_H_
4 
5 #include <array>
6 #include <cstdint>
7 
8 extern "C" {
9 #include "libavcodec/avcodec.h"
10 #include "libavformat/avformat.h"
11 }
12 
13 #include <QList>
14 #include <QMap>
15 #include <QString>
16 
21 
22 #include "captions/vbilut.h"
23 #include "decoderbase.h"
24 #include "format.h"
25 #include "io/mythavformatbuffer.h"
26 #include "mpeg/AVCParser.h"
27 #include "mythcodeccontext.h"
28 #include "mythplayer.h"
29 
30 class TeletextDecoder;
31 class CC608Decoder;
32 class CC708Decoder;
33 class SubtitleReader;
34 class InteractiveTV;
35 class MythSqlDatabase;
36 
37 struct SwsContext;
38 
39 class AudioInfo
40 {
41  public:
42  AudioInfo() = default;
43 
44  AudioInfo(AVCodecID id, AudioFormat fmt, int sr, int ch, bool passthru,
45  int original_ch, int profile = 0) :
46  m_codecId(id), format(fmt),
47  m_sampleSize(ch * AudioOutputSettings::SampleSize(fmt)),
49  m_doPassthru(passthru), m_originalChannels(original_ch)
50  {
51  }
52 
53  AVCodecID m_codecId {AV_CODEC_ID_NONE};
55  int m_sampleSize {-2};
56  int m_sampleRate {-1};
57  int m_channels {-1};
58  int m_codecProfile {0};
59  bool m_doPassthru {false};
61 
62  bool operator==(const AudioInfo &o) const
63  {
64  return (m_codecId==o.m_codecId && m_channels==o.m_channels &&
69  }
70  QString toString() const
71  {
72  return QString("id(%1) %2Hz %3ch %4bps %5 (profile %6)")
73  .arg(avcodec_get_name(m_codecId),4).arg(m_sampleRate,6)
75  .arg((m_doPassthru) ? "pt":"",3).arg(m_codecProfile);
76  }
77 };
78 
81 {
82  public:
83  AvFormatDecoder(MythPlayer *parent, const ProgramInfo &pginfo,
84  PlayerFlags flags);
85  ~AvFormatDecoder() override;
86 
87  // Deleted functions should be public.
88  AvFormatDecoder(const AvFormatDecoder &) = delete; // not copyable
89  AvFormatDecoder &operator=(const AvFormatDecoder &) = delete; // not copyable
90 
91  void SetEof(bool eof) override; // DecoderBase
92 
93  MythCodecMap* CodecMap(void);
94  void CloseCodecs();
95  void CloseContext();
96  void Reset(bool reset_video_data, bool seek_reset,
97  bool reset_file) override; // DecoderBase
98 
101  static bool CanHandle(TestBufferVec & testbuf,
102  const QString &filename);
103 
105  int OpenFile(MythMediaBuffer *Buffer, bool novideo,
106  TestBufferVec & testbuf) override; // DecoderBase
107 
108  bool GetFrame(DecodeType Type, bool &Retry) override; // DecoderBase
109 
110  bool IsLastFrameKey(void) const override { return false; } // DecoderBase
111 
112  QString GetCodecDecoderName(void) const override; // DecoderBase
113  QString GetRawEncodingType(void) override; // DecoderBase
114  MythCodecID GetVideoCodecID(void) const override { return m_videoCodecId; } // DecoderBase
115 
116  void SetDisablePassThrough(bool disable) override; // DecoderBase
117  void ForceSetupAudioStream(void) override; // DecoderBase
118  void AddTextData(unsigned char *buf, int len, int64_t timecode, char type);
119 
120  QString GetTrackDesc(uint Type, uint TrackNo) override;
121  int SetTrack(uint Type, int TrackNo) override;
122 
123  int ScanStreams(bool novideo);
124  int FindStreamInfo(void);
125 
126  int GetNumChapters() override; // DecoderBase
127  void GetChapterTimes(QList<std::chrono::seconds> &times) override; // DecoderBase
128  int GetCurrentChapter(long long framesPlayed) override; // DecoderBase
129  long long GetChapter(int chapter) override; // DecoderBase
130  bool DoRewind(long long desiredFrame, bool discardFrames = true) override; // DecoderBase
131  bool DoFastForward(long long desiredFrame, bool discardFrames = true) override; // DecoderBase
132  void SetIdrOnlyKeyframes(bool value) override // DecoderBase
133  { m_avcParser->use_I_forKeyframes(!value); }
134 
135  std::chrono::milliseconds NormalizeVideoTimecode(std::chrono::milliseconds timecode) override; // DecoderBase
136  virtual std::chrono::milliseconds NormalizeVideoTimecode(AVStream *st, std::chrono::milliseconds timecode);
137 
138  int GetTeletextDecoderType(void) const override; // DecoderBase
139 
140  QString GetXDS(const QString &Key) const override; // DecoderBase
141  QByteArray GetSubHeader(uint TrackNo) override;
142  void GetAttachmentData(uint TrackNo, QByteArray &Filename, QByteArray &Data) override; // DecoderBase
143 
144  // MHEG stuff
145  bool SetAudioByComponentTag(int Tag) override; // DecoderBase
146  bool SetVideoByComponentTag(int Tag) override; // DecoderBase
147 
148  // Stream language info
149  virtual int GetTeletextLanguage(uint Index);
150  virtual int GetSubtitleLanguage(uint /*unused*/, uint StreamIndex);
151  virtual int GetCaptionLanguage(TrackType TrackType, int ServiceNum);
152  virtual int GetAudioLanguage(uint AudioIndex, uint StreamIndex);
153  virtual AudioTrackType GetAudioTrackType(uint StreamIndex);
154 
155  static int GetMaxReferenceFrames(AVCodecContext *Context);
156 
157  static void streams_changed(void *data, int avprogram_id);
158 
159  protected:
160  int AutoSelectTrack(uint type) override; // DecoderBase
161  void ScanATSCCaptionStreams(int av_index);
162  void UpdateATSCCaptionTracks(void);
163  void UpdateCaptionTracksFromStreams(bool check_608, bool check_708);
164  void ScanTeletextCaptions(int av_index);
165  void ScanRawTextCaptions(int av_stream_index);
166  void ScanDSMCCStreams(AVBufferRef* pmt_section);
167  int AutoSelectAudioTrack(void);
168  int filter_max_ch(const AVFormatContext *ic,
169  const sinfo_vec_t &tracks,
170  const std::vector<int>&fs,
171  enum AVCodecID codecId = AV_CODEC_ID_NONE,
172  int profile = -1);
173 
174  friend int get_avf_buffer(struct AVCodecContext *c, AVFrame *pic,
175  int flags);
176 
177  void DecodeCCx08(const uint8_t *buf, uint buf_size);
178  void InitVideoCodec(AVStream *stream, AVCodecContext *enc,
179  bool selectedStream = false);
180 
182  void MpegPreProcessPkt(AVStream *stream, AVPacket *pkt);
183  int H264PreProcessPkt(AVStream *stream, AVPacket *pkt);
184  bool PreProcessVideoPacket(AVStream *stream, AVPacket *pkt);
185  virtual bool ProcessVideoPacket(AVStream *stream, AVPacket *pkt, bool &Retry);
186  virtual bool ProcessVideoFrame(AVStream *Stream, AVFrame *AvFrame);
187  bool ProcessAudioPacket(AVStream *stream, AVPacket *pkt,
188  DecodeType decodetype);
189  bool ProcessSubtitlePacket(AVStream *stream, AVPacket *pkt);
190  bool ProcessRawTextPacket(AVPacket* Packet);
191  virtual bool ProcessDataPacket(AVStream *curstream, AVPacket *pkt,
192  DecodeType decodetype);
193 
194  void ProcessVBIDataPacket(const AVStream *stream, const AVPacket *pkt);
195  void ProcessDVBDataPacket(const AVStream *stream, const AVPacket *pkt);
196  void ProcessDSMCCPacket(const AVStream *stream, const AVPacket *pkt);
197 
198  void SeekReset(long long newkey, uint skipFrames, bool doFlush, bool discardFrames) override; // DecoderBase
199 
200  inline bool DecoderWillDownmix(const AVCodecContext *ctx);
201  bool DoPassThrough(const AVCodecParameters *par, bool withProfile=true);
202  bool SetupAudioStream(void);
203  void SetupAudioStreamSubIndexes(int streamIndex);
204  void RemoveAudioStreams();
205 
208  void HandleGopStart(AVPacket *pkt, bool can_reliably_parse_keyframes);
209 
210  bool GenerateDummyVideoFrames(void);
211  bool HasVideo();
212  float GetVideoFrameRate(AVStream *Stream, AVCodecContext *Context, bool Sanitise = false);
213  static void av_update_stream_timings_video(AVFormatContext *ic);
214  bool OpenAVCodec(AVCodecContext *avctx, const AVCodec *codec);
215 
216  void UpdateFramesPlayed(void) override; // DecoderBase
217  bool DoRewindSeek(long long desiredFrame) override; // DecoderBase
218  void DoFastForwardSeek(long long desiredFrame, bool &needflush) override; // DecoderBase
219  virtual void StreamChangeCheck(void);
220  virtual void PostProcessTracks(void) { }
221  virtual bool IsValidStream(int /*streamid*/) {return true;}
222 
223  int DecodeAudio(AVCodecContext *ctx, uint8_t *buffer, int &data_size,
224  AVPacket *pkt);
225 
226  virtual int ReadPacket(AVFormatContext *ctx, AVPacket *pkt, bool &storePacket);
227 
228  bool FlagIsSet(PlayerFlags arg) { return m_playerFlags & arg; }
229 
230  int autoSelectVideoTrack(int& scanerror);
231  void remove_tracks_not_in_same_AVProgram(int stream_index);
232 
234  AVProgram* get_current_AVProgram();
235 
236  bool do_av_seek(long long desiredFrame, bool discardFrames, int flags);
237 
239 
240  AVCParser *m_avcParser {nullptr};
241 
242  AVFormatContext *m_ic {nullptr};
244 
245  // AVFormatParameters params;
246 
247  int m_frameDecoded {0};
250 
251  struct SwsContext *m_swsCtx {nullptr};
252  bool m_directRendering {false};
253 
254  bool m_gopSet {false};
256  bool m_seenGop {false};
258  int m_seqCount {0};
259 
260  QList<AVPacket*> m_storedPackets;
261 
262  int m_prevGopPos {0};
263 
264  // GetFrame
265  bool m_gotVideoFrame {false};
266  bool m_hasVideo {false};
268  bool m_skipAudio {false};
269  bool m_allowedQuit {false};
270 
271  uint32_t m_startCodeState {0xffffffff};
272 
273  std::chrono::milliseconds m_lastVPts {0ms};
274  std::chrono::milliseconds m_lastAPts {0ms};
275  std::chrono::microseconds m_lastCcPtsu {0ms};
276  std::chrono::milliseconds m_firstVPts {0ms};
277  bool m_firstVPtsInuse {false};
278 
281 
283  int m_averrorCount {0};
284 
285  // Caption/Subtitle/Teletext decoders
286  CC608Decoder *m_ccd608 {nullptr};
287  CC708Decoder *m_ccd708 {nullptr};
288  TeletextDecoder *m_ttd {nullptr};
292  std::array<bool,68> m_ccX08InPmt {};
296  std::array<bool,68> m_ccX08InTracks {};
298  QList<StreamInfo> m_pmtTracks;
300  QList<TrackType> m_pmtTrackTypes;
303  QList<StreamInfo> m_streamTracks;
306  QList<TrackType> m_streamTrackTypes;
307 
309  InteractiveTV *m_itv {nullptr};
310 
311  // Audio
312  uint8_t *m_audioSamples {nullptr};
313  bool m_disablePassthru {false};
314 
317 
318  bool m_processFrames {true};
319 
320  bool m_streamsChanged { false };
321  bool m_resetHardwareDecoders { false };
322 
323  // Value in milliseconds, from setting AudioReadAhead
324  std::chrono::milliseconds m_audioReadAhead {100ms};
325 
326  QRecursiveMutex m_avCodecLock;
327 };
328 
329 #endif
330 
331 /* vim: set expandtab tabstop=4 shiftwidth=4: */
AvFormatDecoder::get_avf_buffer
friend int get_avf_buffer(struct AVCodecContext *c, AVFrame *pic, int flags)
Definition: avformatdecoder.cpp:2721
AvFormatDecoder::GetTrackDesc
QString GetTrackDesc(uint Type, uint TrackNo) override
Definition: avformatdecoder.cpp:3935
AudioInfo::m_channels
int m_channels
Definition: avformatdecoder.h:57
AVCParser
Definition: AVCParser.h:30
AvFormatDecoder::IsLastFrameKey
bool IsLastFrameKey(void) const override
Definition: avformatdecoder.h:110
AvFormatDecoder::GetRawEncodingType
QString GetRawEncodingType(void) override
Definition: avformatdecoder.cpp:4993
AudioInfo::m_codecProfile
int m_codecProfile
Definition: avformatdecoder.h:58
AudioInfo::m_codecId
AVCodecID m_codecId
Definition: avformatdecoder.h:53
AvFormatDecoder::av_update_stream_timings_video
static void av_update_stream_timings_video(AVFormatContext *ic)
Definition: avformatdecoder.cpp:5225
AvFormatDecoder::GetChapterTimes
void GetChapterTimes(QList< std::chrono::seconds > &times) override
Definition: avformatdecoder.cpp:530
AvFormatDecoder::SetTrack
int SetTrack(uint Type, int TrackNo) override
Definition: avformatdecoder.cpp:3923
AvFormatDecoder::GetCurrentChapter
int GetCurrentChapter(long long framesPlayed) override
Definition: avformatdecoder.cpp:547
AudioInfo::m_sampleSize
int m_sampleSize
Definition: avformatdecoder.h:55
DecodeType
DecodeType
Definition: decoderbase.h:48
AvFormatDecoder::m_skipAudio
bool m_skipAudio
Definition: avformatdecoder.h:268
AvFormatDecoder::do_av_seek
bool do_av_seek(long long desiredFrame, bool discardFrames, int flags)
Definition: avformatdecoder.cpp:621
AvFormatDecoder::AutoSelectAudioTrack
int AutoSelectAudioTrack(void)
Selects the best audio track.
Definition: avformatdecoder.cpp:4195
MythCodecID
MythCodecID
Definition: mythcodecid.h:11
audiooutpututil.h
AvFormatDecoder::m_gotVideoFrame
bool m_gotVideoFrame
Definition: avformatdecoder.h:265
AvFormatDecoder::UpdateFramesPlayed
void UpdateFramesPlayed(void) override
Definition: avformatdecoder.cpp:2520
spdifencoder.h
AvFormatDecoder::m_storedPackets
QList< AVPacket * > m_storedPackets
Definition: avformatdecoder.h:260
AvFormatDecoder::SetEof
void SetEof(bool eof) override
Definition: avformatdecoder.cpp:798
AvFormatDecoder::GetAttachmentData
void GetAttachmentData(uint TrackNo, QByteArray &Filename, QByteArray &Data) override
Definition: avformatdecoder.cpp:4034
AvFormatDecoder::m_itv
InteractiveTV * m_itv
MHEG/MHP decoder.
Definition: avformatdecoder.h:309
AudioInfo::toString
QString toString() const
Definition: avformatdecoder.h:70
AvFormatDecoder::m_maxKeyframeDist
int m_maxKeyframeDist
Definition: avformatdecoder.h:282
AvFormatDecoder::RemoveAudioStreams
void RemoveAudioStreams()
remove audio streams from the context used by dvd code during title transitions to remove stale audio...
Definition: avformatdecoder.cpp:2679
AudioInfo::AudioInfo
AudioInfo()=default
AvFormatDecoder::NormalizeVideoTimecode
std::chrono::milliseconds NormalizeVideoTimecode(std::chrono::milliseconds timecode) override
Definition: avformatdecoder.cpp:467
AvFormatDecoder::DecoderWillDownmix
bool DecoderWillDownmix(const AVCodecContext *ctx)
Definition: avformatdecoder.cpp:5026
AvFormatDecoder::SetAudioByComponentTag
bool SetAudioByComponentTag(int Tag) override
Definition: avformatdecoder.cpp:4048
CC608Decoder
Definition: cc608decoder.h:49
TeletextDecoder
Definition: teletextdecoder.h:8
AvFormatDecoder::autoSelectVideoTrack
int autoSelectVideoTrack(int &scanerror)
Definition: avformatdecoder.cpp:1882
format.h
AudioOutputSettings::FormatToBits
static int FormatToBits(AudioFormat format)
Definition: audiooutputsettings.cpp:150
AVCParser::use_I_forKeyframes
void use_I_forKeyframes(bool val)
Definition: AVCParser.h:118
AvFormatDecoder::HasVideo
bool HasVideo()
Definition: avformatdecoder.cpp:4936
AvFormatDecoder::SetIdrOnlyKeyframes
void SetIdrOnlyKeyframes(bool value) override
Definition: avformatdecoder.h:132
AvFormatDecoder::m_ccX08InTracks
std::array< bool, 68 > m_ccX08InTracks
Lookup table for whether a stream is represented in the UI entries 0-3 correspond to CEA-608 CC1 thro...
Definition: avformatdecoder.h:296
AvFormatDecoder::m_audioSamples
uint8_t * m_audioSamples
Definition: avformatdecoder.h:312
SubtitleReader
Definition: subtitlereader.h:42
AvFormatDecoder::GetTeletextDecoderType
int GetTeletextDecoderType(void) const override
Definition: avformatdecoder.cpp:4012
MythMediaBuffer
Definition: mythmediabuffer.h:59
AvFormatDecoder::IsValidStream
virtual bool IsValidStream(int)
Definition: avformatdecoder.h:221
AvFormatDecoder::m_seenGop
bool m_seenGop
A flag to indicate that we've seen a GOP frame. Used in junction with seq_count.
Definition: avformatdecoder.h:256
mythplayer.h
CC708Decoder
Definition: cc708decoder.h:29
PlayerFlags
PlayerFlags
Definition: mythplayer.h:64
MythPlayer
Definition: mythplayer.h:83
AvFormatDecoder::SeekReset
void SeekReset(long long newkey, uint skipFrames, bool doFlush, bool discardFrames) override
Definition: avformatdecoder.cpp:671
mythavformatbuffer.h
AvFormatDecoder::GetChapter
long long GetChapter(int chapter) override
Definition: avformatdecoder.cpp:571
AvFormatDecoder::FindStreamInfo
int FindStreamInfo(void)
Definition: avformatdecoder.cpp:882
AvFormatDecoder::ScanATSCCaptionStreams
void ScanATSCCaptionStreams(int av_index)
Definition: avformatdecoder.cpp:1594
sinfo_vec_t
std::vector< StreamInfo > sinfo_vec_t
Definition: decoderbase.h:119
AvFormatDecoder::GetSubHeader
QByteArray GetSubHeader(uint TrackNo) override
Definition: avformatdecoder.cpp:4022
AvFormatDecoder::m_playerFlags
PlayerFlags m_playerFlags
Definition: avformatdecoder.h:279
AvFormatDecoder::m_streamTracks
QList< StreamInfo > m_streamTracks
StreamInfo for 608 and 708 Captions seen in the caption stream itself but not seen in the PMT.
Definition: avformatdecoder.h:303
AvFormatDecoder::CloseCodecs
void CloseCodecs()
Definition: avformatdecoder.cpp:432
AudioInfo::operator==
bool operator==(const AudioInfo &o) const
Definition: avformatdecoder.h:62
kCodec_NONE
@ kCodec_NONE
Definition: mythcodecid.h:15
AvFormatDecoder::m_allowedQuit
bool m_allowedQuit
Definition: avformatdecoder.h:269
AvFormatDecoder::CodecMap
MythCodecMap * CodecMap(void)
Definition: avformatdecoder.cpp:427
AvFormatDecoder::GetAudioLanguage
virtual int GetAudioLanguage(uint AudioIndex, uint StreamIndex)
Definition: avformatdecoder.cpp:2583
AvFormatDecoder::m_streamsChanged
bool m_streamsChanged
Definition: avformatdecoder.h:320
AvFormatDecoder::m_firstVPts
std::chrono::milliseconds m_firstVPts
Definition: avformatdecoder.h:276
AvFormatDecoder::Reset
void Reset(bool reset_video_data, bool seek_reset, bool reset_file) override
Definition: avformatdecoder.cpp:810
AvFormatDecoder::SetDisablePassThrough
void SetDisablePassThrough(bool disable) override
Disables AC3/DTS pass through.
Definition: avformatdecoder.cpp:5001
AvFormatDecoder::OpenFile
int OpenFile(MythMediaBuffer *Buffer, bool novideo, TestBufferVec &testbuf) override
Open our file and set up or audio and video parameters.
Definition: avformatdecoder.cpp:911
AvFormatDecoder::m_avfRingBuffer
MythAVFormatBuffer * m_avfRingBuffer
Definition: avformatdecoder.h:249
AvFormatDecoder::m_directRendering
bool m_directRendering
Definition: avformatdecoder.h:252
AVFrame
struct AVFrame AVFrame
Definition: BorderDetector.h:15
programinfo.h
AvFormatDecoder::ScanDSMCCStreams
void ScanDSMCCStreams(AVBufferRef *pmt_section)
Check to see whether there is a Network Boot Ifo sub-descriptor in the PMT which requires the MHEG ap...
Definition: avformatdecoder.cpp:1817
AvFormatDecoder::m_processFrames
bool m_processFrames
Definition: avformatdecoder.h:318
AvFormatDecoder::m_decodedVideoFrame
MythVideoFrame * m_decodedVideoFrame
Definition: avformatdecoder.h:248
vbilut.h
hardwareprofile.scan.profile
profile
Definition: scan.py:97
AvFormatDecoder::GetMaxReferenceFrames
static int GetMaxReferenceFrames(AVCodecContext *Context)
Definition: avformatdecoder.cpp:1355
FORMAT_NONE
@ FORMAT_NONE
Definition: audiooutputsettings.h:25
AudioInfo::m_sampleRate
int m_sampleRate
Definition: avformatdecoder.h:56
AvFormatDecoder::PreProcessVideoPacket
bool PreProcessVideoPacket(AVStream *stream, AVPacket *pkt)
Definition: avformatdecoder.cpp:3244
AvFormatDecoder::ProcessRawTextPacket
bool ProcessRawTextPacket(AVPacket *Packet)
Definition: avformatdecoder.cpp:3871
AudioTrackType
AudioTrackType
Definition: decoderbase.h:56
AvFormatDecoder::m_ccd708
CC708Decoder * m_ccd708
Definition: avformatdecoder.h:287
AvFormatDecoder::StreamChangeCheck
virtual void StreamChangeCheck(void)
Definition: avformatdecoder.cpp:4917
AvFormatDecoder::SetVideoByComponentTag
bool SetVideoByComponentTag(int Tag) override
Definition: avformatdecoder.cpp:4061
AvFormatDecoder::m_pmtTracks
QList< StreamInfo > m_pmtTracks
StreamInfo for 608 and 708 Captions seen in the PMT descriptor.
Definition: avformatdecoder.h:298
AvFormatDecoder::ProcessVideoPacket
virtual bool ProcessVideoPacket(AVStream *stream, AVPacket *pkt, bool &Retry)
Definition: avformatdecoder.cpp:3303
AvFormatDecoder::m_lastVPts
std::chrono::milliseconds m_lastVPts
Definition: avformatdecoder.h:273
AvFormatDecoder::ProcessDSMCCPacket
void ProcessDSMCCPacket(const AVStream *stream, const AVPacket *pkt)
Process DSMCC object carousel packet.
Definition: avformatdecoder.cpp:3749
AvFormatDecoder::m_ic
AVFormatContext * m_ic
Definition: avformatdecoder.h:242
AvFormatDecoder::get_current_AVProgram
AVProgram * get_current_AVProgram()
Definition: avformatdecoder.cpp:5285
AvFormatDecoder::GetCaptionLanguage
virtual int GetCaptionLanguage(TrackType TrackType, int ServiceNum)
Return ATSC Closed Caption Language.
Definition: avformatdecoder.cpp:2553
AvFormatDecoder::GenerateDummyVideoFrames
bool GenerateDummyVideoFrames(void)
Definition: avformatdecoder.cpp:4963
TestBufferVec
std::vector< char > TestBufferVec
Definition: decoderbase.h:24
AvFormatDecoder::remove_tracks_not_in_same_AVProgram
void remove_tracks_not_in_same_AVProgram(int stream_index)
Definition: avformatdecoder.cpp:2064
AvFormatDecoder
A decoder for media files.
Definition: avformatdecoder.h:80
AvFormatDecoder::ProcessVideoFrame
virtual bool ProcessVideoFrame(AVStream *Stream, AVFrame *AvFrame)
Definition: avformatdecoder.cpp:3418
AvFormatDecoder::DoRewind
bool DoRewind(long long desiredFrame, bool discardFrames=true) override
Definition: avformatdecoder.cpp:587
MythCodecMap
Definition: mythavutil.h:27
AvFormatDecoder::InitVideoCodec
void InitVideoCodec(AVStream *stream, AVCodecContext *enc, bool selectedStream=false)
Definition: avformatdecoder.cpp:1389
AvFormatDecoder::ReadPacket
virtual int ReadPacket(AVFormatContext *ctx, AVPacket *pkt, bool &storePacket)
Definition: avformatdecoder.cpp:4928
AvFormatDecoder::GetTeletextLanguage
virtual int GetTeletextLanguage(uint Index)
Returns TeleText language.
Definition: avformatdecoder.cpp:2536
AvFormatDecoder::ProcessDataPacket
virtual bool ProcessDataPacket(AVStream *curstream, AVPacket *pkt, DecodeType decodetype)
Definition: avformatdecoder.cpp:3892
AvFormatDecoder::ProcessAudioPacket
bool ProcessAudioPacket(AVStream *stream, AVPacket *pkt, DecodeType decodetype)
Definition: avformatdecoder.cpp:4432
AvFormatDecoder::m_lastAPts
std::chrono::milliseconds m_lastAPts
Definition: avformatdecoder.h:274
AvFormatDecoder::m_seqCount
int m_seqCount
A counter used to determine if we need to force a call to HandleGopStart.
Definition: avformatdecoder.h:258
AVCParser.h
AvFormatDecoder::m_videoCodecId
MythCodecID m_videoCodecId
Definition: avformatdecoder.h:280
AudioInfo
Definition: avformatdecoder.h:39
AvFormatDecoder::m_prevGopPos
int m_prevGopPos
Definition: avformatdecoder.h:262
AvFormatDecoder::ProcessVBIDataPacket
void ProcessVBIDataPacket(const AVStream *stream, const AVPacket *pkt)
Process ivtv proprietary embedded vertical blanking interval captions.
Definition: avformatdecoder.cpp:3608
AvFormatDecoder::m_isDbIgnored
bool m_isDbIgnored
Definition: avformatdecoder.h:238
AvFormatDecoder::m_audioReadAhead
std::chrono::milliseconds m_audioReadAhead
Definition: avformatdecoder.h:324
AvFormatDecoder::FlagIsSet
bool FlagIsSet(PlayerFlags arg)
Definition: avformatdecoder.h:228
Buffer
Definition: MythExternControl.h:36
ProgramInfo
Holds information on recordings and videos.
Definition: programinfo.h:67
AvFormatDecoder::m_audioIn
AudioInfo m_audioIn
Definition: avformatdecoder.h:315
AvFormatDecoder::GetAudioTrackType
virtual AudioTrackType GetAudioTrackType(uint StreamIndex)
Definition: avformatdecoder.cpp:2588
AudioInfo::m_doPassthru
bool m_doPassthru
Definition: avformatdecoder.h:59
AvFormatDecoder::ProcessSubtitlePacket
bool ProcessSubtitlePacket(AVStream *stream, AVPacket *pkt)
Definition: avformatdecoder.cpp:3787
AvFormatDecoder::m_averrorCount
int m_averrorCount
Definition: avformatdecoder.h:283
AvFormatDecoder::ScanRawTextCaptions
void ScanRawTextCaptions(int av_stream_index)
Definition: avformatdecoder.cpp:1794
AvFormatDecoder::m_hasVideo
bool m_hasVideo
Definition: avformatdecoder.h:266
AvFormatDecoder::m_needDummyVideoFrames
bool m_needDummyVideoFrames
Definition: avformatdecoder.h:267
AvFormatDecoder::ForceSetupAudioStream
void ForceSetupAudioStream(void) override
Definition: avformatdecoder.cpp:5020
AvFormatDecoder::m_lastCcPtsu
std::chrono::microseconds m_lastCcPtsu
Definition: avformatdecoder.h:275
AvFormatDecoder::DoFastForward
bool DoFastForward(long long desiredFrame, bool discardFrames=true) override
Skips ahead or rewinds to desiredFrame.
Definition: avformatdecoder.cpp:599
AvFormatDecoder::HandleGopStart
void HandleGopStart(AVPacket *pkt, bool can_reliably_parse_keyframes)
Update our position map, keyframe distance, and the like.
Definition: avformatdecoder.cpp:2926
AvFormatDecoder::GetXDS
QString GetXDS(const QString &Key) const override
Definition: avformatdecoder.cpp:4017
AvFormatDecoder::m_avCodecLock
QRecursiveMutex m_avCodecLock
Definition: avformatdecoder.h:326
AudioInfo::format
AudioFormat format
Definition: avformatdecoder.h:54
AudioOutputSettings
Definition: audiooutputsettings.h:48
AudioInfo::m_originalChannels
int m_originalChannels
Definition: avformatdecoder.h:60
AvFormatDecoder::DoRewindSeek
bool DoRewindSeek(long long desiredFrame) override
Definition: avformatdecoder.cpp:2525
AvFormatDecoder::m_audioOut
AudioInfo m_audioOut
Definition: avformatdecoder.h:316
AvFormatDecoder::GetSubtitleLanguage
virtual int GetSubtitleLanguage(uint, uint StreamIndex)
Returns DVD Subtitle language.
Definition: avformatdecoder.cpp:2546
AvFormatDecoder::m_avcParser
AVCParser * m_avcParser
Definition: avformatdecoder.h:240
AvFormatDecoder::m_resetHardwareDecoders
bool m_resetHardwareDecoders
Definition: avformatdecoder.h:321
AvFormatDecoder::UpdateCaptionTracksFromStreams
void UpdateCaptionTracksFromStreams(bool check_608, bool check_708)
Definition: avformatdecoder.cpp:2857
AvFormatDecoder::m_streamTrackTypes
QList< TrackType > m_streamTrackTypes
TrackType (608 or 708) for Captions seen in the caption stream itself but not seen in the PMT.
Definition: avformatdecoder.h:306
AvFormatDecoder::PostProcessTracks
virtual void PostProcessTracks(void)
Definition: avformatdecoder.h:220
AvFormatDecoder::GetCodecDecoderName
QString GetCodecDecoderName(void) const override
Definition: avformatdecoder.cpp:4988
AudioFormat
AudioFormat
Definition: audiooutputsettings.h:24
AvFormatDecoder::CanHandle
static bool CanHandle(TestBufferVec &testbuf, const QString &filename)
Perform an av_probe_input_format on the passed data to see if we can decode it with this class.
Definition: avformatdecoder.cpp:829
decoderbase.h
AvFormatDecoder::DecodeCCx08
void DecodeCCx08(const uint8_t *buf, uint buf_size)
Definition: avformatdecoder.cpp:2816
AvFormatDecoder::AutoSelectTrack
int AutoSelectTrack(uint type) override
Select best track.
Definition: avformatdecoder.cpp:4081
AvFormatDecoder::m_firstVPtsInuse
bool m_firstVPtsInuse
Definition: avformatdecoder.h:277
AvFormatDecoder::m_codecMap
MythCodecMap m_codecMap
Definition: avformatdecoder.h:243
AvFormatDecoder::AddTextData
void AddTextData(unsigned char *buf, int len, int64_t timecode, char type)
AvFormatDecoder::m_gopSet
bool m_gopSet
Definition: avformatdecoder.h:254
AvFormatDecoder::GetVideoCodecID
MythCodecID GetVideoCodecID(void) const override
Definition: avformatdecoder.h:114
AvFormatDecoder::m_pmtTrackTypes
QList< TrackType > m_pmtTrackTypes
TrackType (608 or 708) for Captions seen in the PMT descriptor.
Definition: avformatdecoder.h:300
AvFormatDecoder::ProcessDVBDataPacket
void ProcessDVBDataPacket(const AVStream *stream, const AVPacket *pkt)
Process DVB Teletext.
Definition: avformatdecoder.cpp:3692
mythcodeccontext.h
AvFormatDecoder::SetupAudioStream
bool SetupAudioStream(void)
Reinitializes audio if it needs to be reinitialized.
Definition: avformatdecoder.cpp:5076
AvFormatDecoder::GetNumChapters
int GetNumChapters() override
Definition: avformatdecoder.cpp:523
AvFormatDecoder::m_swsCtx
struct SwsContext * m_swsCtx
Definition: avformatdecoder.h:251
AvFormatDecoder::filter_max_ch
int filter_max_ch(const AVFormatContext *ic, const sinfo_vec_t &tracks, const std::vector< int > &fs, enum AVCodecID codecId=AV_CODEC_ID_NONE, int profile=-1)
Definition: avformatdecoder.cpp:4119
AvFormatDecoder::ScanTeletextCaptions
void ScanTeletextCaptions(int av_index)
Definition: avformatdecoder.cpp:1737
AvFormatDecoder::m_disablePassthru
bool m_disablePassthru
Definition: avformatdecoder.h:313
AvFormatDecoder::AvFormatDecoder
AvFormatDecoder(MythPlayer *parent, const ProgramInfo &pginfo, PlayerFlags flags)
Definition: avformatdecoder.cpp:366
AvFormatDecoder::GetVideoFrameRate
float GetVideoFrameRate(AVStream *Stream, AVCodecContext *Context, bool Sanitise=false)
Definition: avformatdecoder.cpp:1237
AvFormatDecoder::OpenAVCodec
bool OpenAVCodec(AVCodecContext *avctx, const AVCodec *codec)
Definition: avformatdecoder.cpp:2491
AvFormatDecoder::~AvFormatDecoder
~AvFormatDecoder() override
Definition: avformatdecoder.cpp:396
TrackType
TrackType
Track types.
Definition: decoderbase.h:27
AvFormatDecoder::CloseContext
void CloseContext()
Definition: avformatdecoder.cpp:446
MythVideoFrame
Definition: mythframe.h:87
AvFormatDecoder::m_ttd
TeletextDecoder * m_ttd
Definition: avformatdecoder.h:288
AvFormatDecoder::H264PreProcessPkt
int H264PreProcessPkt(AVStream *stream, AVPacket *pkt)
Definition: avformatdecoder.cpp:3141
InteractiveTV
This is the interface between an MHEG engine and a MythTV TV object.
Definition: interactivetv.h:15
AvFormatDecoder::SetupAudioStreamSubIndexes
void SetupAudioStreamSubIndexes(int streamIndex)
Reacts to DUAL/STEREO changes on the fly and fix streams.
Definition: avformatdecoder.cpp:2620
MythAVFormatBuffer
Definition: mythavformatbuffer.h:12
AvFormatDecoder::MpegPreProcessPkt
void MpegPreProcessPkt(AVStream *stream, AVPacket *pkt)
Preprocess a packet, setting the video parms if necessary.
Definition: avformatdecoder.cpp:3046
AvFormatDecoder::GetFrame
bool GetFrame(DecodeType Type, bool &Retry) override
Demux, preprocess and possibly decode a frame of video/audio.
Definition: avformatdecoder.cpp:4627
AvFormatDecoder::m_ccX08InPmt
std::array< bool, 68 > m_ccX08InPmt
Lookup table for whether a stream was seen in the PMT entries 0-3 correspond to CEA-608 CC1 through C...
Definition: avformatdecoder.h:292
build_compdb.filename
filename
Definition: build_compdb.py:21
AvFormatDecoder::get_current_AVStream_index
int get_current_AVStream_index(TrackType type)
Definition: avformatdecoder.cpp:5276
AvFormatDecoder::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: avformatdecoder.cpp:2530
AvFormatDecoder::operator=
AvFormatDecoder & operator=(const AvFormatDecoder &)=delete
audiooutputsettings.h
AvFormatDecoder::m_frameDecoded
int m_frameDecoded
Definition: avformatdecoder.h:247
AvFormatDecoder::ScanStreams
int ScanStreams(bool novideo)
Definition: avformatdecoder.cpp:2101
AvFormatDecoder::UpdateATSCCaptionTracks
void UpdateATSCCaptionTracks(void)
Definition: avformatdecoder.cpp:1670
AvFormatDecoder::DecodeAudio
int DecodeAudio(AVCodecContext *ctx, uint8_t *buffer, int &data_size, AVPacket *pkt)
AudioInfo::AudioInfo
AudioInfo(AVCodecID id, AudioFormat fmt, int sr, int ch, bool passthru, int original_ch, int profile=0)
Definition: avformatdecoder.h:44
DecoderBase
Definition: decoderbase.h:121
AvFormatDecoder::m_ccd608
CC608Decoder * m_ccd608
Definition: avformatdecoder.h:286
AvFormatDecoder::DoPassThrough
bool DoPassThrough(const AVCodecParameters *par, bool withProfile=true)
Definition: avformatdecoder.cpp:5049
AvFormatDecoder::streams_changed
static void streams_changed(void *data, int avprogram_id)
Definition: avformatdecoder.cpp:856
uint
unsigned int uint
Definition: freesurround.h:24
AvFormatDecoder::m_startCodeState
uint32_t m_startCodeState
Definition: avformatdecoder.h:271