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

#include <libmythtv/decoders/decoderbase.h>

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

Classes

struct  PosMapEntry
 

Public Member Functions

 DecoderBase (MythPlayer *parent, const ProgramInfo &pginfo)
 
virtual ~DecoderBase ()
 
void SetRenderFormats (const VideoFrameTypes *RenderFormats)
 
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< std::chrono::seconds > &)
 
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)
 
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 std::chrono::milliseconds NormalizeVideoTimecode (std::chrono::milliseconds timecode)
 
virtual bool IsLastFrameKey (void) const =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)
 
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)
 

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)
 
static AVPixelFormat GetBestVideoFormat (AVPixelFormat *Formats, const VideoFrameTypes *RenderFormats)
 Find a suitable frame format that is mutually acceptable to the decoder and render device. More...
 

Protected Member Functions

int BestTrack (uint Type, bool forcedPreferred, int preferredLanguage=0)
 Determine the best track according to weights. More...
 
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}
 
MythAVRational m_totalDuration {0}
 
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< 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_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, kTrackTypeCountm_currentTrack {}
 
std::array< sinfo_vec_t, kTrackTypeCountm_tracks
 
std::array< StreamInfo, kTrackTypeCountm_wantedTrack
 
std::array< StreamInfo, kTrackTypeCountm_selectedTrack
 
std::array< StreamInfo, kTrackTypeCountm_selectedForcedTrack
 
std::vector< int > m_languagePreference
 language preferences for auto-selection of streams More...
 
MythCodecContextm_mythCodecCtx { nullptr }
 
MythVideoProfile m_videoDisplayProfile
 
const VideoFrameTypesm_renderFormats { &MythVideoFrame::kDefaultRenderFormats }
 

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 30 of file decoderbase.cpp.

Member Function Documentation

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

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

◆ AutoSelectTracks()

void DecoderBase::AutoSelectTracks ( void  )
protected

Definition at line 1169 of file decoderbase.cpp.

◆ BestTrack()

int DecoderBase::BestTrack ( uint  Type,
bool  forcedPreferred,
int  preferredLanguage = 0 
)
protected

Determine the best track according to weights.

Select the best track. Primary attribute is to favor or disfavor a forced track. Secondary attribute is language preference, in order of most preferred to least preferred language. Third attribute is track order, preferring the earliesttrack.

Whether to favor or disfavor forced is controlled by the second parameter.

A preferredlanguage can be specified as third parameter, which will override the user's preferrence list.

This function must not be called without taking m_trackLock

Returns
the highest weighted track, or -1 if none.

Definition at line 1035 of file decoderbase.cpp.

Referenced by AutoSelectTrack(), and SetTrack().

◆ ChangeTrack()

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

Definition at line 990 of file decoderbase.cpp.

Referenced by MythPlayerCaptionsUI::ChangeTrack().

◆ ConditionallyUpdatePosMap()

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

Definition at line 667 of file decoderbase.cpp.

Referenced by DoFastForward(), and DoRewindSeek().

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

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

◆ 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 MythBDDecoder, AvFormatDecoder, and MythDVDDecoder.

Definition at line 819 of file decoderbase.cpp.

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

◆ DoRewind()

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

◆ DoRewindSeek()

bool DecoderBase::DoRewindSeek ( long long  desiredFrame)
protectedvirtual

Reimplemented in MythBDDecoder, AvFormatDecoder, and MythDVDDecoder.

Definition at line 589 of file decoderbase.cpp.

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

◆ FileChanged()

void DecoderBase::FileChanged ( void  )
protected

Definition at line 870 of file decoderbase.cpp.

Referenced by AvFormatDecoder::GetFrame().

◆ FindPosition()

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

Definition at line 419 of file decoderbase.cpp.

Referenced by DoFastForwardSeek(), and DoRewindSeek().

◆ ForceSetupAudioStream()

virtual void DecoderBase::ForceSetupAudioStream ( void  )
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 147 of file decoderbase.h.

Referenced by MythPlayer::ForceSetupAudioStream().

◆ GetAttachmentData()

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

Reimplemented in AvFormatDecoder.

