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)
 
 DecoderBase (const DecoderBase &rhs)
 
virtual ~DecoderBase ()
 
virtual void Reset (bool reset_video_data, bool seek_reset, bool reset_file)
 
virtual int OpenFile (MythMediaBuffer *Buffer, bool novideo, char testbuf[kDecoderProbeBufferSize], int testbufsize=kDecoderProbeBufferSize)=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}
 
unsigned long long 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}
 
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}
 
QMutex m_trackLock { QMutex::Recursive }
 
bool m_decodeAllSubtitles { false }
 
int m_currentTrack [kTrackTypeCount] { -1 }
 
vector< StreamInfom_tracks [kTrackTypeCount]
 
StreamInfo m_wantedTrack [kTrackTypeCount]
 
StreamInfo m_selectedTrack [kTrackTypeCount]
 
vector< int > m_languagePreference
 language preferences for auto-selection of streams More...
 
MythCodecContextm_mythCodecCtx { nullptr }
 
VideoDisplayProfile m_videoDisplayProfile
 

Detailed Description

Definition at line 119 of file decoderbase.h.

Constructor & Destructor Documentation

◆ DecoderBase() [1/2]

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

Definition at line 18 of file decoderbase.cpp.

◆ DecoderBase() [2/2]

DecoderBase::DecoderBase ( const DecoderBase rhs)

◆ ~DecoderBase()

DecoderBase::~DecoderBase ( )
virtual

Definition at line 32 of file decoderbase.cpp.

Member Function Documentation

◆ Reset()

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

Reimplemented in AvFormatDecoder, MythDVDDecoder, and MythBDDecoder.

Definition at line 43 of file decoderbase.cpp.

Referenced by AvFormatDecoder::Reset(), and MythPlayer::ResetPlaying().

◆ OpenFile()

virtual int DecoderBase::OpenFile ( MythMediaBuffer Buffer,
bool  novideo,
char  testbuf[kDecoderProbeBufferSize],
int  testbufsize = kDecoderProbeBufferSize 
)
pure virtual

Implemented in AvFormatDecoder, and NuppelDecoder.

Referenced by MythPlayer::OpenFile().

◆ SetEofState()

virtual void DecoderBase::SetEofState ( EofState  eof)
inlinevirtual

Definition at line 132 of file decoderbase.h.

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

◆ SetEof()

virtual void DecoderBase::SetEof ( bool  eof)
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 133 of file decoderbase.h.

Referenced by NuppelDecoder::GetFrame(), and AvFormatDecoder::SetEof().

◆ GetEof()

EofState DecoderBase::GetEof ( void  )
inline

Definition at line 136 of file decoderbase.h.

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

◆ SetSeekSnap()

void DecoderBase::SetSeekSnap ( uint64_t  snap)
inline

◆ GetSeekSnap()

uint64_t DecoderBase::GetSeekSnap ( void  ) const
inline

Definition at line 139 of file decoderbase.h.

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

◆ SetLiveTVMode()

void DecoderBase::SetLiveTVMode ( bool  live)
inline

Definition at line 140 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 146 of file decoderbase.h.

Referenced by MythPlayer::SetDisablePassThrough().

◆ ForceSetupAudioStream()

virtual void DecoderBase::ForceSetupAudioStream ( void  )
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 148 of file decoderbase.h.

Referenced by MythPlayer::ForceSetupAudioStream().

◆ SetWatchingRecording()

void DecoderBase::SetWatchingRecording ( bool  mode)
virtual

Definition at line 77 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 AvFormatDecoder, NuppelDecoder, MythDVDDecoder, and DummyDecoder.

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

◆ GetPlayer()

MythPlayer* DecoderBase::GetPlayer ( )
inline

◆ GetNumChapters()

virtual int DecoderBase::GetNumChapters ( void  )
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 155 of file decoderbase.h.

Referenced by MythPlayer::GetNumChapters().

◆ GetCurrentChapter()

