MythTV  master
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
DecoderBase Class Referenceabstract

#include <decoderbase.h>

Inheritance diagram for DecoderBase:
Inheritance graph
[legend]
Collaboration diagram for DecoderBase:
Collaboration graph
[legend]

Classes

struct  PosMapEntry
 

Public Member Functions

 DecoderBase (MythPlayer *parent, const ProgramInfo &pginfo)
 
virtual ~DecoderBase ()
 
virtual void Reset (bool reset_video_data, bool seek_reset, bool reset_file)
 
virtual int OpenFile (MythMediaBuffer *Buffer, bool novideo, TestBufferVec &testbuf)=0
 
virtual void SetEofState (EofState eof)
 
virtual void SetEof (bool 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 SetDisablePassThrough (bool disable)
 Disables AC3/DTS pass through. More...
 
virtual void ForceSetupAudioStream (void)
 
virtual void SetWatchingRecording (bool mode)
 
virtual bool GetFrame (DecodeType Type, bool &Retry)=0
 Demux, preprocess and possibly decode a frame of video/audio. More...
 
MythPlayerGetPlayer ()
 
virtual int GetNumChapters (void)
 
virtual int GetCurrentChapter (long long)
 
virtual void GetChapterTimes (QList< long long > &)
 
virtual long long GetChapter (int)
 
virtual bool DoRewind (long long desiredFrame, bool discardFrames=true)
 
virtual bool DoFastForward (long long desiredFrame, bool discardFrames=true)
 Skips ahead or rewinds to desiredFrame. More...
 
virtual void SetIdrOnlyKeyframes (bool)
 
uint64_t TranslatePositionFrameToMs (long long position, float fallback_framerate, const frm_dir_map_t &cutlist)
 
uint64_t TranslatePositionMsToFrame (uint64_t dur_ms, float fallback_framerate, const frm_dir_map_t &cutlist)
 
float GetVideoAspect (void) const
 
virtual int64_t NormalizeVideoTimecode (int64_t timecode)
 
virtual bool IsLastFrameKey (void) const =0
 
virtual void WriteStoredData (MythMediaBuffer *Buffer, bool storevid, long timecodeOffset)=0
 
virtual void ClearStoredData (void)
 
virtual void SetRawAudioState (bool state)
 
virtual bool GetRawAudioState (void) const
 
virtual void SetRawVideoState (bool state)
 
virtual bool GetRawVideoState (void) const
 
virtual long UpdateStoredFrameNum (long frame)=0
 
virtual double GetFPS (void) const
 
uint GetRawBitrate (void) const
 Returns the estimated bitrate if the video were played at normal speed. More...
 
virtual void UpdateFramesPlayed (void)
 
long long GetFramesRead (void) const
 
long long GetFramesPlayed (void) const
 
void SetFramesPlayed (long long newValue)
 
virtual QString GetCodecDecoderName (void) const =0
 
virtual QString GetRawEncodingType (void)
 
virtual MythCodecID GetVideoCodecID (void) const =0
 
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)
 
virtual void SeekReset (long long newkey, uint skipFrames, bool doFlush, bool discardFrames)
 
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)
 
virtual QString GetTrackDesc (uint Type, uint TrackNo)
 
virtual int SetTrack (uint Type, int 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)
 
virtual int GetTeletextDecoderType (void) const
 
virtual QString GetXDS (const QString &) const
 
virtual QByteArray GetSubHeader (uint)
 
virtual void GetAttachmentData (uint, QByteArray &, QByteArray &)
 
virtual bool SetAudioByComponentTag (int)
 
virtual bool SetVideoByComponentTag (int)
 
void SaveTotalDuration (void)
 
void ResetTotalDuration (void)
 
void SaveTotalFrames (void)
 
void TrackTotalDuration (bool track)
 
int GetfpsMultiplier (void) const
 
MythCodecContextGetMythCodecContext (void)
 
VideoDisplayProfileGetVideoDisplayProfile (void)
 
AVPixelFormat GetBestVideoFormat (AVPixelFormat *Formats)
 Find a suitable frame format that is mutually acceptable to the decoder and render device. More...
 

Static Public Member Functions

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)
 

Protected Member Functions

virtual int AutoSelectTrack (uint Type)
 Select best track. More...
 
void AutoSelectTracks (void)
 
void ResetTracks (void)
 
void FileChanged (void)
 
virtual bool DoRewindSeek (long long desiredFrame)
 