Definition at line 241 of file decoderbase.h.

◆ GetBestVideoFormat()

AVPixelFormat DecoderBase::GetBestVideoFormat ( AVPixelFormat *  Formats,
const VideoFrameTypes RenderFormats 
)
static

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 1472 of file decoderbase.cpp.

Referenced by MythCodecContext::RetrieveHWFrame().

◆ GetChapter()

virtual long long DecoderBase::GetChapter ( int  )
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 157 of file decoderbase.h.

Referenced by MythPlayer::GetChapter().

◆ GetChapterTimes()

virtual void DecoderBase::GetChapterTimes ( QList< std::chrono::seconds > &  )
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 156 of file decoderbase.h.

Referenced by MythPlayer::GetChapterTimes().

◆ GetCodecDecoderName()

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

◆ GetCurrentChapter()

virtual int DecoderBase::GetCurrentChapter ( long long  )
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 155 of file decoderbase.h.

Referenced by MythPlayer::GetCurrentChapter().

◆ GetEof()

EofState DecoderBase::GetEof ( void  )
inline

Definition at line 135 of file decoderbase.h.

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

◆ GetFPS()

virtual double DecoderBase::GetFPS ( void  ) const
inlinevirtual

◆ GetfpsMultiplier()

int DecoderBase::GetfpsMultiplier ( void  ) const
inline

◆ GetFrame()

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

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

Implemented in AvFormatDecoder, MythDVDDecoder, and DummyDecoder.

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

◆ GetFramesPlayed()

long long DecoderBase::GetFramesPlayed ( void  ) const
inline

Definition at line 195 of file decoderbase.h.

Referenced by MythPlayer::DoFFRewSkip().

◆ GetFramesRead()

long long DecoderBase::GetFramesRead ( void  ) const
inline

◆ GetKey()

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

◆ GetLastFrameInPosMap()

long long DecoderBase::GetLastFrameInPosMap ( void  ) const
protected

Definition at line 656 of file decoderbase.cpp.

Referenced by ConditionallyUpdatePosMap(), and DoFastForward().

◆ GetMythCodecContext()

MythCodecContext * DecoderBase::GetMythCodecContext ( void  )
inline

Definition at line 253 of file decoderbase.h.

Referenced by MythDVDPlayer::AutoDeint().

◆ GetNumChapters()

virtual int DecoderBase::GetNumChapters ( void  )
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 154 of file decoderbase.h.

Referenced by MythPlayer::GetNumChapters().

◆ GetPlayer()

MythPlayer * DecoderBase::GetPlayer ( )
inline

◆ GetPositionMapSize()

unsigned long DecoderBase::GetPositionMapSize ( void  ) const
protected

Definition at line 293 of file decoderbase.cpp.

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

◆ GetRawBitrate()

uint DecoderBase::GetRawBitrate ( void  ) const
inline

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

Definition at line 191 of file decoderbase.h.

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

◆ GetRawEncodingType()

virtual QString DecoderBase::GetRawEncodingType ( void  )
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 199 of file decoderbase.h.

Referenced by MythPlayerUI::GetCodecDescription().

◆ GetSeekSnap()

uint64_t DecoderBase::GetSeekSnap ( void  ) const
inline

Definition at line 138 of file decoderbase.h.

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

◆ GetSubHeader()

virtual QByteArray DecoderBase::GetSubHeader ( uint  )
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 240 of file decoderbase.h.

◆ GetTeletextDecoderType()

virtual int DecoderBase::GetTeletextDecoderType ( void  ) const
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 237 of file decoderbase.h.

◆ GetTrack()

int DecoderBase::GetTrack ( uint  Type)

◆ GetTrackCount()

uint DecoderBase::GetTrackCount ( uint  Type)
virtual

◆ GetTrackDesc()

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

◆ GetTrackInfo()

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

◆ GetTrackLanguageIndex()

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

Definition at line 920 of file decoderbase.cpp.

Referenced by MythPlayerCaptionsUI::EnableCaptions().

◆ GetTracks()

QStringList DecoderBase::GetTracks ( uint  Type)
virtual

Definition at line 911 of file decoderbase.cpp.

