vdr 2.8.3
cDvbPlayer Class Reference

Public Member Functions

 cDvbPlayer (const char *FileName, bool PauseLive)
virtual ~cDvbPlayer () override
void SetMarks (const cMarks *Marks)
bool Active (void)
void Pause (void)
void Play (void)
void Forward (void)
void Backward (void)
int SkipFrames (int Frames)
void SkipSeconds (int Seconds)
void Goto (int Position, bool Still=false)
virtual double FramesPerSecond (void) override
virtual void SetAudioTrack (eTrackType Type, const tTrackId *TrackId) override
virtual const cErrors * GetErrors (void) override
virtual bool GetIndex (int &Current, int &Total, bool SnapToIFrame=false) override
virtual bool GetFrameNumber (int &Current, int &Total) override
virtual bool GetReplayMode (bool &Play, bool &Forward, int &Speed) override
Public Member Functions inherited from cPlayer
 cPlayer (ePlayMode PlayMode=pmAudioVideo)
virtual ~cPlayer ()
bool IsAttached (void)
virtual void SetSubtitleTrack (eTrackType Type, const tTrackId *TrackId)

Protected Member Functions

virtual void Activate (bool On) override
virtual void Action (void) override
Protected Member Functions inherited from cPlayer
void DeviceClrAvailableTracks (bool DescriptionsOnly=false)
bool DeviceSetAvailableTrack (eTrackType Type, int Index, uint16_t Id, const char *Language=NULL, const char *Description=NULL)
bool DeviceSetCurrentAudioTrack (eTrackType Type)
bool DeviceSetCurrentSubtitleTrack (eTrackType Type)
bool DevicePoll (cPoller &Poller, int TimeoutMs=0)
bool DeviceFlush (int TimeoutMs=0)
bool DeviceDrain (void)
bool DeviceHasIBPTrickSpeed (void)
bool DeviceIsPlayingVideo (void)
void DeviceTrickSpeed (int Speed, bool Forward)
void DeviceClear (void)
void DevicePlay (void)
void DeviceFreeze (void)
void DeviceMute (void)
void DeviceSetVideoDisplayFormat (eVideoDisplayFormat VideoDisplayFormat)
void DeviceStillPicture (const uchar *Data, int Length)
void DeviceSetTempSubtitles (void)
uint64_t DeviceGetSTC (void)
void Detach (void)
int PlayPes (const uchar *Data, int Length, bool VideoOnly=false)
int PlayTs (const uchar *Data, int Length, bool VideoOnly=false)

Private Types

enum  ePlayModes {
  pmPlay , pmPause , pmSlow , pmFast ,
  pmStill
}
enum  ePlayDirs { pdForward , pdBackward }

Private Member Functions

void TrickSpeed (int Increment)
void Empty (void)
bool NextFile (uint16_t FileNumber=0, off_t FileOffset=-1)
int Resume (void)
bool Save (void)
Private Member Functions inherited from cThread
 cThread (const char *Description=NULL, bool LowPriority=false)
