summaryrefslogtreecommitdiff
path: root/p2pvr/devices/mockTuner.h
diff options
context:
space:
mode:
Diffstat (limited to 'p2pvr/devices/mockTuner.h')
-rw-r--r--p2pvr/devices/mockTuner.h36
1 files changed, 14 insertions, 22 deletions
diff --git a/p2pvr/devices/mockTuner.h b/p2pvr/devices/mockTuner.h
index d0db11e..74578db 100644
--- a/p2pvr/devices/mockTuner.h
+++ b/p2pvr/devices/mockTuner.h
@@ -6,42 +6,34 @@
#include <Ice/BuiltinSequences.h>
#include <boost/thread.hpp>
#include <logger.h>
+#include "tuner.h"
namespace P2PVR {
namespace Testing {
-class DLL_PUBLIC MockTuner : public Tuner {
+class DLL_PUBLIC MockTuner : public DVB::TunerI {
public:
- MockTuner(Ice::CommunicatorPtr);
+ MockTuner(const boost::filesystem::path & deviceFrontend, Ice::CommunicatorPtr);
- void TuneTo(const DVBSI::DeliveryPtr &) override;
- int GetStatus() override;
- std::string GetDevice() override;
-
- void ScanAndSendNetworkInformation(const RawDataClientPrx & client) override;
- void SendNetworkInformation(const RawDataClientPrx & client) override;
- void SendBouquetAssociations(const RawDataClientPrx & client) override;
- void SendServiceDescriptions(const RawDataClientPrx & client) override;
- void SendProgramMap(Ice::Int pid, const RawDataClientPrx & client) override;
- void SendProgramAssociationTable(const RawDataClientPrx & client) override;
- void SendEventInformation(const RawDataClientPrx & client) override;
-
- int StartSendingTS(const PacketIds & pids, const RawDataClientPrx & client) override;
- int StartSendingSection(Ice::Int pid, const RawDataClientPrx & client) override;
- void StopSending(int handle) override;
+ AdHoc::FileUtils::FileHandle OpenDemux() const override;
+ void RequestPID(int, int) const override;
+ void RequestTS(const PacketIds &, int fd) const override;
static void SetEventsSet(int n);
protected:
+ int iopoll(struct pollfd *fds, nfds_t nfds, int timeout) const override;
+ ssize_t ioread(int fd, void *buf, size_t count) const override;
+ int ioselect(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout) const override;
+
static Ice::ByteSeq Decompress(const Ice::ByteSeq &);
static void LZMA_ASSERT(int ret_xz);
- void DecompressAndSendPackets(const Ice::ByteSeq &, const RawDataClientPrx &) const;
- void SendLoop(const RawDataClientPrx & t, const Ice::ByteSeq & dataxz) const;
+ std::list<Ice::ByteSeq> DecompressAndRead(const Ice::ByteSeq &) const;
- static int eventSet;
- std::map<int, boost::thread *> senders;
- static int senderId;
Ice::CommunicatorPtr ic;
+ // The open fh -> list of DVB packets
+ mutable std::map<int, std::list<Ice::ByteSeq>> selectedPackets;
+ static int eventSet;
static IceTray::Logging::LoggerPtr logger;
};
}