Referenced by MythPlayerCaptionsUI::GetTracks().

◆ GetVideoAspect()

float DecoderBase::GetVideoAspect ( void  ) const
inline

Definition at line 182 of file decoderbase.h.

Referenced by Transcode::TranscodeFile().

◆ GetVideoCodecID()

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

◆ GetWaitForChange()

bool DecoderBase::GetWaitForChange ( void  ) const

Definition at line 893 of file decoderbase.cpp.

Referenced by MythPlayerUI::EventLoop().

◆ GetXDS()

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

Reimplemented in AvFormatDecoder.

Definition at line 239 of file decoderbase.h.

Referenced by MythPlayer::GetXDS().

◆ HasPositionMap()

bool DecoderBase::HasPositionMap ( void  ) const
inline

Definition at line 218 of file decoderbase.h.

Referenced by MythCommFlagPlayer::RebuildSeekTable().

◆ IsErrored()

bool DecoderBase::IsErrored ( ) const
inline

Definition at line 216 of file decoderbase.h.

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

◆ IsLastFrameKey()

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

◆ NextTrack()

int DecoderBase::NextTrack ( uint  Type)

Definition at line 1006 of file decoderbase.cpp.

Referenced by MythPlayerCaptionsUI::ChangeCaptionTrack().

◆ NormalizeVideoTimecode()

virtual std::chrono::milliseconds DecoderBase::NormalizeVideoTimecode ( std::chrono::milliseconds  timecode)
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 184 of file decoderbase.h.

◆ OpenFile()

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

Implemented in DummyDecoder, and AvFormatDecoder.

Referenced by MythPlayer::OpenFile().

◆ PosMapFromDb()

bool DecoderBase::PosMapFromDb ( void  )
virtual

Definition at line 94 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 222 of file decoderbase.cpp.

Referenced by SyncPositionMap().

◆ Reset()

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

◆ ResetPosMap()

void DecoderBase::ResetPosMap ( void  )
virtual

◆ ResetTotalDuration()

void DecoderBase::ResetTotalDuration ( void  )
inline

Definition at line 249 of file decoderbase.h.

Referenced by MythPlayer::ResetTotalDuration().

◆ ResetTracks()

void DecoderBase::ResetTracks ( void  )
protected

Definition at line 1175 of file decoderbase.cpp.

Referenced by DecoderBase().

◆ SavePositionMapDelta()

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

Definition at line 499 of file decoderbase.cpp.

Referenced by MythRebuildSaver::run().

◆ SaveTotalDuration()

void DecoderBase::SaveTotalDuration ( void  )

Definition at line 1265 of file decoderbase.cpp.

Referenced by MythPlayer::SaveTotalDuration().

◆ SaveTotalFrames()

void DecoderBase::SaveTotalFrames ( void  )

Definition at line 1273 of file decoderbase.cpp.

Referenced by MythPlayer::SaveTotalFrames().

◆ SeekReset()

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

◆ SetAudioByComponentTag()

virtual bool DecoderBase::SetAudioByComponentTag ( int  )
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 245 of file decoderbase.h.

Referenced by MythPlayerCaptionsUI::SetAudioByComponentTag().

◆ SetDecodeAllSubtitles()

void DecoderBase::SetDecodeAllSubtitles ( bool  DecodeAll)

Definition at line 904 of file decoderbase.cpp.

Referenced by MythCCExtractorPlayer::run().

◆ 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().

◆ SetEof()

virtual void DecoderBase::SetEof ( bool  eof)
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 132 of file decoderbase.h.

Referenced by AvFormatDecoder::SetEof().

◆ SetEofState()

virtual void DecoderBase::SetEofState ( EofState  eof)
inlinevirtual

Definition at line 131 of file decoderbase.h.

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

◆ SetFramesPlayed()

void DecoderBase::SetFramesPlayed ( long long  newValue)
inline

Definition at line 196 of file decoderbase.h.

◆ SetIdrOnlyKeyframes()

virtual void DecoderBase::SetIdrOnlyKeyframes ( bool  )
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 160 of file decoderbase.h.

Referenced by MythCommFlagPlayer::RebuildSeekTable().