virtual void DoFastForwardSeek (long long desiredFrame, bool &needflush)
 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...
 
long long ConditionallyUpdatePosMap (long long desiredFrame)
 
long long GetLastFrameInPosMap (void) const
 
unsigned long GetPositionMapSize (void) const
 
long long GetKey (const PosMapEntry &entry) const
 

Protected Attributes

MythPlayerm_parent {nullptr}
 
ProgramInfom_playbackInfo {nullptr}
 
AudioPlayerm_audio {nullptr}
 
MythMediaBufferm_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}
 
QMutex m_positionMapLock {QMutex::Recursive}
 
std::vector< PosMapEntrym_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}
 
QMutex m_trackLock { QMutex::Recursive }
 
bool m_decodeAllSubtitles { false }
 
std::array< int, kTrackTypeCountm_currentTrack {}
 
std::array< sinfo_vec_t, kTrackTypeCountm_tracks
 
std::array< StreamInfo, kTrackTypeCountm_wantedTrack
 
std::array< StreamInfo, kTrackTypeCountm_selectedTrack
 
std::vector< int > m_languagePreference
 language preferences for auto-selection of streams More...
 
MythCodecContextm_mythCodecCtx { nullptr }
 
VideoDisplayProfile m_videoDisplayProfile
 

Detailed Description

Definition at line 120 of file decoderbase.h.

Constructor & Destructor Documentation

◆ DecoderBase()

DecoderBase::DecoderBase ( MythPlayer parent,
const ProgramInfo pginfo 
)

Definition at line 17 of file decoderbase.cpp.

◆ ~DecoderBase()

DecoderBase::~DecoderBase ( )
virtual

Definition at line 31 of file decoderbase.cpp.

Member Function Documentation

◆ Reset()

void DecoderBase::Reset ( bool  reset_video_data,
bool  seek_reset,
bool  reset_file 
)
virtual

◆ OpenFile()

virtual int DecoderBase::OpenFile ( MythMediaBuffer Buffer,
bool  novideo,
TestBufferVec testbuf 
)
pure virtual

Implemented in AvFormatDecoder, and DummyDecoder.

Referenced by MythPlayer::OpenFile().

◆ SetEofState()

virtual void DecoderBase::SetEofState ( EofState  eof)
inlinevirtual

Definition at line 131 of file decoderbase.h.

Referenced by Reset(), and MythPlayer::SetEof().

◆ SetEof()

virtual void DecoderBase::SetEof ( bool  eof)
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 132 of file decoderbase.h.

Referenced by AvFormatDecoder::SetEof().

◆ GetEof()

EofState DecoderBase::GetEof ( void  )
inline

Definition at line 135 of file decoderbase.h.

Referenced by MythPlayer::GetEof(), and MythPlayerUI::VideoLoop().

◆ SetSeekSnap()

void DecoderBase::SetSeekSnap ( uint64_t  snap)
inline

◆ GetSeekSnap()

uint64_t DecoderBase::GetSeekSnap ( void  ) const
inline

Definition at line 138 of file decoderbase.h.

Referenced by AvFormatDecoder::DoFastForward(), and AvFormatDecoder::SeekReset().

◆ SetLiveTVMode()

void DecoderBase::SetLiveTVMode ( bool  live)
inline

Definition at line 139 of file decoderbase.h.

Referenced by MythPlayer::OpenFile().

◆ SetProgramInfo()

void DecoderBase::SetProgramInfo ( const ProgramInfo pginfo)

◆ SetDisablePassThrough()

virtual void DecoderBase::SetDisablePassThrough ( bool  disable)
inlinevirtual

Disables AC3/DTS pass through.

Reimplemented in AvFormatDecoder.

Definition at line 145 of file decoderbase.h.

Referenced by MythPlayer::SetDisablePassThrough().

◆ ForceSetupAudioStream()

virtual void DecoderBase::ForceSetupAudioStream ( void  )
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 147 of file decoderbase.h.

Referenced by MythPlayer::ForceSetupAudioStream().

◆ SetWatchingRecording()

void DecoderBase::SetWatchingRecording ( bool  mode)
virtual

Definition at line 76 of file decoderbase.cpp.

Referenced by MythPlayer::OpenFile(), and MythPlayer::SetWatchingRecording().

◆ GetFrame()

virtual bool DecoderBase::GetFrame ( DecodeType  Type,
bool Retry 
)
pure virtual