virtual int DecoderBase::GetCurrentChapter ( long long  )
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 156 of file decoderbase.h.

Referenced by MythPlayer::GetCurrentChapter().

◆ GetChapterTimes()

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

Reimplemented in AvFormatDecoder.

Definition at line 157 of file decoderbase.h.

Referenced by MythPlayer::GetChapterTimes().

◆ GetChapter()

virtual long long DecoderBase::GetChapter ( int  )
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 158 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 709 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 161 of file decoderbase.h.

◆ 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 1309 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 1337 of file decoderbase.cpp.

Referenced by DeleteMap::TranslatePositionMsToFrame().

◆ GetVideoAspect()

float DecoderBase::GetVideoAspect ( void  ) const
inline

Definition at line 183 of file decoderbase.h.

Referenced by Transcode::TranscodeFile().

◆ NormalizeVideoTimecode()

virtual int64_t DecoderBase::NormalizeVideoTimecode ( int64_t  timecode)
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 185 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

Reimplemented in NuppelDecoder.

Definition at line 190 of file decoderbase.h.

Referenced by MythPlayer::TranscodeGetNextFrame().

◆ SetRawAudioState()

virtual void DecoderBase::SetRawAudioState ( bool  state)
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 191 of file decoderbase.h.

Referenced by MythPlayer::InitForTranscode().

◆ GetRawAudioState()

virtual bool DecoderBase::GetRawAudioState ( void  ) const
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 192 of file decoderbase.h.

Referenced by MythPlayer::GetRawAudioState().

◆ SetRawVideoState()

virtual void DecoderBase::SetRawVideoState ( bool  state)
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 193 of file decoderbase.h.

Referenced by MythPlayer::InitForTranscode().

◆ GetRawVideoState()

virtual bool DecoderBase::GetRawVideoState ( void  ) const
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 194 of file decoderbase.h.

Referenced by MythPlayer::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 200 of file decoderbase.h.

Referenced by NuppelDecoder::GetFrame(), MythPlayer::JumpToProgram(), MythPlayer::JumpToStream(), NuppelDecoder::OpenFile(), and MythPlayer::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 204 of file decoderbase.h.

Referenced by MythPlayer::DecoderGetFrameREW().

◆ SetFramesPlayed()

void DecoderBase::SetFramesPlayed ( long long  newValue)
inline

Definition at line 205 of file decoderbase.h.

◆ GetCodecDecoderName()

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

◆ GetRawEncodingType()

virtual QString DecoderBase::GetRawEncodingType ( void  )
inlinevirtual

Reimplemented in AvFormatDecoder, and NuppelDecoder.

Definition at line 208 of file decoderbase.h.

Referenced by MythPlayer::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 320 of file decoderbase.cpp.

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

◆ PosMapFromDb()

bool DecoderBase::PosMapFromDb ( void  )
virtual

Definition at line 90 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 220 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 418 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 498 of file decoderbase.cpp.

◆ SeekReset()

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

◆ SetTranscoding()

void DecoderBase::SetTranscoding ( bool  value)
inline

Definition at line 223 of file decoderbase.h.

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

◆ IsErrored()

bool DecoderBase::IsErrored ( ) const
inline

Definition at line 225 of file decoderbase.h.

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

◆ HasPositionMap()

bool DecoderBase::HasPositionMap ( void  ) const
inline

Definition at line 227 of file decoderbase.h.

◆ SetWaitForChange()

void DecoderBase::SetWaitForChange ( void  )

Definition at line 898 of file decoderbase.cpp.

Referenced by MythPlayer::SwitchToProgram().

◆ GetWaitForChange()

bool DecoderBase::GetWaitForChange ( void  ) const

Definition at line 903 of file decoderbase.cpp.

Referenced by MythPlayer::EventLoop().

◆ SetReadAdjust()

void DecoderBase::SetReadAdjust ( long long  adjust)

Definition at line 893 of file decoderbase.cpp.