◆ 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)

◆ SetReadAdjust()

void DecoderBase::SetReadAdjust ( long long  adjust)

Definition at line 883 of file decoderbase.cpp.

Referenced by MythPlayerUI::SwitchToProgram().

◆ SetRenderFormats()

void DecoderBase::SetRenderFormats ( const VideoFrameTypes RenderFormats)

Definition at line 35 of file decoderbase.cpp.

Referenced by MythPlayer::SetDecoder().

◆ SetSeekSnap()

void DecoderBase::SetSeekSnap ( uint64_t  snap)
inline

◆ SetTrack()

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

Reimplemented in AvFormatDecoder.

Definition at line 952 of file decoderbase.cpp.

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

◆ SetTranscoding()

void DecoderBase::SetTranscoding ( bool  value)
inline

Definition at line 214 of file decoderbase.h.

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

◆ SetVideoByComponentTag()

virtual bool DecoderBase::SetVideoByComponentTag ( int  )
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 246 of file decoderbase.h.

Referenced by MythPlayerCaptionsUI::SetVideoByComponentTag().

◆ SetWaitForChange()

void DecoderBase::SetWaitForChange ( void  )

Definition at line 888 of file decoderbase.cpp.

Referenced by MythPlayerUI::SwitchToProgram().

◆ SetWatchingRecording()

void DecoderBase::SetWatchingRecording ( bool  mode)
virtual

Definition at line 81 of file decoderbase.cpp.

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

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

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

◆ TrackTotalDuration()

void DecoderBase::TrackTotalDuration ( bool  track)
inline

Definition at line 251 of file decoderbase.h.

Referenced by MythCommFlagPlayer::RebuildSeekTable().

◆ TranslatePosition()

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

◆ 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

◆ TranslatePositionFrameToMs()

std::chrono::milliseconds DecoderBase::TranslatePositionFrameToMs ( long long  position,
float  fallback_framerate,
const frm_dir_map_t cutlist 
)

Definition at line 1335 of file decoderbase.cpp.

Referenced by DeleteMap::TranslatePositionFrameToMs().

◆ TranslatePositionMsToFrame()

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

Definition at line 1363 of file decoderbase.cpp.

Referenced by DeleteMap::TranslatePositionMsToFrame().

◆ 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

◆ UpdateFramesPlayed()

void DecoderBase::UpdateFramesPlayed ( void  )
virtual

Member Data Documentation

◆ m_atEof

EofState DecoderBase::m_atEof {kEofStateNone}
protected

Definition at line 300 of file decoderbase.h.

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

◆ m_audio

AudioPlayer* DecoderBase::m_audio {nullptr}
protected

◆ m_bitrate

uint DecoderBase::m_bitrate {4000}
protected

◆ m_copyFrame

MythAVCopy DecoderBase::m_copyFrame
protected

Definition at line 297 of file decoderbase.h.

◆ m_currentAspect

float DecoderBase::m_currentAspect {1.33333F}
protected

◆ m_currentHeight

int DecoderBase::m_currentHeight {480}
protected

◆ m_currentTrack

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

◆ m_currentWidth

int DecoderBase::m_currentWidth {640}
protected

◆ m_decodeAllSubtitles

bool DecoderBase::m_decodeAllSubtitles { false }
protected

◆ m_dontSyncPositionMap

bool DecoderBase::m_dontSyncPositionMap {false}
protected

Definition at line 322 of file decoderbase.h.

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

◆ m_durToFrameMap

frm_pos_map_t DecoderBase::m_durToFrameMap
protected

◆ m_errored

bool DecoderBase::m_errored {false}
protected

Definition at line 328 of file decoderbase.h.

Referenced by IsErrored().

◆ m_exitAfterDecoded

bool DecoderBase::m_exitAfterDecoded {false}
protected

Definition at line 307 of file decoderbase.h.

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

◆ 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_frameCounter

uint64_t DecoderBase::m_frameCounter {0}
protected

◆ m_framesPlayed

long long DecoderBase::m_framesPlayed {0}
protected

◆ m_framesRead

long long DecoderBase::m_framesRead {0}
protected