Demux, preprocess and possibly decode a frame of video/audio.

Implemented in DummyDecoder, MythDVDDecoder, and AvFormatDecoder.

Referenced by DoFastForward(), and MythPlayer::DoGetFrame().

◆ GetPlayer()

MythPlayer* DecoderBase::GetPlayer ( )
inline

◆ GetNumChapters()

virtual int DecoderBase::GetNumChapters ( void  )
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 154 of file decoderbase.h.

Referenced by MythPlayer::GetNumChapters().

◆ GetCurrentChapter()

virtual int DecoderBase::GetCurrentChapter ( long long  )
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 155 of file decoderbase.h.

Referenced by MythPlayer::GetCurrentChapter().

◆ GetChapterTimes()

virtual void DecoderBase::GetChapterTimes ( QList< long long > &  )
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 156 of file decoderbase.h.

Referenced by MythPlayer::GetChapterTimes().

◆ GetChapter()

virtual long long DecoderBase::GetChapter ( int  )
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 157 of file decoderbase.h.

Referenced by MythPlayer::GetChapter().

◆ DoRewind()

bool DecoderBase::DoRewind ( long long  desiredFrame,
bool  discardFrames = true 
)
virtual

◆ DoFastForward()

bool DecoderBase::DoFastForward ( long long  desiredFrame,
bool  discardFrames = true 
)
virtual

Skips ahead or rewinds to desiredFrame.

If discardFrames is true and cached frames are released and playback continues at the desiredFrame, if it is not any interviening frames between the last frame already in the buffer and the desiredFrame are released, but none of the frames decoded at the time this is called are released.

Reimplemented in AvFormatDecoder.

Definition at line 704 of file decoderbase.cpp.

Referenced by MythPlayer::DecoderGetFrameFFREW(), MythPlayer::DecoderLoop(), and AvFormatDecoder::DoFastForward().

◆ SetIdrOnlyKeyframes()

virtual void DecoderBase::SetIdrOnlyKeyframes ( bool  )
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 160 of file decoderbase.h.

Referenced by MythCommFlagPlayer::RebuildSeekTable().

◆ TranslatePositionAbsToRel()

uint64_t DecoderBase::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

◆ TranslatePositionRelToAbs()

uint64_t DecoderBase::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

◆ TranslatePosition()

uint64_t DecoderBase::TranslatePosition ( const frm_pos_map_t map,
long long  key,
float  fallback_ratio 
)
static

◆ TranslatePositionFrameToMs()

uint64_t DecoderBase::TranslatePositionFrameToMs ( long long  position,
float  fallback_framerate,
const frm_dir_map_t cutlist 
)

Definition at line 1305 of file decoderbase.cpp.

Referenced by DeleteMap::TranslatePositionFrameToMs().

◆ TranslatePositionMsToFrame()

uint64_t DecoderBase::TranslatePositionMsToFrame ( uint64_t  dur_ms,
float  fallback_framerate,
const frm_dir_map_t cutlist 
)

Definition at line 1333 of file decoderbase.cpp.

Referenced by DeleteMap::TranslatePositionMsToFrame().

◆ GetVideoAspect()

float DecoderBase::GetVideoAspect ( void  ) const
inline

Definition at line 182 of file decoderbase.h.

Referenced by Transcode::TranscodeFile().

◆ NormalizeVideoTimecode()

virtual int64_t DecoderBase::NormalizeVideoTimecode ( int64_t  timecode)
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 184 of file decoderbase.h.

Referenced by SubtitleScreen::DisplayTextSubtitles().

◆ IsLastFrameKey()

virtual bool DecoderBase::IsLastFrameKey ( void  ) const
pure virtual

◆ WriteStoredData()

virtual void DecoderBase::WriteStoredData ( MythMediaBuffer Buffer,
bool  storevid,
long  timecodeOffset 
)
pure virtual

◆ ClearStoredData()

virtual void DecoderBase::ClearStoredData ( void  )
inlinevirtual

Definition at line 189 of file decoderbase.h.

Referenced by MythTranscodePlayer::TranscodeGetNextFrame().

◆ SetRawAudioState()

virtual void DecoderBase::SetRawAudioState ( bool  state)
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 190 of file decoderbase.h.

Referenced by MythTranscodePlayer::InitForTranscode().

◆ GetRawAudioState()

virtual bool DecoderBase::GetRawAudioState ( void  ) const
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 191 of file decoderbase.h.

