DecoderBase Class Reference

#include <decoderbase.h>

Inheritance diagram for DecoderBase:

AvFormatDecoder DummyDecoder IvtvDecoder NuppelDecoder

List of all members.


Detailed Description

Definition at line 57 of file decoderbase.h.


Public Member Functions

 DecoderBase (NuppelVideoPlayer *parent, ProgramInfo *pginfo)
virtual ~DecoderBase ()
virtual void Reset (void)
virtual int OpenFile (RingBuffer *rbuffer, bool novideo, char testbuf[kDecoderProbeBufferSize], int testbufsize=kDecoderProbeBufferSize)=0
void setExactSeeks (bool exact)
void setLiveTVMode (bool live)
void setRecorder (RemoteEncoder *recorder)
void SetProgramInfo (ProgramInfo *pginfo)
void SetLowBuffers (bool low)
virtual void SetDisablePassThrough (bool disable)
 Disables AC3/DTS pass through.
virtual void setWatchingRecording (bool mode)
virtual bool GetFrame (int onlyvideo)=0
 Decode a frame of video/audio.
NuppelVideoPlayerGetNVP ()
virtual bool DoRewind (long long desiredFrame, bool doflush=true)
virtual bool DoFastForward (long long desiredFrame, bool doflush=true)
 Skips ahead or rewinds to desiredFrame.
