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