summaryrefslogtreecommitdiff
path: root/p2pvr/lib/serviceStreamer.h
blob: f1400506bd2215f071f74937bfcbb86deed2b629 (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 SERVICESTREAMER_H
#define SERVICESTREAMER_H

#include <Ice/Communicator.h>
#include <Ice/ObjectAdapter.h>
#include "siParsers/programAssociation.h"
#include "siParsers/programMap.h"
#include "temporaryIceAdapterObject.h"
#include <p2pvr.h>
#include <set>

class ServiceStreamer {
	public:
		ServiceStreamer(int sid, P2PVR::RawDataClientPrx, const Ice::CommunicatorPtr & ic, const Ice::ObjectAdapterPtr & a);
		~ServiceStreamer();

		bool HandlePAT(ProgramAssociationMapPtr pam);
		bool HandlePMT(DVBSI::ProgramMapPtr pmp);
		void Start();
		void Stop();
	private:
		void stopHandle(int & handle);

		const Ice::ObjectAdapterPtr & adapter;
		P2PVR::DevicesPrx devs;
		P2PVR::SIPrx si;
		P2PVR::TunerPrx tuner;
		P2PVR::RawDataClientPrx target;
		TemporarayIceAdapterObject<P2PVR::RawDataClient> patParser;
		TemporarayIceAdapterObject<P2PVR::RawDataClient> pmtParser;

		int serviceId;
		int patHandle;
		int pmtStream;
		int pmtHandle;
		typedef std::set<int> Streams;
		Streams streams;
		int serviceHandle;
};

#endif