2 Copyright 2004-2005 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
33 #include "demuxervdr.h"
34 #include "demuxerts.h"
41 #include "messagequeue.h"
44 #include "threadwin.h"
49 class Player : public Thread_TYPE, public Callback
52 Player(MessageQueue* messageQueue, void* messageReceiver, bool isRecording);
57 void setStartFrame(ULONG frameNum);
58 void setLengthBytes(ULLONG length);
59 void setLengthFrames(ULONG length);
60 void setAudioChannel(int newChannel);
62 void play(); // Recording
63 void play(ULONG vpid, ULONG apid); // Live TV
68 void jumpToPercent(int percent);
69 void skipForward(int seconds);
70 void skipBackward(int seconds);
71 void jumpToMark(int mark);
73 UCHAR getState() { return state; }
74 ULONG getCurrentFrameNum();
75 ULONG getLengthFrames();
76 UCHAR getIScanRate() { return ifactor; }
77 bool* getDemuxerAudioChannels();
78 int getCurrentAudioChannel();
80 void call(void*); // for callback interface
82 const static UCHAR S_PLAY = 1;
83 const static UCHAR S_PAUSE_P = 2;
84 const static UCHAR S_PAUSE_I = 3;
85 const static UCHAR S_FFWD = 4;
86 const static UCHAR S_FBWD = 5;
87 const static UCHAR S_STOP = 6;
88 const static UCHAR S_JUMP = 7;
92 // FIXME so far this just duplicates the old system + the wss
94 const static UCHAR CONNECTION_LOST = 1;
95 const static UCHAR STOP_PLAYBACK = 2;
96 const static UCHAR STREAM_END = 3;
97 const static UCHAR ASPECT43 = 4;
98 const static UCHAR ASPECT169 = 5;
107 void threadPostStopCleanup();
110 void switchState(UCHAR newState, ULONG jumpFrame=0);
112 void threadFeedLive();
113 void threadFeedPlay();
114 void threadFeedScan();
116 void doConnectionLost();
117 void restartAtFrame(ULONG newFrame);
119 MessageQueue* messageQueue;
120 void* messageReceiver;
136 pthread_mutex_t mutex;
145 ULONG currentFrameNumber;
147 UINT startupBlockSize;
161 Play, Pause, FFwd, FBwd, (Stop), [Jump]