Referenced by MythPlayer::SwitchToProgram().

◆ SetDecodeAllSubtitles()

void DecoderBase::SetDecodeAllSubtitles ( bool  DecodeAll)

Definition at line 914 of file decoderbase.cpp.

Referenced by MythCCExtractorPlayer::run().

◆ GetTracks()

QStringList DecoderBase::GetTracks ( uint  Type)
virtual

Definition at line 921 of file decoderbase.cpp.

Referenced by MythPlayer::GetTracks().

◆ GetTrackCount()

uint DecoderBase::GetTrackCount ( uint  Type)
virtual

◆ GetTrackLanguageIndex()

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

Definition at line 930 of file decoderbase.cpp.

Referenced by MythPlayer::EnableCaptions().

◆ GetTrackDesc()

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

◆ SetTrack()

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

◆ GetTrack()

int DecoderBase::GetTrack ( uint  Type)

Definition at line 956 of file decoderbase.cpp.

Referenced by SubtitleScreen::DisplayAVSubtitles(), and MythPlayer::GetTrack().

◆ GetTrackInfo()

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

◆ ChangeTrack()

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

Definition at line 993 of file decoderbase.cpp.

Referenced by MythPlayer::ChangeTrack().

◆ InsertTrack()

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

Definition at line 1020 of file decoderbase.cpp.

Referenced by CC708Reader::DefineWindow().

◆ NextTrack()

int DecoderBase::NextTrack ( uint  Type)

Definition at line 1009 of file decoderbase.cpp.

Referenced by MythPlayer::ChangeCaptionTrack().

◆ GetTeletextDecoderType()

virtual int DecoderBase::GetTeletextDecoderType ( void  ) const
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 247 of file decoderbase.h.

◆ GetXDS()

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

Reimplemented in AvFormatDecoder.

Definition at line 249 of file decoderbase.h.

Referenced by MythPlayer::GetXDS().

◆ GetSubHeader()

virtual QByteArray DecoderBase::GetSubHeader ( uint  )
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 250 of file decoderbase.h.

Referenced by SubtitleScreen::InitialiseAssTrack().

◆ GetAttachmentData()

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

Reimplemented in AvFormatDecoder.

Definition at line 251 of file decoderbase.h.

Referenced by SubtitleScreen::LoadAssFonts().

◆ SetAudioByComponentTag()

virtual bool DecoderBase::SetAudioByComponentTag ( int  )
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 255 of file decoderbase.h.

Referenced by MythPlayer::SetAudioByComponentTag().

◆ SetVideoByComponentTag()

virtual bool DecoderBase::SetVideoByComponentTag ( int  )
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 256 of file decoderbase.h.

Referenced by MythPlayer::SetVideoByComponentTag().

◆ SaveTotalDuration()

void DecoderBase::SaveTotalDuration ( void  )

Definition at line 1239 of file decoderbase.cpp.

Referenced by MythPlayer::SaveTotalDuration().

◆ ResetTotalDuration()

void DecoderBase::ResetTotalDuration ( void  )
inline

Definition at line 259 of file decoderbase.h.

Referenced by MythPlayer::ResetTotalDuration().

◆ SaveTotalFrames()

void DecoderBase::SaveTotalFrames ( void  )

Definition at line 1247 of file decoderbase.cpp.

Referenced by MythPlayer::SaveTotalFrames().

◆ TrackTotalDuration()

void DecoderBase::TrackTotalDuration ( bool  track)
inline

Definition at line 261 of file decoderbase.h.

◆ GetfpsMultiplier()

int DecoderBase::GetfpsMultiplier ( void  ) const
inline

◆ GetMythCodecContext()

MythCodecContext* DecoderBase::GetMythCodecContext ( void  )
inline

Definition at line 263 of file decoderbase.h.

Referenced by MythDVDPlayer::AutoDeint().

◆ GetVideoDisplayProfile()

