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

◆ SetRenderFormats()

void DecoderBase::SetRenderFormats ( const VideoFrameTypes RenderFormats)

Definition at line 35 of file decoderbase.cpp.

Referenced by MythPlayer::SetDecoder().

◆ 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::do_av_seek(), 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 81 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, AvFormatDecoder, and MythDVDDecoder.

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< std::chrono::seconds > &  )
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 709 of file decoderbase.cpp.

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

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

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

Definition at line 1334 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 1362 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 std::chrono::milliseconds DecoderBase::NormalizeVideoTimecode ( std::chrono::milliseconds  timecode)
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 184 of file decoderbase.h.

◆ IsLastFrameKey()

virtual bool DecoderBase::IsLastFrameKey ( void  ) const
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 191 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 195 of file decoderbase.h.

Referenced by MythPlayer::DoFFRewSkip().

◆ SetFramesPlayed()

void DecoderBase::SetFramesPlayed ( long long  newValue)
inline

Definition at line 196 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 199 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 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().

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

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

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

◆ SeekReset()

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

◆ SetTranscoding()

void DecoderBase::SetTranscoding ( bool  value)
inline

Definition at line 214 of file decoderbase.h.

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

◆ IsErrored()

bool DecoderBase::IsErrored ( ) const
inline

Definition at line 216 of file decoderbase.h.

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

◆ HasPositionMap()

bool DecoderBase::HasPositionMap ( void  ) const
inline

Definition at line 218 of file decoderbase.h.

Referenced by MythCommFlagPlayer::RebuildSeekTable().

◆ SetWaitForChange()

void DecoderBase::SetWaitForChange ( void  )

Definition at line 887 of file decoderbase.cpp.

Referenced by MythPlayerUI::SwitchToProgram().

◆ GetWaitForChange()

bool DecoderBase::GetWaitForChange ( void  ) const

Definition at line 892 of file decoderbase.cpp.

Referenced by MythPlayerUI::EventLoop().

◆ SetReadAdjust()

void DecoderBase::SetReadAdjust ( long long  adjust)

Definition at line 882 of file decoderbase.cpp.

Referenced by MythPlayerUI::SwitchToProgram().

◆ SetDecodeAllSubtitles()

void DecoderBase::SetDecodeAllSubtitles ( bool  DecodeAll)

Definition at line 903 of file decoderbase.cpp.

Referenced by MythCCExtractorPlayer::run().

◆ GetTracks()

QStringList DecoderBase::GetTracks ( uint  Type)
virtual

Definition at line 910 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 919 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 951 of file decoderbase.cpp.

Referenced by ChangeTrack(), MythPlayerCaptionsUI::SetTrack(), and AvFormatDecoder::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 989 of file decoderbase.cpp.

Referenced by MythPlayerCaptionsUI::ChangeTrack().

◆ NextTrack()

int DecoderBase::NextTrack ( uint  Type)

Definition at line 1005 of file decoderbase.cpp.

Referenced by MythPlayerCaptionsUI::ChangeCaptionTrack().

◆ GetTeletextDecoderType()

virtual int DecoderBase::GetTeletextDecoderType ( void  ) const
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 237 of file decoderbase.h.

◆ GetXDS()

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

Reimplemented in AvFormatDecoder.

Definition at line 239 of file decoderbase.h.

Referenced by MythPlayer::GetXDS().

◆ GetSubHeader()

virtual QByteArray DecoderBase::GetSubHeader ( uint  )
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 240 of file decoderbase.h.

Referenced by SubtitleScreen::InitialiseAssTrack().

◆ GetAttachmentData()

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

Reimplemented in AvFormatDecoder.

Definition at line 241 of file decoderbase.h.

Referenced by SubtitleScreen::LoadAssFonts().

◆ SetAudioByComponentTag()

virtual bool DecoderBase::SetAudioByComponentTag ( int  )
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 245 of file decoderbase.h.

Referenced by MythPlayerCaptionsUI::SetAudioByComponentTag().

◆ SetVideoByComponentTag()