virtual ~cThread ()
void SetDescription (const char *Description,...) __attribute__((format(printf
void bool Start (void)
bool Active (void)
void SetPriority (int Priority)
void SetIOPriority (int Priority)
void Lock (void)
void Unlock (void)
bool Running (void)
void Cancel (int WaitSeconds=0)

Private Attributes

cNonBlockingFileReader * nonBlockingFileReader
cRingBufferFrame * ringBuffer
cPtsIndex ptsIndex
const cMarks * marks
cFileName * fileName
cIndexFile * index
cUnbufferedFile * replayFile
double framesPerSecond
bool isPesRecording
bool pauseLive
bool eof
bool firstPacket
std::atomic< ePlayModes > playMode
std::atomic< ePlayDirs > playDir
std::atomic< int > trickSpeed
std::atomic< int > readIndex
bool readIndependent
cFrame * readFrame
cFrame * playFrame
bool resyncAfterPause

Static Private Attributes

static int Speeds [] = { 0, -2, -4, -8, 1, 2, 4, 12, 0 }

Additional Inherited Members

Static Private Member Functions inherited from cThread
static tThreadId ThreadId (void)
static tThreadId IsMainThread (void)
static void SetMainThreadId (void)

Detailed Description

Definition at line 244 of file dvbplayer.c.

Member Enumeration Documentation

◆ ePlayDirs

enum cDvbPlayer::ePlayDirs
private
Enumerator
pdForward 
pdBackward 

Definition at line 247 of file dvbplayer.c.

◆ ePlayModes

enum cDvbPlayer::ePlayModes
private
Enumerator
pmPlay 
pmPause 
pmSlow 
pmFast 
pmStill 

Definition at line 246 of file dvbplayer.c.

Constructor & Destructor Documentation

◆ cDvbPlayer()

◆ ~cDvbPlayer()

cDvbPlayer::~cDvbPlayer ( )
overridevirtual

Definition at line 343 of file dvbplayer.c.

References cPlayer::Detach(), fileName, index, readFrame, ringBuffer, and Save().

Member Function Documentation

◆ Action()

void cDvbPlayer::Action ( void )
overrideprotectedvirtual

A derived cThread class must implement the code it wants to execute as a separate thread in this function.

If this is a loop, it must check Running() repeatedly to see whether it's time to stop.

Implements cThread.

Definition at line 457 of file dvbplayer.c.

References cFrame::cFrame(), cFrame::Count(), cFrame::Data(), cPlayer::DeviceDrain(), cPlayer::DeviceFreeze(), cPlayer::DeviceGetSTC(), cPlayer::DeviceHasIBPTrickSpeed(), cPlayer::DeviceIsPlayingVideo(), cPlayer::DevicePlay(), cPlayer::DevicePoll(), cRingBufferFrame::Drop(), Empty(), eof, esyslog, FATALERRNO, cPtsIndex::FindIndex(), cList< T >::First(), firstPacket, framesPerSecond, ftUnknown, cIndexFile::Get(), cMarks::Get(), cRingBufferFrame::Get(), cMarks::GetNextBegin(), cIndexFile::GetNextIFrame(), Goto(), cFrame::Independent(), cFrame::Index(), cListObject::Index(), index, IndexToHMSF(), isPesRecording, cIndexFile::IsStillRecording(), isyslog, cIndexFile::Last(), cListBase::Lock(), LOCK_THREAD, LOG_ERROR, marks, MAXFRAMESIZE, MAXSTUCKATEOF, NextFile(), nonBlockingFileReader, cSetup::PauseAtLastMark, pauseLive, pdBackward, pdForward, PesGetPts(), PesHasPts(), playDir, playFrame, playMode, cPlayer::PlayPes(), cPlayer::PlayTs(), pmFast, pmPause, pmPlay, pmSlow, pmStill, cMark::Position(), cFrame::Pts(), PtsDiff(), ptsIndex, cPtsIndex::Put(), cRingBufferFrame::Put(), readFrame, readIndependent, readIndex, cNonBlockingFileReader::Reading(), cStateKey::Remove(), replayFile, cNonBlockingFileReader::Request(), cNonBlockingFileReader::Result(), Resume(), ringBuffer, cThread::Running(), cRemux::SetBrokenLink(), Setup, cSetup::SkipEdited, cCondWait::SleepMs(), TsGetPts(), and cNonBlockingFileReader::WaitForDataMs().

◆ Activate()

void cDvbPlayer::Activate ( bool On)
overrideprotectedvirtual

Reimplemented from cPlayer.

Definition at line 447 of file dvbplayer.c.

References cThread::Cancel(), replayFile, and cThread::Start().

◆ Active()

bool cDvbPlayer::Active ( void )
inline

Definition at line 282 of file dvbplayer.c.

References cThread::Running().

Referenced by cDvbPlayerControl::Active().

◆ Backward()

◆ Empty()

◆ Forward()

◆ FramesPerSecond()

virtual double cDvbPlayer::FramesPerSecond ( void )
inlineoverridevirtual

Reimplemented from cPlayer.

Definition at line 290 of file dvbplayer.c.

References framesPerSecond.

◆ GetErrors()

const cErrors * cDvbPlayer::GetErrors ( void )
overridevirtual

Reimplemented from cPlayer.

Definition at line 961 of file dvbplayer.c.

References cIndexFile::GetErrors(), and index.

Referenced by cDvbPlayerControl::GetErrors().

◆ GetFrameNumber()

bool cDvbPlayer::GetFrameNumber ( int & Current,
int & Total )
overridevirtual

◆ GetIndex()

bool cDvbPlayer::GetIndex ( int & Current,
int & Total,
bool SnapToIFrame = false )
overridevirtual

◆ GetReplayMode()

bool cDvbPlayer::GetReplayMode ( bool & Play,
bool & Forward,
int & Speed )
overridevirtual

◆ Goto()

◆ NextFile()

bool cDvbPlayer::NextFile ( uint16_t FileNumber = 0,
off_t FileOffset = -1 )
private

Definition at line 395 of file dvbplayer.c.

References eof, fileName, cFileName::NextFile(), replayFile, and cFileName::SetOffset().

Referenced by Action(), Goto(), and Resume().

◆ Pause()

◆ Play()

◆ Resume()

int cDvbPlayer::Resume ( void )
private

Definition at line 405 of file dvbplayer.c.

References cIndexFile::Get(), cIndexFile::GetResume(), index, NextFile(), and cIndexFile::StoreResume().

Referenced by Action().

◆ Save()

◆ SetAudioTrack()

void cDvbPlayer::SetAudioTrack ( eTrackType Type,
const tTrackId * TrackId )
overridevirtual

Reimplemented from cPlayer.

Definition at line 946 of file dvbplayer.c.

References GetIndex(), Goto(), cPtsIndex::IsEmpty(), cThread::IsMainThread(), playMode, pmPause, pmPlay, ptsIndex, and resyncAfterPause.

◆ SetMarks()

void cDvbPlayer::SetMarks ( const cMarks * Marks)

Definition at line 354 of file dvbplayer.c.

References marks.

Referenced by cDvbPlayerControl::SetMarks().

◆ SkipFrames()

int cDvbPlayer::SkipFrames ( int Frames)

Definition at line 880 of file dvbplayer.c.

References GetIndex(), cIndexFile::GetNextIFrame(), and index.

Referenced by cDvbPlayerControl::SkipFrames().

◆ SkipSeconds()

◆ TrickSpeed()

void cDvbPlayer::TrickSpeed ( int Increment)
private

Member Data Documentation

◆ eof

bool cDvbPlayer::eof
private

Definition at line 259 of file dvbplayer.c.

Referenced by Action(), cDvbPlayer(), and NextFile().

◆ fileName

cFileName* cDvbPlayer::fileName
private

Definition at line 253 of file dvbplayer.c.

Referenced by cDvbPlayer(), NextFile(), and ~cDvbPlayer().

◆ firstPacket

bool cDvbPlayer::firstPacket
private

Definition at line 260 of file dvbplayer.c.

Referenced by Action(), cDvbPlayer(), and Empty().

◆ framesPerSecond

double cDvbPlayer::framesPerSecond
private

Definition at line 256 of file dvbplayer.c.

Referenced by Action(), cDvbPlayer(), FramesPerSecond(), Save(), and SkipSeconds().

◆ index

◆ isPesRecording

bool cDvbPlayer::isPesRecording
private

Definition at line 257 of file dvbplayer.c.

Referenced by Action(), cDvbPlayer(), and Goto().

◆ marks

const cMarks* cDvbPlayer::marks
private

Definition at line 252 of file dvbplayer.c.

Referenced by Action(), cDvbPlayer(), Save(), and SetMarks().

◆ nonBlockingFileReader

cNonBlockingFileReader* cDvbPlayer::nonBlockingFileReader
private

Definition at line 249 of file dvbplayer.c.

Referenced by Action(), cDvbPlayer(), and Empty().

◆ pauseLive

bool cDvbPlayer::pauseLive
private

Definition at line 258 of file dvbplayer.c.

Referenced by Action(), and cDvbPlayer().

◆ playDir

std::atomic<ePlayDirs> cDvbPlayer::playDir
private

◆ playFrame

cFrame* cDvbPlayer::playFrame
private

Definition at line 268 of file dvbplayer.c.

Referenced by Action(), cDvbPlayer(), and Empty().

◆ playMode

std::atomic<ePlayModes> cDvbPlayer::playMode
private

◆ ptsIndex

cPtsIndex cDvbPlayer::ptsIndex
private

Definition at line 251 of file dvbplayer.c.

Referenced by Action(), Empty(), GetFrameNumber(), GetIndex(), Goto(), Save(), SetAudioTrack(), and SkipSeconds().

◆ readFrame

cFrame* cDvbPlayer::readFrame
private

Definition at line 267 of file dvbplayer.c.

Referenced by Action(), cDvbPlayer(), Empty(), and ~cDvbPlayer().

◆ readIndependent

bool cDvbPlayer::readIndependent
private

Definition at line 266 of file dvbplayer.c.

Referenced by Action(), and cDvbPlayer().

◆ readIndex

std::atomic<int> cDvbPlayer::readIndex
private

Definition at line 265 of file dvbplayer.c.

Referenced by Action(), cDvbPlayer(), Empty(), Goto(), and SkipSeconds().

◆ replayFile

cUnbufferedFile* cDvbPlayer::replayFile
private

Definition at line 255 of file dvbplayer.c.

Referenced by Action(), Activate(), cDvbPlayer(), Goto(), and NextFile().

◆ resyncAfterPause

bool cDvbPlayer::resyncAfterPause
private

Definition at line 269 of file dvbplayer.c.

Referenced by cDvbPlayer(), Play(), and SetAudioTrack().

◆ ringBuffer

cRingBufferFrame* cDvbPlayer::ringBuffer
private

Definition at line 250 of file dvbplayer.c.

Referenced by Action(), cDvbPlayer(), Empty(), and ~cDvbPlayer().

◆ Speeds

int cDvbPlayer::Speeds = { 0, -2, -4, -8, 1, 2, 4, 12, 0 }
staticprivate

Definition at line 302 of file dvbplayer.c.

Referenced by TrickSpeed().

◆ trickSpeed

std::atomic<int> cDvbPlayer::trickSpeed
private

Definition at line 264 of file dvbplayer.c.

Referenced by Backward(), cDvbPlayer(), Forward(), GetReplayMode(), and TrickSpeed().


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