◆ m_frameToDurMap

frm_pos_map_t DecoderBase::m_frameToDurMap
protected

◆ m_hasFullPositionMap

bool DecoderBase::m_hasFullPositionMap {false}
protected

Definition at line 310 of file decoderbase.h.

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

◆ m_hasKeyFrameAdjustTable

bool DecoderBase::m_hasKeyFrameAdjustTable {false}
protected

Definition at line 326 of file decoderbase.h.

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

◆ m_indexOffset

long long DecoderBase::m_indexOffset {0}
protected

Definition at line 296 of file decoderbase.h.

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

◆ m_justAfterChange

bool DecoderBase::m_justAfterChange {false}
protected

Definition at line 331 of file decoderbase.h.

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

◆ m_keyframeDist

int DecoderBase::m_keyframeDist {-1}
protected

◆ m_languagePreference

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

language preferences for auto-selection of streams

Definition at line 346 of file decoderbase.h.

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

◆ m_lastKey

long long DecoderBase::m_lastKey {0}
protected

◆ m_lastPositionMapUpdate

QDateTime DecoderBase::m_lastPositionMapUpdate
mutableprotected

Definition at line 319 of file decoderbase.h.

Referenced by SyncPositionMap(), and TranslatePositionFrameToMs().

◆ m_livetv

bool DecoderBase::m_livetv {false}
protected

◆ m_mythCodecCtx

MythCodecContext* DecoderBase::m_mythCodecCtx { nullptr }
protected

◆ m_nextDecodedFrameIsKeyFrame

bool DecoderBase::m_nextDecodedFrameIsKeyFrame { false }
protected

◆ m_parent

MythPlayer* DecoderBase::m_parent {nullptr}
protected

◆ m_playbackInfo

ProgramInfo* DecoderBase::m_playbackInfo {nullptr}
protected

◆ m_positionMap

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

◆ m_positionMapLock

QRecursiveMutex DecoderBase::m_positionMapLock
mutableprotected

◆ m_positionMapType

MarkTypes DecoderBase::m_positionMapType {MARK_UNSET}
protected

Definition at line 313 of file decoderbase.h.

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

◆ m_posmapStarted

bool DecoderBase::m_posmapStarted {false}
protected

Definition at line 312 of file decoderbase.h.

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

◆ m_readAdjust

long long DecoderBase::m_readAdjust {0}
protected

Definition at line 332 of file decoderbase.h.

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

◆ m_recordingHasPositionMap

bool DecoderBase::m_recordingHasPositionMap {false}
protected

◆ m_renderFormats

const VideoFrameTypes* DecoderBase::m_renderFormats { &MythVideoFrame::kDefaultRenderFormats }
protected

Definition at line 349 of file decoderbase.h.

Referenced by SetRenderFormats().

◆ m_ringBuffer

MythMediaBuffer* DecoderBase::m_ringBuffer {nullptr}
protected

◆ m_seekSnap

uint64_t DecoderBase::m_seekSnap {UINT64_MAX}
protected

◆ m_selectedForcedTrack

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

◆ m_selectedTrack

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

◆ m_stereo3D

uint DecoderBase::m_stereo3D {0}
protected

◆ m_totalDuration

MythAVRational DecoderBase::m_totalDuration {0}
protected

◆ m_trackLock

QRecursiveMutex DecoderBase::m_trackLock
protected

◆ m_tracks

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

◆ m_trackTotalDuration

bool DecoderBase::m_trackTotalDuration {false}
protected

◆ m_transcoding

bool DecoderBase::m_transcoding {false}
protected

Definition at line 308 of file decoderbase.h.

Referenced by DoFastForward(), and SetTranscoding().

◆ m_videoDisplayProfile

MythVideoProfile DecoderBase::m_videoDisplayProfile
protected

◆ m_videoRotation

int DecoderBase::m_videoRotation {0}
protected

◆ m_waitingForChange

bool DecoderBase::m_waitingForChange {false}
protected

◆ m_wantedTrack

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

Definition at line 341 of file decoderbase.h.

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

◆ m_watchingRecording

bool DecoderBase::m_watchingRecording {false}
protected

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