Referenced by MythPlayer::GetRawAudioState().

◆ SetRawVideoState()

virtual void DecoderBase::SetRawVideoState ( bool  state)
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 192 of file decoderbase.h.

Referenced by MythTranscodePlayer::InitForTranscode().

◆ GetRawVideoState()

virtual bool DecoderBase::GetRawVideoState ( void  ) const
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 193 of file decoderbase.h.

Referenced by MythTranscodePlayer::WriteStoredData().

◆ UpdateStoredFrameNum()

virtual long DecoderBase::UpdateStoredFrameNum ( long  frame)
pure virtual

◆ GetFPS()

virtual double DecoderBase::GetFPS ( void  ) const
inlinevirtual

◆ GetRawBitrate()

uint DecoderBase::GetRawBitrate ( void  ) const
inline

Returns the estimated bitrate if the video were played at normal speed.

Definition at line 199 of file decoderbase.h.

Referenced by MythPlayerUI::JumpToProgram(), MythPlayerUI::JumpToStream(), and MythPlayerUI::SwitchToProgram().

◆ UpdateFramesPlayed()

void DecoderBase::UpdateFramesPlayed ( void  )
virtual

◆ GetFramesRead()

long long DecoderBase::GetFramesRead ( void  ) const
inline

◆ GetFramesPlayed()

long long DecoderBase::GetFramesPlayed ( void  ) const
inline

Definition at line 203 of file decoderbase.h.

Referenced by MythPlayer::DecoderGetFrameREW().

◆ SetFramesPlayed()

void DecoderBase::SetFramesPlayed ( long long  newValue)
inline

Definition at line 204 of file decoderbase.h.

◆ GetCodecDecoderName()

virtual QString DecoderBase::GetCodecDecoderName ( void  ) const
pure virtual

◆ GetRawEncodingType()

virtual QString DecoderBase::GetRawEncodingType ( void  )
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 207 of file decoderbase.h.

Referenced by MythPlayerUI::GetCodecDescription().

◆ GetVideoCodecID()

virtual MythCodecID DecoderBase::GetVideoCodecID ( void  ) const
pure virtual

◆ ResetPosMap()

void DecoderBase::ResetPosMap ( void  )
virtual

◆ SyncPositionMap()

bool DecoderBase::SyncPositionMap ( void  )
virtual

Updates the position map used for skipping frames.

There are different sources for position maps, depending on where we are getting the stream from.

positionmap sources: live tv:

  1. remote encoder
  2. stream parsing decide keyframedist based on samples from remote encoder

watching recording:

  1. initial fill from db
  2. incremental from remote encoder, until it finishes recording
  3. then db again (which should be the final time)
  4. stream parsing decide keyframedist based on which table in db

watching prerecorded:

  1. initial fill from db is all that's needed

Reimplemented in DummyDecoder.

Definition at line 316 of file decoderbase.cpp.

Referenced by ConditionallyUpdatePosMap(), MythPlayer::DecoderLoop(), DoFastForward(), AvFormatDecoder::HandleGopStart(), AvFormatDecoder::OpenFile(), MythBDDecoder::Reset(), MythDVDDecoder::Reset(), SetWatchingRecording(), MythBDDecoder::StreamChangeCheck(), MythDVDDecoder::StreamChangeCheck(), and TranslatePositionFrameToMs().

◆ PosMapFromDb()

bool DecoderBase::PosMapFromDb ( void  )
virtual

Definition at line 89 of file decoderbase.cpp.

Referenced by SyncPositionMap().

◆ PosMapFromEnc()

bool DecoderBase::PosMapFromEnc ( void  )
virtual

Queries encoder for position map data that has not been committed to the DB yet.

PosMapFromDb(void) must be called first in order to set positionMapType and keyframedist correctly.

Definition at line 217 of file decoderbase.cpp.

Referenced by SyncPositionMap().

◆ FindPosition()

bool DecoderBase::FindPosition ( long long  desired_value,
bool  search_adjusted,
int &  lower_bound,
int &  upper_bound 
)
virtual

Definition at line 414 of file decoderbase.cpp.

Referenced by DoFastForwardSeek(), and DoRewindSeek().

◆ SavePositionMapDelta()

uint64_t DecoderBase::SavePositionMapDelta ( long long  first_frame,
long long  last_frame 
)

Definition at line 494 of file decoderbase.cpp.

Referenced by MythRebuildSaver::run().

◆ SeekReset()

