summaryrefslogtreecommitdiff
path: root/p2pvr/devices/mockTuner.h
blob: aa51580b301022da63fbe43eb5756d9c878863a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef P2PVR_MOCKTUNER_H
#define P2PVR_MOCKTUNER_H

#include <dvb.h>
#include <Ice/BuiltinSequences.h>
#include <boost/thread.hpp>

class MockTuner : public P2PVR::PrivateTuner {
	public:
		MockTuner();

		void TuneTo(const DVBSI::DeliveryPtr &, const Ice::Current&);
		int GetStatus(const Ice::Current&);

		void ScanAndSendNetworkInformation(const P2PVR::RawDataClientPrx & client, const Ice::Current&);
		void SendNetworkInformation(const P2PVR::RawDataClientPrx & client, const Ice::Current&);
		void SendBouquetAssociations(const P2PVR::RawDataClientPrx & client, const Ice::Current&);
		void SendServiceDescriptions(const P2PVR::RawDataClientPrx & client, const Ice::Current&);
		void SendProgramMap(Ice::Int pid, const P2PVR::RawDataClientPrx & client, const Ice::Current&);
		void SendProgramAssociationTable(const P2PVR::RawDataClientPrx & client, const Ice::Current&);
		void SendEventInformation(const P2PVR::RawDataClientPrx & client, const Ice::Current&);

		int StartSendingTS(const P2PVR::PacketIds & pids, const P2PVR::RawDataClientPrx & client, const Ice::Current &);
		int StartSendingSection(Ice::Int pid, const P2PVR::RawDataClientPrx & client, const Ice::Current &);
		void StopSending(int handle, const Ice::Current &);

		Ice::Long GetLastUsedTime(const Ice::Current&);

		static void SetEventsSet(int n);

	protected:
		static Ice::ByteSeq Decompress(const Ice::ByteSeq &);
		void DecompressAndSendPackets(const Ice::ByteSeq &, const P2PVR::RawDataClientPrx &, const Ice::Current&) const;
		void SendLoop(const P2PVR::RawDataClientPrx & t, const Ice::ByteSeq & dataxz, const Ice::Current & ice) const;

		static int eventSet;
		std::map<int, boost::thread *> senders;
		int senderId;
};

#endif