vdr  2.7.6
dvbplayer.h
Go to the documentation of this file.
1 /*
2  * dvbplayer.h: The DVB player
3  *
4  * See the main source file 'vdr.c' for copyright information and
5  * how to reach the author.
6  *
7  * $Id: dvbplayer.h 5.2 2025/03/02 11:03:35 kls Exp $
8  */
9 
10 #ifndef __DVBPLAYER_H
11 #define __DVBPLAYER_H
12 
13 #include "player.h"
14 #include "recording.h"
15 #include "thread.h"
16 
17 class cDvbPlayer;
18 
19 class cDvbPlayerControl : public cControl {
20 private:
22 public:
23  cDvbPlayerControl(const char *FileName, bool PauseLive = false);
24  // Sets up a player for the given file.
25  // If PauseLive is true, special care is taken to make sure the index
26  // file of the recording is long enough to allow the player to display
27  // the first frame in still picture mode.
28  virtual ~cDvbPlayerControl() override;
29  void SetMarks(const cMarks *Marks);
30  bool Active(void);
31  void Stop(void);
32  // Stops the current replay session (if any).
33  void Pause(void);
34  // Pauses the current replay session, or resumes a paused session.
35  void Play(void);
36  // Resumes normal replay mode.
37  void Forward(void);
38  // Runs the current replay session forward at a higher speed.
39  void Backward(void);
40  // Runs the current replay session backwards at a higher speed.
41  int SkipFrames(int Frames);
42  // Returns the new index into the current replay session after skipping
43  // the given number of frames (no actual repositioning is done!).
44  // The sign of 'Frames' determines the direction in which to skip.
45  void SkipSeconds(int Seconds);
46  // Skips the given number of seconds in the current replay session.
47  // The sign of 'Seconds' determines the direction in which to skip.
48  // Use a very large negative value to go all the way back to the
49  // beginning of the recording.
50  const cErrors *GetErrors(void);
51  // Returns the frame indexes of errors in the recording (if any).
52  bool GetIndex(int &Current, int &Total, bool SnapToIFrame = false);
53  // Returns the current and total frame index, optionally snapped to the
54  // nearest I-frame.
55  bool GetFrameNumber(int &Current, int &Total);
56  // Returns the current and total frame number. In contrast to GetIndex(),
57  // this function respects the chronological order of frames, which is
58  // different from its index for streams containing B frames (e.g. H264)
59  bool GetReplayMode(bool &Play, bool &Forward, int &Speed);
60  // Returns the current replay mode (if applicable).
61  // 'Play' tells whether we are playing or pausing, 'Forward' tells whether
62  // we are going forward or backward and 'Speed' is -1 if this is normal
63  // play/pause mode, 0 if it is single speed fast/slow forward/back mode
64  // and >0 if this is multi speed mode.
65  void Goto(int Index, bool Still = false);
66  // Positions to the given index and displays that frame as a still picture
67  // if Still is true. If Still is false, Play() will be called.
68  };
69 
70 #endif //__DVBPLAYER_H
void SetMarks(const cMarks *Marks)
Definition: dvbplayer.c:1009
virtual ~cDvbPlayerControl() override
Definition: dvbplayer.c:1004
bool GetIndex(int &Current, int &Total, bool SnapToIFrame=false)
Definition: dvbplayer.c:1071
const cErrors * GetErrors(void)
Definition: dvbplayer.c:1064
void SkipSeconds(int Seconds)
Definition: dvbplayer.c:1051
cDvbPlayerControl(const char *FileName, bool PauseLive=false)
Definition: dvbplayer.c:997
bool GetReplayMode(bool &Play, bool &Forward, int &Speed)
Definition: dvbplayer.c:1089
void Pause(void)
Definition: dvbplayer.c:1027
int SkipFrames(int Frames)
Definition: dvbplayer.c:1057
void Goto(int Index, bool Still=false)
Definition: dvbplayer.c:1094
void Stop(void)
Definition: dvbplayer.c:1020
void Forward(void)
Definition: dvbplayer.c:1039
bool Active(void)
Definition: dvbplayer.c:1015
bool GetFrameNumber(int &Current, int &Total)
Definition: dvbplayer.c:1080
void Play(void)
Definition: dvbplayer.c:1033
void Backward(void)
Definition: dvbplayer.c:1045
cDvbPlayer * player
Definition: dvbplayer.h:21