void DecoderBase::SeekReset ( long long  newkey,
uint  skipFrames,
bool  doFlush,
bool  discardFrames 
)
virtual

◆ SetTranscoding()

void DecoderBase::SetTranscoding ( bool  value)
inline

Definition at line 222 of file decoderbase.h.

Referenced by MythPlayer::OpenFile(), and MythTranscodePlayer::SetTranscoding().

◆ IsErrored()

bool DecoderBase::IsErrored ( ) const
inline

Definition at line 224 of file decoderbase.h.

Referenced by MythPlayer::OpenFile(), and MythPlayer::ResetPlaying().

◆ HasPositionMap()

bool DecoderBase::HasPositionMap ( void  ) const
inline

Definition at line 226 of file decoderbase.h.

Referenced by MythCommFlagPlayer::RebuildSeekTable().

◆ SetWaitForChange()

void DecoderBase::SetWaitForChange ( void  )

Definition at line 893 of file decoderbase.cpp.

Referenced by MythPlayerUI::SwitchToProgram().

◆ GetWaitForChange()

bool DecoderBase::GetWaitForChange ( void  ) const

Definition at line 898 of file decoderbase.cpp.

Referenced by MythPlayerUI::EventLoop().

◆ SetReadAdjust()

void DecoderBase::SetReadAdjust ( long long  adjust)

Definition at line 888 of file decoderbase.cpp.

Referenced by MythPlayerUI::SwitchToProgram().

◆ SetDecodeAllSubtitles()

void DecoderBase::SetDecodeAllSubtitles ( bool  DecodeAll)

Definition at line 909 of file decoderbase.cpp.

Referenced by MythCCExtractorPlayer::run().

◆ GetTracks()

QStringList DecoderBase::GetTracks ( uint  Type)
virtual

Definition at line 916 of file decoderbase.cpp.

Referenced by MythPlayerCaptionsUI::GetTracks().

◆ GetTrackCount()

uint DecoderBase::GetTrackCount ( uint  Type)
virtual

◆ GetTrackLanguageIndex()

int DecoderBase::GetTrackLanguageIndex ( uint  Type,
uint  TrackNo 
)
virtual

Definition at line 925 of file decoderbase.cpp.

Referenced by MythPlayerCaptionsUI::EnableCaptions().

◆ GetTrackDesc()

QString DecoderBase::GetTrackDesc ( uint  Type,
uint  TrackNo 
)
virtual

◆ SetTrack()

int DecoderBase::SetTrack ( uint  Type,
int  TrackNo 
)
virtual

Reimplemented in AvFormatDecoder.

Definition at line 957 of file decoderbase.cpp.

Referenced by ChangeTrack(), AvFormatDecoder::SetTrack(), and MythPlayerCaptionsUI::SetTrack().

◆ GetTrack()

int DecoderBase::GetTrack ( uint  Type)

◆ GetTrackInfo()

StreamInfo DecoderBase::GetTrackInfo ( uint  Type,
uint  TrackNo 
)

◆ ChangeTrack()

int DecoderBase::ChangeTrack ( uint  Type,
int  Dir 
)

Definition at line 988 of file decoderbase.cpp.

Referenced by MythPlayerCaptionsUI::ChangeTrack().

◆ InsertTrack()

bool DecoderBase::InsertTrack ( uint  Type,
const StreamInfo Info 
)
virtual

Definition at line 1015 of file decoderbase.cpp.

Referenced by CC708Reader::DefineWindow().

◆ NextTrack()

int DecoderBase::NextTrack ( uint  Type)

Definition at line 1004 of file decoderbase.cpp.

Referenced by MythPlayerCaptionsUI::ChangeCaptionTrack().

◆ GetTeletextDecoderType()

virtual int DecoderBase::GetTeletextDecoderType ( void  ) const
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 246 of file decoderbase.h.

◆ GetXDS()

virtual QString DecoderBase::GetXDS ( const QString &  ) const
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 248 of file decoderbase.h.

Referenced by MythPlayer::GetXDS().

◆ GetSubHeader()

virtual QByteArray DecoderBase::GetSubHeader ( uint  )
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 249 of file decoderbase.h.

Referenced by SubtitleScreen::InitialiseAssTrack().

◆ GetAttachmentData()

virtual void DecoderBase::GetAttachmentData ( uint  ,
QByteArray &  ,
QByteArray &   
)
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 250 of file decoderbase.h.

