]> git.vomp.tv Git - vompserver.git/blob - vompclientrrproc.h
Added Marten's queueing for incoming packets
[vompserver.git] / vompclientrrproc.h
1 /*
2     Copyright 2008 Chris Tallon
3
4     This file is part of VOMP.
5
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.
10
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.
15
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.
19 */
20
21 #ifndef VOMPCLIENTRRPROC_H
22 #define VOMPCLIENTRRPROC_H
23
24 #include "thread.h"
25 #include "responsepacket.h"
26 #include <queue>
27
28 using namespace std;
29
30 class VompClient;
31 class Log;
32
33 class RequestPacket
34 {
35   public:
36     RequestPacket(ULONG requestID, ULONG opcode, UCHAR* data, ULONG dataLength)
37      : requestID(requestID), opcode(opcode), data(data), dataLength(dataLength) {}
38     
39     ULONG requestID;
40     ULONG opcode;
41     UCHAR* data;
42     ULONG dataLength;
43 };
44
45 typedef queue<RequestPacket*> RequestPacketQueue;
46
47 class VompClientRRProc : public Thread
48 {
49   public:
50     VompClientRRProc(VompClient& x);
51     ~VompClientRRProc();
52     
53     bool init();
54     bool recvRequest(RequestPacket*);
55
56   private:
57     bool processPacket();
58   
59 #ifndef VOMPSTANDALONE
60     int processGetRecordingsList();
61     int processDeleteRecording();
62     int processMoveRecording();
63     int processGetChannelsList();
64     int processStartStreamingChannel();
65     int processGetBlock();
66     int processStopStreaming();
67     int processStartStreamingRecording();
68     int processGetChannelSchedule();
69     int processGetTimers();
70     int processSetTimer();
71     int processPositionFromFrameNumber();
72     int processFrameNumberFromPosition();
73     int processGetIFrame();
74     int processGetRecInfo();
75     int processGetMarks();
76     int processGetChannelPids();
77     int processDeleteTimer();
78     int processReScanRecording();           // FIXME obselete
79 #endif
80     int processLogin();
81     int processConfigSave();
82     int processConfigLoad();
83     int processGetMediaList();
84     int processGetPicture();
85     int processGetImageBlock();
86     int processGetLanguageList();
87     int processGetLanguageContent();
88
89     void threadMethod();
90
91     VompClient& x;
92     RequestPacket* req;
93     RequestPacketQueue req_queue;
94     ResponsePacket* resp;
95     
96     Log* log;
97 };
98
99 #endif
100