diff options
-rw-r--r-- | p2pvr/devices/mockTuner.cpp | 9 | ||||
-rw-r--r-- | p2pvr/devices/mockTuner.h | 1 |
2 files changed, 7 insertions, 3 deletions
diff --git a/p2pvr/devices/mockTuner.cpp b/p2pvr/devices/mockTuner.cpp index c7c51a7..fa21b9a 100644 --- a/p2pvr/devices/mockTuner.cpp +++ b/p2pvr/devices/mockTuner.cpp @@ -39,7 +39,7 @@ int MockTuner::GetStatus(const Ice::Current&) return 0; } -void MockTuner::DecompressAndSendPackets(const Ice::ByteSeq & dataxz, const P2PVR::RawDataClientPrx & client, const Ice::Current & ice) const +Ice::ByteSeq MockTuner::Decompress(const Ice::ByteSeq & dataxz) { Logger()->messagebf(LOG_DEBUG, "%s: setup", __PRETTY_FUNCTION__); lzma_stream strm = LZMA_STREAM_INIT; @@ -62,10 +62,13 @@ void MockTuner::DecompressAndSendPackets(const Ice::ByteSeq & dataxz, const P2PV } } while (strm.avail_out == 0); data.shrink_to_fit(); - + return data; +} +void MockTuner::DecompressAndSendPackets(const Ice::ByteSeq & dataxz, const P2PVR::RawDataClientPrx & client, const Ice::Current & ice) const +{ Logger()->messagebf(LOG_DEBUG, "%s: deserialize", __PRETTY_FUNCTION__); std::list<Ice::ByteSeq> packets; - auto istrm = Ice::createInputStream(ice.adapter->getCommunicator(), data); + auto istrm = Ice::createInputStream(ice.adapter->getCommunicator(), Decompress(dataxz)); istrm->read(packets); Logger()->messagebf(LOG_DEBUG, "%s: send", __PRETTY_FUNCTION__); diff --git a/p2pvr/devices/mockTuner.h b/p2pvr/devices/mockTuner.h index 31d12cb..8e0c513 100644 --- a/p2pvr/devices/mockTuner.h +++ b/p2pvr/devices/mockTuner.h @@ -26,6 +26,7 @@ class MockTuner : public P2PVR::PrivateTuner { 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; static int eventSet; |