VideoDisplayProfile* DecoderBase::GetVideoDisplayProfile ( void  )
inline

Definition at line 264 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 1446 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 1051 of file decoderbase.cpp.

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

◆ AutoSelectTracks()

void DecoderBase::AutoSelectTracks ( void  )
protected

Definition at line 1142 of file decoderbase.cpp.

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

◆ ResetTracks()

void DecoderBase::ResetTracks ( void  )
protected

Definition at line 1148 of file decoderbase.cpp.

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

◆ FileChanged()

void DecoderBase::FileChanged ( void  )
protected

Definition at line 880 of file decoderbase.cpp.

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

◆ DoRewindSeek()

bool DecoderBase::DoRewindSeek ( long long  desiredFrame)
protectedvirtual

Reimplemented in AvFormatDecoder, MythDVDDecoder, and MythBDDecoder.

Definition at line 588 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 AvFormatDecoder, MythDVDDecoder, and MythBDDecoder.

Definition at line 829 of file decoderbase.cpp.

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

◆ ConditionallyUpdatePosMap()

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

Definition at line 666 of file decoderbase.cpp.

Referenced by DoFastForward(), and DoRewindSeek().

◆ GetLastFrameInPosMap()

long long DecoderBase::GetLastFrameInPosMap ( void  ) const
protected

Definition at line 655 of file decoderbase.cpp.

Referenced by ConditionallyUpdatePosMap(), and DoFastForward().

◆ GetPositionMapSize()

unsigned long DecoderBase::GetPositionMapSize ( void  ) const
protected

Definition at line 292 of file decoderbase.cpp.

Referenced by DoRewindSeek(), 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

Definition at line 290 of file decoderbase.h.

Referenced by AvFormatDecoder::AutoSelectTrack(), MythBDDecoder::BDFindPosition(), MythDVDDecoder::CheckContext(), DoFastForward(), MythBDDecoder::DoFastForwardSeek(), MythDVDDecoder::DoFastForwardSeek(), DoFastForwardSeek(), DoRewind(), MythBDDecoder::DoRewindSeek(), MythDVDDecoder::DoRewindSeek(), DoRewindSeek(), MythDVDDecoder::DVDFindPosition(), MythBDDecoder::GetAudioLanguage(), MythDVDDecoder::GetAudioLanguage(), MythDVDDecoder::GetAudioTrackType(), NuppelDecoder::GetFrame(), AvFormatDecoder::GetFrame(), GetKey(), MythBDDecoder::GetSubtitleLanguage(), AvFormatDecoder::GetTrackDesc(), AvFormatDecoder::HandleGopStart(), AvFormatDecoder::InitByteContext(), AvFormatDecoder::InitVideoCodec(), MythBDDecoder::IsValidStream(), AvFormatDecoder::MpegPreProcessPkt(), NuppelDecoder::OpenFile(), AvFormatDecoder::OpenFile(), PosMapFromDb(), PosMapFromEnc(), MythDVDDecoder::PostProcessTracks(), AvFormatDecoder::ProcessAudioPacket(), MythDVDDecoder::ProcessDataPacket(), AvFormatDecoder::ProcessSubtitlePacket(), AvFormatDecoder::ProcessVideoFrame(), MythDVDDecoder::ProcessVideoPacket(), AvFormatDecoder::ProcessVideoPacket(), NuppelDecoder::ReadFileheader(), NuppelDecoder::ReadFrameheader(), MythBDDecoder::ReadPacket(), MythDVDDecoder::ReadPacket(), AvFormatDecoder::ScanStreams(), AvFormatDecoder::SeekReset(), MythBDDecoder::StreamChangeCheck(), MythDVDDecoder::StreamChangeCheck(), SyncPositionMap(), MythBDDecoder::UpdateFramesPlayed(), and MythDVDDecoder::UpdateFramesPlayed().

◆ m_fps

double DecoderBase::m_fps {29.97}
protected