virtual bool isLastFrameKey ()=0
virtual void WriteStoredData (RingBuffer *rb, 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.
virtual void UpdateFramesPlayed (void)
long long GetFramesRead (void) const
virtual QString GetCodecDecoderName (void) const =0
virtual MythCodecID GetVideoCodecID (void) const =0
virtual void * GetVideoCodecPrivate (void)
virtual bool SyncPositionMap (void)
 Updates the position map used for skipping frames.
virtual bool PosMapFromDb (void)
virtual bool PosMapFromEnc (void)
virtual bool FindPosition (long long desired_value, bool search_adjusted, int &lower_bound, int &upper_bound)
virtual void SetPositionMap (void)
virtual void SeekReset (long long newkey, uint skipFrames, bool doFlush, bool discardFrames)
void setTranscoding (bool value)
bool IsErrored ()
void SetWaitForChange (void)
bool GetWaitForChange (void)
void SetReadAdjust (long long adjust)
void ChangeDVDTrack (bool ffw)
long long DVDFindPosition (long long desiredFrame)
void UpdateDVDFramesPlayed (void)
virtual QStringList GetTracks (uint type) const
virtual uint GetTrackCount (uint type) const
virtual int GetTrackLanguageIndex (uint type, uint trackNo) const
virtual QString GetTrackDesc (uint type, uint trackNo) const
virtual int SetTrack (uint type, int trackNo)
int GetTrack (uint type) const
StreamInfo GetTrackInfo (uint type, uint trackNo) const
int IncrementTrack (uint type)
int DecrementTrack (uint type)
int ChangeTrack (uint type, int dir)
virtual bool InsertTrack (uint type, const StreamInfo &)
virtual int GetTeletextDecoderType (void) const
virtual void SetTeletextDecoderViewer (TeletextViewer *)
virtual QString GetXDS (const QString &) const
virtual bool SetAudioByComponentTag (int)
virtual bool SetVideoByComponentTag (int)

Protected Types

typedef struct
DecoderBase::posmapentry 
PosMapEntry

Protected Member Functions

virtual int AutoSelectTrack (uint type)
 Select best track.
void AutoSelectTracks (void)
void ResetTracks (void)
void FileChanged (void)
bool DoRewindSeek (long long desiredFrame)
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.
long long GetLastFrameInPosMap (long long desiredFrame)
long long GetKey (PosMapEntry &entry) const

Protected Attributes

NuppelVideoPlayerm_parent
ProgramInfom_playbackinfo
RingBufferringBuffer
RemoteEncodernvr_enc
int current_width
int current_height
float current_aspect
double fps
uint bitrate
long long framesPlayed
long long framesRead
long long lastKey
int keyframedist
long long indexOffset
bool ateof
bool exitafterdecoded
bool transcoding
bool hasFullPositionMap
bool recordingHasPositionMap
bool posmapStarted
MarkTypes positionMapType
QValueVector< PosMapEntrym_positionMap
bool dontSyncPositionMap
bool exactseeks
bool livetv
bool watchingrecording
bool hasKeyFrameAdjustTable
bool lowbuffers
bool getrawframes
bool getrawvideo
bool errored
bool waitingForChange
long long readAdjust
bool justAfterChange
int currentTrack [kTrackTypeCount]
sinfo_vec_t tracks [kTrackTypeCount]
StreamInfo wantedTrack [kTrackTypeCount]
StreamInfo selectedTrack [(uint) kTrackTypeCount]
vector< int > languagePreference
 language preferences for auto-selection of streams

Classes

struct  posmapentry

Member Typedef Documentation


Constructor & Destructor Documentation

DecoderBase::DecoderBase ( NuppelVideoPlayer parent,
ProgramInfo pginfo 
)

Definition at line 20 of file decoderbase.cpp.

DecoderBase::~DecoderBase (  )  [virtual]

Definition at line 56 of file decoderbase.cpp.


Member Function Documentation

void DecoderBase::Reset ( void   )  [virtual]

Reimplemented in AvFormatDecoder.

Definition at line 72 of file decoderbase.cpp.

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

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

void DecoderBase::setExactSeeks ( bool  exact  )  [inline]

void DecoderBase::setLiveTVMode ( bool  live  )  [inline]

Definition at line 70 of file decoderbase.h.

Referenced by NuppelVideoPlayer::OpenFile().

void DecoderBase::setRecorder ( RemoteEncoder recorder  )  [inline]

Definition at line 71 of file decoderbase.h.

Referenced by NuppelVideoPlayer::OpenFile(), and NuppelVideoPlayer::SetRecorder().

void DecoderBase::SetProgramInfo ( ProgramInfo pginfo  ) 

void DecoderBase::SetLowBuffers ( bool  low  )  [inline]

virtual void DecoderBase::SetDisablePassThrough ( bool  disable  )  [inline, virtual]

Disables AC3/DTS pass through.

Reimplemented in AvFormatDecoder.

Definition at line 78 of file decoderbase.h.

Referenced by NuppelVideoPlayer::DoPlay().

void DecoderBase::setWatchingRecording ( bool  mode  )  [virtual]

virtual bool DecoderBase::GetFrame ( int  onlyvideo  )  [pure virtual]

Decode a frame of video/audio.

If onlyvideo is +1, decodes the video portion, if it is -1 only decodes the audio portion, if it is 0 it decodes audio and video

Implemented in AvFormatDecoder, DummyDecoder, IvtvDecoder, and NuppelDecoder.

Referenced by DoFastForward(), NuppelVideoPlayer::GetFrameFFREW(), and NuppelVideoPlayer::TranscodeGetNextFrame().

NuppelVideoPlayer* DecoderBase::GetNVP (  )  [inline]

bool DecoderBase::DoRewind ( long long  desiredFrame,
bool  doflush = true 
) [virtual]

bool DecoderBase::DoFastForward ( long long  desiredFrame,
bool  doflush = 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, and IvtvDecoder.

Definition at line 545 of file decoderbase.cpp.

Referenced by NuppelVideoPlayer::DoFastForward(), IvtvDecoder::DoFastForward(), AvFormatDecoder::DoFastForward(), NuppelVideoPlayer::DoPause(), NuppelVideoPlayer::GetFrameFFREW(), and NuppelVideoPlayer::TranscodeGetNextFrame().

virtual bool DecoderBase::isLastFrameKey (  )  [pure virtual]

virtual void DecoderBase::WriteStoredData ( RingBuffer rb,
bool  storevid,
long  timecodeOffset 
) [pure virtual]

virtual void DecoderBase::ClearStoredData ( void   )  [inline, virtual]

Reimplemented in NuppelDecoder.

Definition at line 93 of file decoderbase.h.

Referenced by NuppelVideoPlayer::TranscodeGetNextFrame().

virtual void DecoderBase::SetRawAudioState ( bool  state  )  [inline, virtual]

Reimplemented in AvFormatDecoder, and IvtvDecoder.

Definition at line 94 of file decoderbase.h.

Referenced by NuppelVideoPlayer::InitForTranscode().

virtual bool DecoderBase::GetRawAudioState ( void   )  const [inline, virtual]

Reimplemented in AvFormatDecoder, and IvtvDecoder.

Definition at line 95 of file decoderbase.h.

Referenced by NuppelVideoPlayer::GetRawAudioState().

virtual void DecoderBase::SetRawVideoState ( bool  state  )  [inline, virtual]

Reimplemented in AvFormatDecoder, and IvtvDecoder.

Definition at line 96 of file decoderbase.h.

Referenced by NuppelVideoPlayer::InitForTranscode().

virtual bool DecoderBase::GetRawVideoState ( void   )  const [inline, virtual]

Reimplemented in AvFormatDecoder, and IvtvDecoder.

Definition at line 97 of file decoderbase.h.

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

virtual double DecoderBase::GetFPS ( void   )  const [inline, virtual]

Definition at line 101 of file decoderbase.h.

Referenced by NuppelVideoPlayer::IsReallyNearEnd().

uint DecoderBase::GetRawBitrate ( void   )  const [inline]

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

Definition at line 103 of file decoderbase.h.

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

void DecoderBase::UpdateFramesPlayed ( void   )  [virtual]

Reimplemented in IvtvDecoder.

Definition at line 671 of file decoderbase.cpp.

Referenced by NuppelVideoPlayer::Pause(), and NuppelVideoPlayer::StartPlaying().

long long DecoderBase::GetFramesRead ( void   )  const [inline]

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

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

virtual void* DecoderBase::GetVideoCodecPrivate ( void   )  [inline, virtual]

Reimplemented in AvFormatDecoder.

Definition at line 110 of file decoderbase.h.

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

Referenced by NuppelVideoPlayer::FileChangedCallback(), AvFormatDecoder::GetFrame(), GetLastFrameInPosMap(), AvFormatDecoder::HandleGopStart(), NuppelVideoPlayer::JumpToProgram(), NuppelDecoder::OpenFile(), IvtvDecoder::OpenFile(), AvFormatDecoder::OpenFile(), AvFormatDecoder::Reset(), setWatchingRecording(), NuppelVideoPlayer::StartPlaying(), and NuppelVideoPlayer::SwitchToProgram().

bool DecoderBase::PosMapFromDb ( void   )  [virtual]

Definition at line 101 of file decoderbase.cpp.

Referenced by SyncPositionMap().

bool DecoderBase::PosMapFromEnc ( void   )  [virtual]

Definition at line 182 of file decoderbase.cpp.

Referenced by SyncPositionMap().

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

Definition at line 362 of file decoderbase.cpp.

Referenced by DoFastForwardSeek(), and DoRewindSeek().

void DecoderBase::SetPositionMap ( void   )  [virtual]

Definition at line 420 of file decoderbase.cpp.

Referenced by NuppelVideoPlayer::RebuildSeekTable().

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

void DecoderBase::setTranscoding ( bool  value  )  [inline]

bool DecoderBase::IsErrored (  )  [inline]

void DecoderBase::SetWaitForChange ( void   ) 

Definition at line 693 of file decoderbase.cpp.

Referenced by NuppelVideoPlayer::SwitchToProgram().

bool DecoderBase::GetWaitForChange ( void   ) 

Definition at line 698 of file decoderbase.cpp.

Referenced by NuppelVideoPlayer::StartPlaying().

void DecoderBase::SetReadAdjust ( long long  adjust  ) 

Definition at line 688 of file decoderbase.cpp.

Referenced by NuppelVideoPlayer::SwitchToProgram().

void DecoderBase::ChangeDVDTrack ( bool  ffw  ) 

Definition at line 703 of file decoderbase.cpp.

Referenced by NuppelVideoPlayer::DoChangeDVDTrack().

long long DecoderBase::DVDFindPosition ( long long  desiredFrame  ) 

Definition at line 726 of file decoderbase.cpp.

Referenced by DoFastForwardSeek(), and DoRewindSeek().

void DecoderBase::UpdateDVDFramesPlayed ( void   ) 

QStringList DecoderBase::GetTracks ( uint  type  )  const [virtual]

Definition at line 768 of file decoderbase.cpp.

Referenced by NuppelVideoPlayer::GetTracks().

virtual uint DecoderBase::GetTrackCount ( uint  type  )  const [inline, virtual]

int DecoderBase::GetTrackLanguageIndex ( uint  type,
uint  trackNo 
) const [virtual]

Definition at line 780 of file decoderbase.cpp.

Referenced by NuppelVideoPlayer::EnableCaptions().

QString DecoderBase::GetTrackDesc ( uint  type,
uint  trackNo 
) const [virtual]

int DecoderBase::SetTrack ( uint  type,
int  trackNo 
) [virtual]

int DecoderBase::GetTrack ( uint  type  )  const [inline]

Definition at line 144 of file decoderbase.h.

Referenced by NuppelVideoPlayer::GetTrack().

StreamInfo DecoderBase::GetTrackInfo ( uint  type,
uint  trackNo 
) const

Definition at line 830 of file decoderbase.cpp.

Referenced by NuppelVideoPlayer::SetTrack().

int DecoderBase::IncrementTrack ( uint  type  )  [inline]

Definition at line 236 of file decoderbase.h.

Referenced by ChangeTrack().

int DecoderBase::DecrementTrack ( uint  type  )  [inline]

Definition at line 245 of file decoderbase.h.

Referenced by ChangeTrack().

int DecoderBase::ChangeTrack ( uint  type,
int  dir 
) [inline]

Definition at line 254 of file decoderbase.h.

bool DecoderBase::InsertTrack ( uint  type,
const StreamInfo info 
) [virtual]

Definition at line 843 of file decoderbase.cpp.

Referenced by NuppelVideoPlayer::DefineWindow().

virtual int DecoderBase::GetTeletextDecoderType ( void   )  const [inline, virtual]

Reimplemented in AvFormatDecoder.

Definition at line 151 of file decoderbase.h.

virtual void DecoderBase::SetTeletextDecoderViewer ( TeletextViewer  )  [inline, virtual]

Reimplemented in AvFormatDecoder.

Definition at line 152 of file decoderbase.h.

Referenced by NuppelVideoPlayer::EnableTeletext(), and NuppelVideoPlayer::StartPlaying().

virtual QString DecoderBase::GetXDS ( const QString &   )  const [inline, virtual]

Reimplemented in AvFormatDecoder.

Definition at line 154 of file decoderbase.h.

Referenced by NuppelVideoPlayer::GetXDS().

virtual bool DecoderBase::SetAudioByComponentTag ( int   )  [inline, virtual]

Reimplemented in AvFormatDecoder.

Definition at line 157 of file decoderbase.h.

Referenced by NuppelVideoPlayer::SetAudioByComponentTag().

virtual bool DecoderBase::SetVideoByComponentTag ( int   )  [inline, virtual]

Reimplemented in AvFormatDecoder.

Definition at line 158 of file decoderbase.h.

Referenced by NuppelVideoPlayer::SetVideoByComponentTag().

int DecoderBase::AutoSelectTrack ( uint  type  )  [protected, virtual]

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

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

void DecoderBase::AutoSelectTracks ( void   )  [inline, protected]

Definition at line 262 of file decoderbase.h.

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

void DecoderBase::ResetTracks ( void   )  [inline, protected]

Definition at line 268 of file decoderbase.h.

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

void DecoderBase::FileChanged ( void   )  [protected]

bool DecoderBase::DoRewindSeek ( long long  desiredFrame  )  [protected]

Definition at line 470 of file decoderbase.cpp.

Referenced by DoRewind().

void DecoderBase::DoFastForwardSeek ( long long  desiredFrame,
bool needflush 
) [protected]

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:
desiredFrame frame we are attempting to seek to.
needflush set to true if a seek is made.

Definition at line 640 of file decoderbase.cpp.

Referenced by DoFastForward().

long long DecoderBase::GetLastFrameInPosMap ( long long  desiredFrame  )  [protected]

Definition at line 504 of file decoderbase.cpp.

Referenced by DoFastForward().

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

Definition at line 464 of file decoderbase.cpp.

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


Member Data Documentation

Definition at line 180 of file decoderbase.h.

Referenced by GetNVP(), and PosMapFromEnc().

Definition at line 184 of file decoderbase.h.

Referenced by PosMapFromEnc(), and setRecorder().

int DecoderBase::current_width [protected]

int DecoderBase::current_height [protected]

float DecoderBase::current_aspect [protected]

double DecoderBase::fps [protected]

long long DecoderBase::framesPlayed [protected]

long long DecoderBase::framesRead [protected]

long long DecoderBase::lastKey [protected]

int DecoderBase::keyframedist [protected]

long long DecoderBase::indexOffset [protected]

Definition at line 196 of file decoderbase.h.

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

bool DecoderBase::ateof [protected]

Definition at line 199 of file decoderbase.h.

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

QValueVector<PosMapEntry> DecoderBase::m_positionMap [protected]

Definition at line 208 of file decoderbase.h.

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

Definition at line 214 of file decoderbase.h.

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

Definition at line 216 of file decoderbase.h.

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

Definition at line 221 of file decoderbase.h.

Referenced by IsErrored(), NuppelDecoder::NuppelDecoder(), and AvFormatDecoder::Reset().

long long DecoderBase::readAdjust [protected]

Definition at line 225 of file decoderbase.h.

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

int DecoderBase::currentTrack[kTrackTypeCount] [protected]

sinfo_vec_t DecoderBase::tracks[kTrackTypeCount] [protected]

StreamInfo DecoderBase::wantedTrack[kTrackTypeCount] [protected]

Definition at line 230 of file decoderbase.h.

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

StreamInfo DecoderBase::selectedTrack[(uint) kTrackTypeCount] [protected]

vector<int> DecoderBase::languagePreference [protected]

language preferences for auto-selection of streams

Definition at line 233 of file decoderbase.h.

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


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

Generated on Sat Dec 18 05:16:01 2010 for MythTV by  doxygen 1.5.5