Referenced by SubtitleScreen::LoadAssFonts().

◆ SetAudioByComponentTag()

virtual bool DecoderBase::SetAudioByComponentTag ( int  )
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 254 of file decoderbase.h.

Referenced by MythPlayerCaptionsUI::SetAudioByComponentTag().

◆ SetVideoByComponentTag()

virtual bool DecoderBase::SetVideoByComponentTag ( int  )
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 255 of file decoderbase.h.

Referenced by MythPlayerCaptionsUI::SetVideoByComponentTag().

◆ SaveTotalDuration()

void DecoderBase::SaveTotalDuration ( void  )

Definition at line 1235 of file decoderbase.cpp.

Referenced by MythPlayer::SaveTotalDuration().

◆ ResetTotalDuration()

void DecoderBase::ResetTotalDuration ( void  )
inline

Definition at line 258 of file decoderbase.h.

Referenced by MythPlayer::ResetTotalDuration().

◆ SaveTotalFrames()

void DecoderBase::SaveTotalFrames ( void  )

Definition at line 1243 of file decoderbase.cpp.

Referenced by MythPlayer::SaveTotalFrames().

◆ TrackTotalDuration()

void DecoderBase::TrackTotalDuration ( bool  track)
inline

Definition at line 260 of file decoderbase.h.

Referenced by MythCommFlagPlayer::RebuildSeekTable().

◆ GetfpsMultiplier()

int DecoderBase::GetfpsMultiplier ( void  ) const
inline

◆ GetMythCodecContext()

MythCodecContext* DecoderBase::GetMythCodecContext ( void  )
inline

Definition at line 262 of file decoderbase.h.

Referenced by MythDVDPlayer::AutoDeint().

◆ GetVideoDisplayProfile()

VideoDisplayProfile* DecoderBase::GetVideoDisplayProfile ( void  )
inline

Definition at line 263 of file decoderbase.h.

◆ GetBestVideoFormat()

AVPixelFormat DecoderBase::GetBestVideoFormat ( AVPixelFormat *  Formats)

Find a suitable frame format that is mutually acceptable to the decoder and render device.

Note
Most hardware decoders will only provide one software frame format.
Currently only the OpenGL renderer supports anything other than FMT_YV12/AV_PIX_FMT_YUV420P

Definition at line 1442 of file decoderbase.cpp.

Referenced by MythCodecContext::RetrieveHWFrame().

◆ AutoSelectTrack()

int DecoderBase::AutoSelectTrack ( uint  Type)
protectedvirtual

Select best track.

In case there's only one track available, always choose it.

If there is a user selected track we try to find it.

If we can't find the user selected track we try to picked according to the ISO639Language[0..] settings.

In case there are no ISOLanguage[0..] settings, or no preferred language is found, the first found track stream is chosen

Returns
track if a track was selected, -1 otherwise

Reimplemented in AvFormatDecoder.

Definition at line 1048 of file decoderbase.cpp.

Referenced by AvFormatDecoder::AutoSelectTrack(), and AutoSelectTracks().

◆ AutoSelectTracks()

void DecoderBase::AutoSelectTracks ( void  )
protected

Definition at line 1139 of file decoderbase.cpp.

Referenced by AvFormatDecoder::GetFrame(), and AvFormatDecoder::OpenFile().

◆ ResetTracks()

void DecoderBase::ResetTracks ( void  )
protected

Definition at line 1145 of file decoderbase.cpp.

Referenced by DecoderBase(), and AvFormatDecoder::ScanStreams().

◆ FileChanged()

void DecoderBase::FileChanged ( void  )
protected

Definition at line 875 of file decoderbase.cpp.

Referenced by AvFormatDecoder::GetFrame().

◆ DoRewindSeek()

bool DecoderBase::DoRewindSeek ( long long  desiredFrame)
protectedvirtual

Reimplemented in MythDVDDecoder, AvFormatDecoder, and MythBDDecoder.

Definition at line 583 of file decoderbase.cpp.

Referenced by DoRewind(), and AvFormatDecoder::DoRewindSeek().

◆ DoFastForwardSeek()

void DecoderBase::DoFastForwardSeek ( long long  desiredFrame,
bool needflush 
)
protectedvirtual

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.

Parameters
desiredFrameframe we are attempting to seek to.
needflushset to true if a seek is made.

Reimplemented in MythDVDDecoder, AvFormatDecoder, and MythBDDecoder.