Definition at line 292 of file decoderbase.h.

Referenced by PosMapFromDb(), and SyncPositionMap().

◆ 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

unsigned long long 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 306 of file decoderbase.h.

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

◆ m_copyFrame

MythAVCopy DecoderBase::m_copyFrame
protected

Definition at line 307 of file decoderbase.h.

Referenced by NuppelDecoder::DecodeFrame().

◆ m_nextDecodedFrameIsKeyFrame

bool DecoderBase::m_nextDecodedFrameIsKeyFrame { false }
protected

◆ m_atEof

EofState DecoderBase::m_atEof {kEofStateNone}
protected

◆ m_trackTotalDuration

bool DecoderBase::m_trackTotalDuration {false}
protected

◆ m_exitAfterDecoded

bool DecoderBase::m_exitAfterDecoded {false}
protected

Definition at line 317 of file decoderbase.h.

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

◆ m_transcoding

bool DecoderBase::m_transcoding {false}
protected

Definition at line 318 of file decoderbase.h.

Referenced by DoFastForward().

◆ m_hasFullPositionMap

bool DecoderBase::m_hasFullPositionMap {false}
protected

◆ m_recordingHasPositionMap

bool DecoderBase::m_recordingHasPositionMap {false}
protected

◆ m_posmapStarted

bool DecoderBase::m_posmapStarted {false}
protected

Definition at line 322 of file decoderbase.h.

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

◆ m_positionMapType

MarkTypes DecoderBase::m_positionMapType {MARK_UNSET}
protected

◆ m_positionMapLock

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

◆ m_positionMap

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 329 of file decoderbase.h.

Referenced by SyncPositionMap(), and TranslatePositionFrameToMs().

◆ m_seekSnap

uint64_t DecoderBase::m_seekSnap {UINT64_MAX}
protected

Definition at line 331 of file decoderbase.h.

Referenced by DoFastForward(), DoFastForwardSeek(), DoRewind(), and DoRewindSeek().

◆ m_dontSyncPositionMap

bool DecoderBase::m_dontSyncPositionMap {false}
protected

Definition at line 332 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 336 of file decoderbase.h.

Referenced by DoFastForwardSeek(), DoRewindSeek(), GetKey(), and NuppelDecoder::OpenFile().

◆ m_getRawFrames

bool DecoderBase::m_getRawFrames {false}
protected

◆ m_getRawVideo

bool DecoderBase::m_getRawVideo {false}
protected

Definition at line 339 of file decoderbase.h.

Referenced by NuppelDecoder::GetFrame(), and NuppelDecoder::NuppelDecoder().

◆ m_errored

bool DecoderBase::m_errored {false}
protected

Definition at line 341 of file decoderbase.h.

Referenced by NuppelDecoder::NuppelDecoder().

◆ m_waitingForChange

bool DecoderBase::m_waitingForChange {false}
protected

◆ m_justAfterChange

bool DecoderBase::m_justAfterChange {false}
protected

Definition at line 344 of file decoderbase.h.

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

◆ m_readAdjust

long long DecoderBase::m_readAdjust {0}
protected

◆ m_videoRotation

int DecoderBase::m_videoRotation {0}
protected

◆ m_trackLock

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

◆ m_decodeAllSubtitles

bool DecoderBase::m_decodeAllSubtitles { false }
protected

◆ m_currentTrack

int DecoderBase::m_currentTrack[kTrackTypeCount] { -1 }
protected

◆ m_tracks

vector<StreamInfo> DecoderBase::m_tracks[kTrackTypeCount]
protected

◆ m_wantedTrack

StreamInfo DecoderBase::m_wantedTrack[kTrackTypeCount]
protected

Definition at line 353 of file decoderbase.h.

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

◆ m_selectedTrack

StreamInfo DecoderBase::m_selectedTrack[kTrackTypeCount]
protected

◆ m_languagePreference

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

Definition at line 359 of file decoderbase.h.

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


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