summaryrefslogtreecommitdiff
path: root/p2pvr/lib/serviceStreamer.h
blob: 3ea0c5c45778ab76d3d689062e4f4f028d0e4124 (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, 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;
		TemporarayIceAdapterObject<P2PVR::RawDataClient> 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