2 Copyright 2004-2008 Chris Tallon
\r
4 This file is part of VOMP.
\r
6 VOMP is free software; you can redistribute it and/or modify
\r
7 it under the terms of the GNU General Public License as published by
\r
8 the Free Software Foundation; either version 2 of the License, or
\r
9 (at your option) any later version.
\r
11 VOMP is distributed in the hope that it will be useful,
\r
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
14 GNU General Public License for more details.
\r
16 You should have received a copy of the GNU General Public License
\r
17 along with VOMP; if not, write to the Free Software
\r
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
\r
27 #include <sys/time.h>
\r
31 #include "threadsystem.h"
\r
33 #include "callback.h"
\r
34 #include "defines.h"
\r
39 #include "teletextdecodervbiebu.h"
\r
51 class Player : public Thread_TYPE, public Callback
\r
54 Player(MessageQueue* messageQueue, void* messageReceiver, OSDReceiver* osdReceiver);
\r
57 int init(bool p_isPesRecording,double framespersec);
\r
59 void setStartFrame(ULONG frameNum);
\r
60 void setLengthBytes(ULLONG length);
\r
61 void setLengthFrames(ULONG length);
\r
62 void setAudioChannel(int newChannel, int type, int streamtype);
\r
63 void setSubtitleChannel(int newChannel);
\r
64 bool toggleSubtitles();
\r
65 void turnSubtitlesOn(bool ison);
\r
66 bool isSubtitlesOn() { return subtitlesShowing; }
\r
73 void fastBackward();
\r
74 void jumpToPercent(double percent);
\r
75 void skipForward(int seconds);
\r
76 void skipBackward(int seconds);
\r
77 void jumpToMark(int mark);
\r
78 void jumpToFrameP(int newFrame);
\r
80 UCHAR getState() { return state; }
\r
81 ULONG getCurrentFrameNum();
\r
82 ULONG getLengthFrames();
\r
83 UCHAR getIScanRate() { return ifactor; }
\r
84 bool* getDemuxerMpegAudioChannels();
\r
85 bool* getDemuxerAc3AudioChannels();
\r
86 bool* getDemuxerSubtitleChannels();
\r
87 int *getTeletxtSubtitlePages();
\r
88 int getCurrentAudioChannel();
\r
89 int getCurrentSubtitleChannel();
\r
90 bool isPesRecording() { return is_pesrecording; }
\r
91 Channel *getDemuxerChannel();
\r
93 TeletextDecoderVBIEBU * getTeletextDecoder() { return teletext; }
\r
95 void call(void*); // for callback interface
\r
97 const static UCHAR S_PLAY = 1;
\r
98 const static UCHAR S_PAUSE_P = 2;
\r
99 const static UCHAR S_PAUSE_I = 3;
\r
100 const static UCHAR S_FFWD = 4;
\r
101 const static UCHAR S_FBWD = 5;
\r
102 const static UCHAR S_STOP = 6;
\r
103 const static UCHAR S_JUMP = 7;
\r
104 const static UCHAR S_JUMP_PI = 8; // Jump to Pause_I mode
\r
108 // FIXME so far this just duplicates the old system + the wss
\r
110 const static UCHAR CONNECTION_LOST = 1;
\r
111 const static UCHAR STOP_PLAYBACK = 2;
\r
112 const static UCHAR STREAM_END = 3;
\r
113 const static UCHAR ASPECT43 = 4;
\r
114 const static UCHAR ASPECT169 = 5;
\r
122 void threadMethod();
\r
123 void threadPostStopCleanup();
\r
126 void switchState(UCHAR newState, ULONG jumpFrame=0);
\r
128 void threadFeedPlay();
\r
129 void threadFeedScan();
\r
130 void threadPTSFeedScan();
\r
132 void doConnectionLost();
\r
133 void restartAtFrame(ULONG newFrame);
\r
134 void restartAtFramePI(ULONG newFrame);
\r
136 bool subtitlesShowing;
\r
137 MessageQueue* messageQueue;
\r
138 void* messageReceiver;
\r
139 OSDReceiver* osdReceiver;
\r
144 DVBSubtitles* subtitles;
\r
149 TeletextDecoderVBIEBU *teletext;
\r
157 bool is_pesrecording;
\r
161 pthread_mutex_t mutex;
\r
168 ULLONG lengthBytes;
\r
169 ULONG lengthFrames;
\r
170 ULONG currentFrameNumber;
\r
172 UINT startupBlockSize;
\r
173 UCHAR* threadBuffer;
\r
185 Play, Pause, FFwd, FBwd, (Stop), [Jump]
\r