MythTV
master
|
#include <mythdvddecoder.h>
Public Member Functions | |
MythDVDDecoder (MythPlayer *Parent, const ProgramInfo &PGInfo, PlayerFlags Flags) | |
~MythDVDDecoder () override | |
void | Reset (bool ResetVideoData, bool SeekReset, bool ResetFile) override |
void | UpdateFramesPlayed (void) override |
bool | GetFrame (DecodeType Type, bool &Retry) override |
Demux, preprocess and possibly decode a frame of video/audio. More... | |
![]() | |
AvFormatDecoder (MythPlayer *parent, const ProgramInfo &pginfo, PlayerFlags flags) | |
~AvFormatDecoder () override | |
AvFormatDecoder (const AvFormatDecoder &)=delete | |
AvFormatDecoder & | operator= (const AvFormatDecoder &)=delete |
void | SetEof (bool eof) override |
MythCodecMap * | CodecMap (void) |
void | CloseCodecs () |
void | CloseContext () |
int | OpenFile (MythMediaBuffer *Buffer, bool novideo, TestBufferVec &testbuf) override |
Open our file and set up or audio and video parameters. More... | |
bool | IsLastFrameKey (void) const override |
void | WriteStoredData (MythMediaBuffer *Buffer, bool storevid, std::chrono::milliseconds timecodeOffset) override |
This is a No-op for this class. More... | |
void | SetRawAudioState (bool state) override |
This is a No-op for this class. More... | |
bool | GetRawAudioState (void) const override |
This is a No-op for this class. More... | |
void | SetRawVideoState (bool state) override |
This is a No-op for this class. More... | |
bool | GetRawVideoState (void) const override |
This is a No-op for this class. More... | |
long | UpdateStoredFrameNum (long frame) override |
This is a No-op for this class. More... | |
QString | GetCodecDecoderName (void) const override |
QString | GetRawEncodingType (void) override |
MythCodecID | GetVideoCodecID (void) const override |
void | SetDisablePassThrough (bool disable) override |
Disables AC3/DTS pass through. More... | |
void | ForceSetupAudioStream (void) override |
void | AddTextData (unsigned char *buf, int len, int64_t timecode, char type) |
QString | GetTrackDesc (uint Type, uint TrackNo) override |
int | SetTrack (uint Type, int TrackNo) override |
int | ScanStreams (bool novideo) |
int | FindStreamInfo (void) |
int | GetNumChapters () override |
void | GetChapterTimes (QList< std::chrono::seconds > ×) override |
int | GetCurrentChapter (long long framesPlayed) override |
long long | GetChapter (int chapter) override |
bool | DoRewind (long long desiredFrame, bool discardFrames=true) override |
bool | DoFastForward (long long desiredFrame, bool discardFrames=true) override |
Skips ahead or rewinds to desiredFrame. More... | |
void | SetIdrOnlyKeyframes (bool value) override |
std::chrono::milliseconds | NormalizeVideoTimecode (std::chrono::milliseconds timecode) override |
virtual std::chrono::milliseconds | NormalizeVideoTimecode (AVStream *st, std::chrono::milliseconds timecode) |
int | GetTeletextDecoderType (void) const override |
QString | GetXDS (const QString &Key) const override |
QByteArray | GetSubHeader (uint TrackNo) override |
void | GetAttachmentData (uint TrackNo, QByteArray &Filename, QByteArray &Data) override |
bool | SetAudioByComponentTag (int Tag) override |
bool | SetVideoByComponentTag (int Tag) override |
virtual int | GetTeletextLanguage (uint Index) |
Returns TeleText language. More... | |
virtual int | GetSubtitleLanguage (uint, uint StreamIndex) |
Returns DVD Subtitle language. More... | |
virtual int | GetCaptionLanguage (TrackType TrackType, int ServiceNum) |
Return ATSC Closed Caption Language. More... | |
![]() | |
DecoderBase (MythPlayer *parent, const ProgramInfo &pginfo) | |
virtual | ~DecoderBase () |
void | SetRenderFormats (const VideoFrameTypes *RenderFormats) |
virtual void | SetEofState (EofState eof) |
EofState | GetEof (void) |
void | SetSeekSnap (uint64_t snap) |
uint64_t | GetSeekSnap (void) const |
void | SetLiveTVMode (bool live) |
void | SetProgramInfo (const ProgramInfo &pginfo) |
virtual void | SetWatchingRecording (bool mode) |
MythPlayer * | GetPlayer () |
std::chrono::milliseconds | TranslatePositionFrameToMs (long long position, float fallback_framerate, const frm_dir_map_t &cutlist) |
uint64_t | TranslatePositionMsToFrame (std::chrono::milliseconds dur_ms, float fallback_framerate, const frm_dir_map_t &cutlist) |
float | GetVideoAspect (void) const |
virtual void | ClearStoredData (void) |
virtual double | GetFPS (void) const |
uint | GetRawBitrate (void) const |
Returns the estimated bitrate if the video were played at normal speed. More... | |
long long | GetFramesRead (void) const |
long long | GetFramesPlayed (void) const |
void | SetFramesPlayed (long long newValue) |
virtual void | ResetPosMap (void) |
virtual bool | SyncPositionMap (void) |
Updates the position map used for skipping frames. More... | |
virtual bool | PosMapFromDb (void) |
virtual bool | PosMapFromEnc (void) |
Queries encoder for position map data that has not been committed to the DB yet. More... | |
virtual bool | FindPosition (long long desired_value, bool search_adjusted, int &lower_bound, int &upper_bound) |
uint64_t | SavePositionMapDelta (long long first_frame, long long last_frame) |
void | SetTranscoding (bool value) |
bool | IsErrored () const |
bool | HasPositionMap (void) const |
void | SetWaitForChange (void) |
bool | GetWaitForChange (void) const |
void | SetReadAdjust (long long adjust) |
void | SetDecodeAllSubtitles (bool DecodeAll) |
virtual QStringList | GetTracks (uint Type) |
virtual uint | GetTrackCount (uint Type) |
virtual int | GetTrackLanguageIndex (uint Type, uint TrackNo) |
int | GetTrack (uint Type) |
StreamInfo | GetTrackInfo (uint Type, uint TrackNo) |
int | ChangeTrack (uint Type, int Dir) |
virtual bool | InsertTrack (uint Type, const StreamInfo &Info) |
int | NextTrack (uint Type) |
void | SaveTotalDuration (void) |
void | ResetTotalDuration (void) |
void | SaveTotalFrames (void) |
void | TrackTotalDuration (bool track) |
int | GetfpsMultiplier (void) const |
MythCodecContext * | GetMythCodecContext (void) |
Protected Member Functions | |
int | ReadPacket (AVFormatContext *Ctx, AVPacket *Pkt, bool &StorePacket) override |
bool | ProcessVideoPacket (AVStream *Stream, AVPacket *Pkt, bool &Retry) override |
bool | ProcessVideoFrame (AVStream *Stream, AVFrame *Frame) override |
bool | ProcessDataPacket (AVStream *Curstream, AVPacket *Pkt, DecodeType Decodetype) override |
![]() | |
int | AutoSelectTrack (uint type) override |
Select best track. More... | |
void | ScanATSCCaptionStreams (int av_index) |
void | UpdateATSCCaptionTracks (void) |
void | UpdateCaptionTracksFromStreams (bool check_608, bool check_708) |
void | ScanTeletextCaptions (int av_index) |
void | ScanRawTextCaptions (int av_stream_index) |
void | ScanDSMCCStreams (void) |
Check to see whether there is a Network Boot Ifo sub-descriptor in the PMT which requires the MHEG application to reboot. More... | |
int | AutoSelectAudioTrack (void) |
Selects the best audio track. More... | |
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) |
void | DecodeDTVCC (const uint8_t *buf, uint buf_size, bool scte) |
void | DecodeCCx08 (const uint8_t *buf, uint buf_size, bool scte) |
void | InitByteContext (bool forceseek=false) |
void | InitVideoCodec (AVStream *stream, AVCodecContext *enc, bool selectedStream=false) |
void | MpegPreProcessPkt (AVStream *stream, AVPacket *pkt) |
Preprocess a packet, setting the video parms if necessary. More... | |
int | H264PreProcessPkt (AVStream *stream, AVPacket *pkt) |
bool | PreProcessVideoPacket (AVStream *stream, AVPacket *pkt) |
bool | ProcessAudioPacket (AVStream *stream, AVPacket *pkt, DecodeType decodetype) |
bool | ProcessSubtitlePacket (AVStream *stream, AVPacket *pkt) |
bool | ProcessRawTextPacket (AVPacket *Packet) |
void | ProcessVBIDataPacket (const AVStream *stream, const AVPacket *pkt) |
Process ivtv proprietary embedded vertical blanking interval captions. More... | |
void | ProcessDVBDataPacket (const AVStream *stream, const AVPacket *pkt) |
Process DVB Teletext. More... | |
void | ProcessDSMCCPacket (const AVStream *stream, const AVPacket *pkt) |
Process DSMCC object carousel packet. More... | |
void | SeekReset (long long newkey, uint skipFrames, bool doFlush, bool discardFrames) override |
bool | DecoderWillDownmix (const AVCodecContext *ctx) |
bool | DoPassThrough (const AVCodecParameters *par, bool withProfile=true) |
bool | SetupAudioStream (void) |
Reinitializes audio if it needs to be reinitialized. More... | |
void | SetupAudioStreamSubIndexes (int streamIndex) |
Reacts to DUAL/STEREO changes on the fly and fix streams. More... | |
void | RemoveAudioStreams () |
remove audio streams from the context used by dvd code during title transitions to remove stale audio streams More... | |
void | HandleGopStart (AVPacket *pkt, bool can_reliably_parse_keyframes) |
Update our position map, keyframe distance, and the like. More... | |
bool | GenerateDummyVideoFrames (void) |
bool | HasVideo (const AVFormatContext *ic) |
float | GetVideoFrameRate (AVStream *Stream, AVCodecContext *Context, bool Sanitise=false) |
bool | OpenAVCodec (AVCodecContext *avctx, const AVCodec *codec) |
virtual bool | IsValidStream (int) |
int | DecodeAudio (AVCodecContext *ctx, uint8_t *buffer, int &data_size, AVPacket *pkt) |
bool | FlagIsSet (PlayerFlags arg) |
![]() | |
void | AutoSelectTracks (void) |
void | ResetTracks (void) |
void | FileChanged (void) |
long long | ConditionallyUpdatePosMap (long long desiredFrame) |
long long | GetLastFrameInPosMap (void) const |
unsigned long | GetPositionMapSize (void) const |
long long | GetKey (const PosMapEntry &entry) const |
Private Member Functions | |
bool | DoRewindSeek (long long DesiredFrame) 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 it if exact seeks is not enabled. More... | |
void | StreamChangeCheck (void) override |
void | PostProcessTracks (void) override |
int | GetAudioLanguage (uint AudioIndex, uint StreamIndex) override |
AudioTrackType | GetAudioTrackType (uint Index) override |
void | CheckContext (int64_t Pts) |
void | ReleaseLastVideoPkt (void) |
long long | DVDFindPosition (long long DesiredFrame) |
Static Private Member Functions | |
static void | ReleaseContext (MythDVDContext *&Context) |
Private Attributes | |
MythDVDContext * | m_curContext { nullptr } |
QList< MythDVDContext * > | m_contextList |
AVPacket * | m_lastVideoPkt { nullptr } |
uint32_t | m_lbaLastVideoPkt { INVALID_LBA} |
int | m_framesReq { 0 } |
MythDVDContext * | m_returnContext { nullptr } |
Additional Inherited Members | |
![]() | |
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. More... | |
static int | GetMaxReferenceFrames (AVCodecContext *Context) |
![]() | |
static uint64_t | TranslatePositionAbsToRel (const frm_dir_map_t &deleteMap, uint64_t absPosition, const frm_pos_map_t &map=frm_pos_map_t(), float fallback_ratio=1.0) |
static uint64_t | TranslatePositionRelToAbs (const frm_dir_map_t &deleteMap, uint64_t relPosition, const frm_pos_map_t &map=frm_pos_map_t(), float fallback_ratio=1.0) |
static uint64_t | TranslatePosition (const frm_pos_map_t &map, long long key, float fallback_ratio) |
static AVPixelFormat | GetBestVideoFormat (AVPixelFormat *Formats, const VideoFrameTypes *RenderFormats) |
Find a suitable frame format that is mutually acceptable to the decoder and render device. More... | |
![]() | |
static void | av_update_stream_timings_video (AVFormatContext *ic) |
![]() | |
bool | m_isDbIgnored |
AVCParser * | m_avcParser {nullptr} |
AVFormatContext * | m_ic {nullptr} |
MythCodecMap | m_codecMap { } |
URLContext | m_readContext {} |
int | m_frameDecoded {0} |
MythVideoFrame * | m_decodedVideoFrame {nullptr} |
MythAVFormatBuffer * | m_avfRingBuffer {nullptr} |
struct SwsContext * | m_swsCtx {nullptr} |
bool | m_directRendering {false} |
bool | m_doRewind {false} |
bool | m_gopSet {false} |
bool | m_seenGop {false} |
A flag to indicate that we've seen a GOP frame. Used in junction with seq_count. More... | |
int | m_seqCount {0} |
A counter used to determine if we need to force a call to HandleGopStart. More... | |
QList< AVPacket * > | m_storedPackets |
int | m_prevGopPos {0} |
bool | m_gotVideoFrame {false} |
bool | m_hasVideo {false} |
bool | m_needDummyVideoFrames {false} |
bool | m_skipAudio {false} |
bool | m_allowedQuit {false} |
uint32_t | m_startCodeState {0xffffffff} |
std::chrono::milliseconds | m_lastVPts {0ms} |
std::chrono::milliseconds | m_lastAPts {0ms} |
std::chrono::microseconds | m_lastCcPtsu {0ms} |
std::chrono::milliseconds | m_firstVPts {0ms} |
bool | m_firstVPtsInuse {false} |
int64_t | m_faultyPts {0} |
int64_t | m_faultyDts {0} |
int64_t | m_lastPtsForFaultDetection {0} |
int64_t | m_lastDtsForFaultDetection {0} |
bool | m_ptsDetected {false} |
bool | m_reorderedPtsDetected {false} |
bool | m_ptsSelected {true} |
bool | m_useFrameTiming {false} |
bool | m_forceDtsTimestamps {false} |
PlayerFlags | m_playerFlags |
MythCodecID | m_videoCodecId {kCodec_NONE} |
int | m_maxKeyframeDist {-1} |
int | m_averrorCount {0} |
uint | m_ignoreScte {0} |
uint | m_invertScteField {0} |
uint | m_lastScteField {0} |
CC608Decoder * | m_ccd608 {nullptr} |
CC708Decoder * | m_ccd708 {nullptr} |
TeletextDecoder * | m_ttd {nullptr} |
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 CC4, while entries 4-67 corresport to CEA-708 streams 0 through 64. More... | |
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 through CC4, while entries 4-67 corresport to CEA-708 streams 0 through 64. More... | |
QList< StreamInfo > | m_pmtTracks |
StreamInfo for 608 and 708 Captions seen in the PMT descriptor. More... | |
QList< TrackType > | m_pmtTrackTypes |
TrackType (608 or 708) for Captions seen in the PMT descriptor. More... | |
QList< StreamInfo > | m_streamTracks |
StreamInfo for 608 and 708 Captions seen in the caption stream itself but not seen in the PMT. More... | |
QList< TrackType > | m_streamTrackTypes |
TrackType (608 or 708) for Captions seen in the caption stream itself but not seen in the PMT. More... | |
InteractiveTV * | m_itv {nullptr} |
MHEG/MHP decoder. More... | |
uint8_t * | m_audioSamples {nullptr} |
bool | m_disablePassthru {false} |
AudioInfo | m_audioIn |
AudioInfo | m_audioOut |
bool | m_processFrames {true} |
bool | m_streamsChanged { false } |
bool | m_resetHardwareDecoders { false } |
std::chrono::milliseconds | m_audioReadAhead {100ms} |
QRecursiveMutex | m_avCodecLock |
![]() | |
MythPlayer * | m_parent {nullptr} |
ProgramInfo * | m_playbackInfo {nullptr} |
AudioPlayer * | m_audio {nullptr} |
MythMediaBuffer * | m_ringBuffer {nullptr} |
double | m_fps {29.97} |
int | m_fpsMultiplier {1} |
int | m_fpsSkip {0} |
uint | m_bitrate {4000} |
int | m_currentWidth {640} |
int | m_currentHeight {480} |
float | m_currentAspect {1.33333F} |
long long | m_framesPlayed {0} |
long long | m_framesRead {0} |
uint64_t | m_frameCounter {0} |
AVRational | m_totalDuration |
int | m_keyframeDist {-1} |
long long | m_lastKey {0} |
long long | m_indexOffset {0} |
MythAVCopy | m_copyFrame |
bool | m_nextDecodedFrameIsKeyFrame { false } |
EofState | m_atEof {kEofStateNone} |
bool | m_trackTotalDuration {false} |
bool | m_exitAfterDecoded {false} |
bool | m_transcoding {false} |
bool | m_hasFullPositionMap {false} |
bool | m_recordingHasPositionMap {false} |
bool | m_posmapStarted {false} |
MarkTypes | m_positionMapType {MARK_UNSET} |
QRecursiveMutex | m_positionMapLock |
std::vector< PosMapEntry > | m_positionMap |
frm_pos_map_t | m_frameToDurMap |
frm_pos_map_t | m_durToFrameMap |
QDateTime | m_lastPositionMapUpdate |
uint64_t | m_seekSnap {UINT64_MAX} |
bool | m_dontSyncPositionMap {false} |
bool | m_livetv {false} |
bool | m_watchingRecording {false} |
bool | m_hasKeyFrameAdjustTable {false} |
bool | m_getRawFrames {false} |
bool | m_getRawVideo {false} |
bool | m_errored {false} |
bool | m_waitingForChange {false} |
bool | m_justAfterChange {false} |
long long | m_readAdjust {0} |
int | m_videoRotation {0} |
uint | m_stereo3D {0} |
QRecursiveMutex | m_trackLock |
bool | m_decodeAllSubtitles { false } |
std::array< int, kTrackTypeCount > | m_currentTrack {} |
std::array< sinfo_vec_t, kTrackTypeCount > | m_tracks |
std::array< StreamInfo, kTrackTypeCount > | m_wantedTrack |
std::array< StreamInfo, kTrackTypeCount > | m_selectedTrack |
std::vector< int > | m_languagePreference |
language preferences for auto-selection of streams More... | |
MythCodecContext * | m_mythCodecCtx { nullptr } |
MythVideoProfile | m_videoDisplayProfile |
const VideoFrameTypes * | m_renderFormats { &MythVideoFrame::kDefaultRenderFormats } |
Definition at line 14 of file mythdvddecoder.h.
MythDVDDecoder::MythDVDDecoder | ( | MythPlayer * | Parent, |
const ProgramInfo & | PGInfo, | ||
PlayerFlags | Flags | ||
) |
Definition at line 17 of file mythdvddecoder.cpp.
|
override |
Definition at line 22 of file mythdvddecoder.cpp.
Reimplemented from AvFormatDecoder.
Definition at line 51 of file mythdvddecoder.cpp.
Referenced by ReadPacket().
|
overridevirtual |
Reimplemented from AvFormatDecoder.
Definition at line 58 of file mythdvddecoder.cpp.
Referenced by ReadPacket(), and StreamChangeCheck().
|
overridevirtual |
Demux, preprocess and possibly decode a frame of video/audio.
Reimplemented from AvFormatDecoder.
Definition at line 68 of file mythdvddecoder.cpp.
|
overrideprotectedvirtual |
Reimplemented from AvFormatDecoder.
Definition at line 74 of file mythdvddecoder.cpp.
|
overrideprotectedvirtual |
Reimplemented from AvFormatDecoder.
Definition at line 272 of file mythdvddecoder.cpp.
|
overrideprotectedvirtual |
Reimplemented from AvFormatDecoder.
Definition at line 333 of file mythdvddecoder.cpp.
|
overrideprotectedvirtual |
Reimplemented from AvFormatDecoder.
Definition at line 347 of file mythdvddecoder.cpp.
|
overrideprivatevirtual |
Reimplemented from AvFormatDecoder.
Definition at line 531 of file mythdvddecoder.cpp.
|
overrideprivatevirtual |
Seeks to the keyframe just before the desiredFrame if exact seeks is enabled, or the frame just after it if exact seeks is not enabled.
The seek is not made if framesPlayed is greater than the keyframe this would jump too. This means that frame-by-frame seeking after a keyframe must be done elsewhere.
If the seek is made the needflush parameter is set.
desiredFrame | frame we are attempting to seek to. |
needflush | set to true if a seek is made. |
Reimplemented from AvFormatDecoder.
Definition at line 542 of file mythdvddecoder.cpp.
|
overrideprivatevirtual |
Reimplemented from AvFormatDecoder.
Definition at line 553 of file mythdvddecoder.cpp.
|
overrideprivatevirtual |
Reimplemented from AvFormatDecoder.
Definition at line 393 of file mythdvddecoder.cpp.
Reimplemented from AvFormatDecoder.
Definition at line 594 of file mythdvddecoder.cpp.
|
overrideprivatevirtual |
Reimplemented from AvFormatDecoder.
Definition at line 634 of file mythdvddecoder.cpp.
|
private |
Definition at line 204 of file mythdvddecoder.cpp.
Referenced by ProcessDataPacket(), and ProcessVideoPacket().
|
private |
Definition at line 33 of file mythdvddecoder.cpp.
Referenced by CheckContext(), and ~MythDVDDecoder().
|
staticprivate |
Definition at line 42 of file mythdvddecoder.cpp.
Referenced by CheckContext(), ProcessVideoPacket(), ReadPacket(), and ~MythDVDDecoder().
|
private |
Definition at line 604 of file mythdvddecoder.cpp.
Referenced by DoFastForwardSeek(), and DoRewindSeek().
|
private |
Definition at line 43 of file mythdvddecoder.h.
Referenced by CheckContext(), ProcessDataPacket(), ProcessVideoPacket(), ReadPacket(), and ~MythDVDDecoder().
|
private |
Definition at line 44 of file mythdvddecoder.h.
Referenced by CheckContext(), ProcessDataPacket(), ReadPacket(), and ~MythDVDDecoder().
|
private |
Definition at line 45 of file mythdvddecoder.h.
Referenced by CheckContext(), ProcessDataPacket(), ProcessVideoPacket(), ReadPacket(), and ReleaseLastVideoPkt().
|
private |
Definition at line 46 of file mythdvddecoder.h.
Referenced by CheckContext(), ProcessVideoPacket(), and ReleaseLastVideoPkt().
|
private |
Definition at line 47 of file mythdvddecoder.h.
Referenced by CheckContext(), ProcessVideoPacket(), and ReadPacket().
|
private |
Definition at line 48 of file mythdvddecoder.h.
Referenced by CheckContext(), ProcessVideoFrame(), ProcessVideoPacket(), ReadPacket(), and ~MythDVDDecoder().