virtual bool DecoderBase::SetVideoByComponentTag ( int  )
inlinevirtual

Reimplemented in AvFormatDecoder.

Definition at line 246 of file decoderbase.h.

Referenced by MythPlayerCaptionsUI::SetVideoByComponentTag().

◆ SaveTotalDuration()

void DecoderBase::SaveTotalDuration ( void  )

Definition at line 1264 of file decoderbase.cpp.

Referenced by MythPlayer::SaveTotalDuration().

◆ ResetTotalDuration()

void DecoderBase::ResetTotalDuration ( void  )
inline

Definition at line 249 of file decoderbase.h.

Referenced by MythPlayer::ResetTotalDuration().

◆ SaveTotalFrames()

void DecoderBase::SaveTotalFrames ( void  )

Definition at line 1272 of file decoderbase.cpp.

Referenced by MythPlayer::SaveTotalFrames().

◆ TrackTotalDuration()

void DecoderBase::TrackTotalDuration ( bool  track)
inline

Definition at line 251 of file decoderbase.h.

Referenced by MythCommFlagPlayer::RebuildSeekTable().

◆ GetfpsMultiplier()

int DecoderBase::GetfpsMultiplier ( void  ) const
inline

◆ GetMythCodecContext()

MythCodecContext* DecoderBase::GetMythCodecContext ( void  )
inline

Definition at line 253 of file decoderbase.h.

Referenced by MythDVDPlayer::AutoDeint().

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

Referenced by MythCodecContext::RetrieveHWFrame().

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

Referenced by AutoSelectTrack(), and SetTrack().

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

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

◆ AutoSelectTracks()

void DecoderBase::AutoSelectTracks ( void  )
protected

Definition at line 1168 of file decoderbase.cpp.

◆ ResetTracks()

void DecoderBase::ResetTracks ( void  )
protected

Definition at line 1174 of file decoderbase.cpp.

Referenced by DecoderBase().

◆ FileChanged()

void DecoderBase::FileChanged ( void  )
protected

Definition at line 869 of file decoderbase.cpp.

Referenced by 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 818 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 293 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

MythAVRational DecoderBase::m_totalDuration {0}
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 296 of file decoderbase.h.

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

◆ m_copyFrame

MythAVCopy DecoderBase::m_copyFrame
protected

Definition at line 297 of file decoderbase.h.

◆ m_nextDecodedFrameIsKeyFrame

bool DecoderBase::m_nextDecodedFrameIsKeyFrame { false }
protected

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

bool DecoderBase::m_trackTotalDuration {false}
protected

◆ m_exitAfterDecoded

bool DecoderBase::m_exitAfterDecoded {false}
protected

Definition at line 307 of file decoderbase.h.

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

◆ m_transcoding

bool DecoderBase::m_transcoding {false}
protected

Definition at line 308 of file decoderbase.h.

Referenced by DoFastForward(), and SetTranscoding().

◆ m_hasFullPositionMap

bool DecoderBase::m_hasFullPositionMap {false}
protected

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

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

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

QRecursiveMutex DecoderBase::m_positionMapLock
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 319 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 322 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 326 of file decoderbase.h.

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

◆ m_errored

bool DecoderBase::m_errored {false}
protected

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

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

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

int DecoderBase::m_videoRotation {0}
protected

◆ m_stereo3D

uint DecoderBase::m_stereo3D {0}
protected

◆ m_trackLock

QRecursiveMutex DecoderBase::m_trackLock
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 341 of file decoderbase.h.

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

◆ m_selectedTrack

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

◆ m_selectedForcedTrack

std::array<StreamInfo, kTrackTypeCount> DecoderBase::m_selectedForcedTrack
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_mythCodecCtx

MythCodecContext* DecoderBase::m_mythCodecCtx { nullptr }
protected

◆ m_videoDisplayProfile

MythVideoProfile DecoderBase::m_videoDisplayProfile
protected

◆ m_renderFormats

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

Definition at line 349 of file decoderbase.h.

Referenced by SetRenderFormats().


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