summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--p2pvr/lib/fileSink.cpp5
-rw-r--r--p2pvr/lib/fileSink.h1
-rw-r--r--p2pvr/lib/serviceStreamer.cpp4
-rw-r--r--p2pvr/lib/serviceStreamer.h4
4 files changed, 10 insertions, 4 deletions
diff --git a/p2pvr/lib/fileSink.cpp b/p2pvr/lib/fileSink.cpp
index 94379ea..dade921 100644
--- a/p2pvr/lib/fileSink.cpp
+++ b/p2pvr/lib/fileSink.cpp
@@ -6,6 +6,11 @@ FileSink::FileSink(const boost::filesystem::path & path) :
{
}
+FileSink::FileSink(int fd) :
+ file(fdopen(fd, "w"))
+{
+}
+
FileSink::~FileSink()
{
if (file) {
diff --git a/p2pvr/lib/fileSink.h b/p2pvr/lib/fileSink.h
index a89016c..40644cd 100644
--- a/p2pvr/lib/fileSink.h
+++ b/p2pvr/lib/fileSink.h
@@ -8,6 +8,7 @@
class FileSink : public P2PVR::RawDataClient {
public:
FileSink(const boost::filesystem::path & path);
+ FileSink(int fd);
~FileSink();
bool NewData(const P2PVR::Data & data, const Ice::Current &);
diff --git a/p2pvr/lib/serviceStreamer.cpp b/p2pvr/lib/serviceStreamer.cpp
index d1bab4f..a26d157 100644
--- a/p2pvr/lib/serviceStreamer.cpp
+++ b/p2pvr/lib/serviceStreamer.cpp
@@ -4,11 +4,11 @@
#include "fileSink.h"
#include "bindSiParserHandler.h"
-ServiceStreamer::ServiceStreamer(int sid, const Ice::CommunicatorPtr & ic, const Ice::ObjectAdapterPtr & a) :
+ServiceStreamer::ServiceStreamer(int sid, P2PVR::RawDataClientPrx t, const Ice::CommunicatorPtr & ic, const Ice::ObjectAdapterPtr & a) :
adapter(a),
devs(P2PVR::DevicesPrx::checkedCast(adapter->createProxy(ic->stringToIdentity("GlobalDevices")))),
si(P2PVR::SIPrx::checkedCast(adapter->createProxy(ic->stringToIdentity("SI")))),
- target(adapter, new FileSink("/tmp/out.ts")),
+ target(t),
patParser(adapter, new BindSiParserHandler<ProgramAssociationMapPtr, SiProgramAssociationParser>(boost::bind(&ServiceStreamer::HandlePAT, this, _1))),
pmtParser(adapter, new BindSiParserHandler<DVBSI::ProgramMapPtr, SiProgramMapParser>(boost::bind(&ServiceStreamer::HandlePMT, this, _1))),
serviceId(sid),
diff --git a/p2pvr/lib/serviceStreamer.h b/p2pvr/lib/serviceStreamer.h
index 3ea0c5c..f140050 100644
--- a/p2pvr/lib/serviceStreamer.h
+++ b/p2pvr/lib/serviceStreamer.h
@@ -11,7 +11,7 @@
class ServiceStreamer {
public:
- ServiceStreamer(int sid, const Ice::CommunicatorPtr & ic, const Ice::ObjectAdapterPtr & a);
+ ServiceStreamer(int sid, P2PVR::RawDataClientPrx, const Ice::CommunicatorPtr & ic, const Ice::ObjectAdapterPtr & a);
~ServiceStreamer();
bool HandlePAT(ProgramAssociationMapPtr pam);
@@ -25,7 +25,7 @@ class ServiceStreamer {
P2PVR::DevicesPrx devs;
P2PVR::SIPrx si;
P2PVR::TunerPrx tuner;
- TemporarayIceAdapterObject<P2PVR::RawDataClient> target;
+ P2PVR::RawDataClientPrx target;
TemporarayIceAdapterObject<P2PVR::RawDataClient> patParser;
TemporarayIceAdapterObject<P2PVR::RawDataClient> pmtParser;