Definition at line 824 of file decoderbase.cpp.

Referenced by DoFastForward(), and AvFormatDecoder::DoFastForwardSeek().

◆ ConditionallyUpdatePosMap()

long long DecoderBase::ConditionallyUpdatePosMap ( long long  desiredFrame)
protected

Definition at line 661 of file decoderbase.cpp.

Referenced by DoFastForward(), and DoRewindSeek().

◆ GetLastFrameInPosMap()

long long DecoderBase::GetLastFrameInPosMap ( void  ) const
protected

Definition at line 650 of file decoderbase.cpp.

Referenced by ConditionallyUpdatePosMap(), and DoFastForward().

◆ GetPositionMapSize()

unsigned long DecoderBase::GetPositionMapSize ( void  ) const
protected

Definition at line 288 of file decoderbase.cpp.

Referenced by DoRewindSeek(), HasPositionMap(), and SyncPositionMap().

◆ GetKey()

long long DecoderBase::GetKey ( const PosMapEntry entry) const
protected

Member Data Documentation

◆ m_parent

MythPlayer* DecoderBase::m_parent {nullptr}
protected

◆ m_playbackInfo

ProgramInfo* DecoderBase::m_playbackInfo {nullptr}
protected

◆ m_audio

AudioPlayer* DecoderBase::m_audio {nullptr}
protected

◆ m_ringBuffer

MythMediaBuffer* DecoderBase::m_ringBuffer {nullptr}
protected

◆ m_fps

double DecoderBase::m_fps {29.97}
protected

◆ m_fpsMultiplier

int DecoderBase::m_fpsMultiplier {1}
protected

◆ m_fpsSkip

int DecoderBase::m_fpsSkip {0}
protected

◆ m_bitrate

uint DecoderBase::m_bitrate {4000}
protected

◆ m_currentWidth

int DecoderBase::m_currentWidth {640}
protected

◆ m_currentHeight

int DecoderBase::m_currentHeight {480}
protected

◆ m_currentAspect

float DecoderBase::m_currentAspect {1.33333F}
protected

◆ m_framesPlayed

long long DecoderBase::m_framesPlayed {0}
protected

◆ m_framesRead

long long DecoderBase::m_framesRead {0}
protected

◆ m_frameCounter

uint64_t DecoderBase::m_frameCounter {0}
protected

◆ m_totalDuration

AVRational DecoderBase::m_totalDuration
protected

◆ m_keyframeDist

int DecoderBase::m_keyframeDist {-1}
protected

◆ m_lastKey

long long DecoderBase::m_lastKey {0}
protected

◆ m_indexOffset

long long DecoderBase::m_indexOffset {0}
protected

Definition at line 305 of file decoderbase.h.

Referenced by FindPosition(), GetKey(), PosMapFromDb(), and PosMapFromEnc().

◆ m_copyFrame

MythAVCopy DecoderBase::m_copyFrame
protected

Definition at line 306 of file decoderbase.h.

◆ m_nextDecodedFrameIsKeyFrame

bool DecoderBase::m_nextDecodedFrameIsKeyFrame { false }
protected

◆ m_atEof

EofState DecoderBase::m_atEof {kEofStateNone}
protected

Definition at line 309 of file decoderbase.h.

Referenced by DoFastForward(), GetEof(), AvFormatDecoder::SeekReset(), SetEof(), and SetEofState().

◆ m_trackTotalDuration

bool DecoderBase::m_trackTotalDuration {false}
protected

◆ m_exitAfterDecoded

bool DecoderBase::m_exitAfterDecoded {false}
protected

Definition at line 316 of file decoderbase.h.

Referenced by DoFastForward(), and AvFormatDecoder::PreProcessVideoPacket().

◆ m_transcoding

bool DecoderBase::m_transcoding {false}
protected

Definition at line 317 of file decoderbase.h.

Referenced by DoFastForward(), and SetTranscoding().

◆ m_hasFullPositionMap

bool DecoderBase::m_hasFullPositionMap {false}
protected

Definition at line 319 of file decoderbase.h.

Referenced by AvFormatDecoder::HandleGopStart(), and AvFormatDecoder::OpenFile().

◆ m_recordingHasPositionMap

bool DecoderBase::m_recordingHasPositionMap {false}
protected

◆ m_posmapStarted

bool DecoderBase::m_posmapStarted {false}
protected

Definition at line 321 of file decoderbase.h.

Referenced by ResetPosMap(), SetWatchingRecording(), and SyncPositionMap().

◆ m_positionMapType

MarkTypes DecoderBase::m_positionMapType {MARK_UNSET}
protected

Definition at line 322 of file decoderbase.h.

Referenced by AvFormatDecoder::OpenFile(), PosMapFromDb(), and SavePositionMapDelta().

◆ m_positionMapLock

QMutex DecoderBase::m_positionMapLock {QMutex::Recursive}
mutableprotected

◆ m_positionMap

std::vector<PosMapEntry> DecoderBase::m_positionMap
protected

◆ m_frameToDurMap

frm_pos_map_t DecoderBase::m_frameToDurMap
protected

◆ m_durToFrameMap

frm_pos_map_t DecoderBase::m_durToFrameMap
protected

◆ m_lastPositionMapUpdate

QDateTime DecoderBase::m_lastPositionMapUpdate
mutableprotected

Definition at line 328 of file decoderbase.h.

Referenced by SyncPositionMap(), and TranslatePositionFrameToMs().

◆ m_seekSnap

uint64_t DecoderBase::m_seekSnap {UINT64_MAX}
protected

◆ m_dontSyncPositionMap

bool DecoderBase::m_dontSyncPositionMap {false}
protected

Definition at line 331 of file decoderbase.h.

Referenced by AvFormatDecoder::OpenFile(), Reset(), and SyncPositionMap().

◆ m_livetv

bool DecoderBase::m_livetv {false}
protected

◆ m_watchingRecording

bool DecoderBase::m_watchingRecording {false}
protected

◆ m_hasKeyFrameAdjustTable

bool DecoderBase::m_hasKeyFrameAdjustTable {false}
protected

Definition at line 335 of file decoderbase.h.

Referenced by DoFastForwardSeek(), DoRewindSeek(), and GetKey().

◆ m_getRawFrames

bool DecoderBase::m_getRawFrames {false}
protected

◆ m_getRawVideo

bool DecoderBase::m_getRawVideo {false}
protected

Definition at line 338 of file decoderbase.h.

Referenced by GetRawVideoState(), and SetRawVideoState().

◆ m_errored

bool DecoderBase::m_errored {false}
protected

Definition at line 340 of file decoderbase.h.

Referenced by IsErrored().

◆ m_waitingForChange

bool DecoderBase::m_waitingForChange {false}
protected

◆ m_justAfterChange

bool DecoderBase::m_justAfterChange {false}
protected

Definition at line 343 of file decoderbase.h.

Referenced by FileChanged(), and AvFormatDecoder::PreProcessVideoPacket().

◆ m_readAdjust

long long DecoderBase::m_readAdjust {0}
protected

Definition at line 344 of file decoderbase.h.

Referenced by AvFormatDecoder::GetFrame(), SeekReset(), and SetReadAdjust().

◆ m_videoRotation

int DecoderBase::m_videoRotation {0}
protected

◆ m_stereo3D

uint DecoderBase::m_stereo3D {0}
protected

◆ m_trackLock

QMutex DecoderBase::m_trackLock { QMutex::Recursive }
protected

◆ m_decodeAllSubtitles

bool DecoderBase::m_decodeAllSubtitles { false }
protected

◆ m_currentTrack

std::array<int, kTrackTypeCount> DecoderBase::m_currentTrack {}
protected

◆ m_tracks

std::array<sinfo_vec_t,kTrackTypeCount> DecoderBase::m_tracks
protected

◆ m_wantedTrack

std::array<StreamInfo, kTrackTypeCount> DecoderBase::m_wantedTrack
protected

Definition at line 353 of file decoderbase.h.

Referenced by AvFormatDecoder::AutoSelectAudioTrack(), AutoSelectTrack(), and SetTrack().

◆ m_selectedTrack

std::array<StreamInfo, kTrackTypeCount> DecoderBase::m_selectedTrack
protected

◆ m_languagePreference

std::vector<int> DecoderBase::m_languagePreference
protected

language preferences for auto-selection of streams

Definition at line 357 of file decoderbase.h.

Referenced by AvFormatDecoder::AutoSelectAudioTrack(), and AutoSelectTrack().

◆ m_mythCodecCtx

MythCodecContext* DecoderBase::m_mythCodecCtx { nullptr }
protected

◆ m_videoDisplayProfile

VideoDisplayProfile DecoderBase::m_videoDisplayProfile
protected

The documentation for this class was generated from the following files: