diff options
Diffstat (limited to 'p2pvr/devices/devices.cpp')
-rw-r--r-- | p2pvr/devices/devices.cpp | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/p2pvr/devices/devices.cpp b/p2pvr/devices/devices.cpp index a9fb214..4e7bb09 100644 --- a/p2pvr/devices/devices.cpp +++ b/p2pvr/devices/devices.cpp @@ -4,6 +4,8 @@ #include "bindTimerTask.h" #include <lockHelpers.h> +using namespace IceTray::Logging; + namespace P2PVR { template<typename T> T * @@ -36,12 +38,12 @@ IceTray::Logging::LoggerPtr DevicesI::logger(LOGMANAGER()->getLogger<DevicesI>() DevicesI::DevicesI() { devices = options->devices; - logger->message(LOG::DEBUG, __PRETTY_FUNCTION__); + logger->message(LogLevel::DEBUG, __PRETTY_FUNCTION__); } DevicesI::~DevicesI() { - logger->message(LOG::DEBUG, __PRETTY_FUNCTION__); + logger->message(LogLevel::DEBUG, __PRETTY_FUNCTION__); } TunerPtr @@ -57,7 +59,7 @@ DevicesI::getTuner() return tuner; } catch (const std::exception & ex) { - logger->messagebf(LOG::DEBUG, "%s: Failed to open device %s (%s)", __PRETTY_FUNCTION__, + logger->messagebf(LogLevel::DEBUG, "%s: Failed to open device %s (%s)", __PRETTY_FUNCTION__, *devItr, ex.what()); } } @@ -67,7 +69,7 @@ DevicesI::getTuner() TunerPtr DevicesI::getTuner(const DVBSI::DeliveryPtr & delivery) { - logger->messagebf(LOG::DEBUG, "%s: Searching for an open sharable tuner (frequency %d)", __PRETTY_FUNCTION__, delivery->Frequency); + logger->messagebf(LogLevel::DEBUG, "%s: Searching for an open sharable tuner (frequency %d)", __PRETTY_FUNCTION__, delivery->Frequency); Lock(lock); // Check for an already open tuner which is correctly tuned. auto existingItr = openDevices.find(delivery->TransportStreamId); @@ -88,11 +90,11 @@ DevicesI::getTuner(const DVBSI::DeliveryPtr & delivery) return tuner; } catch (const std::exception & ex) { - logger->messagebf(LOG::DEBUG, "%s: Failed to open and tune device %s (%s) to frequency %d", __PRETTY_FUNCTION__, + logger->messagebf(LogLevel::DEBUG, "%s: Failed to open and tune device %s (%s) to frequency %d", __PRETTY_FUNCTION__, *devItr, ex.what(), delivery->Frequency); } } - logger->messagebf(LOG::DEBUG, "%s: Failed to open and tune any device to frequency %d", __PRETTY_FUNCTION__, + logger->messagebf(LogLevel::DEBUG, "%s: Failed to open and tune any device to frequency %d", __PRETTY_FUNCTION__, delivery->Frequency); throw NoSuitableDeviceAvailable(); } @@ -114,14 +116,14 @@ DevicesI::getTuner(const DeliveryProvider & provider) TunerPtr DevicesI::openTuner(const boost::filesystem::path & path) const { - return new DVB::TunerI(path); + return std::make_shared<DVB::TunerI>(path); } void DevicesI::releaseTuner(const TunerPtr & tuner) { Lock(lock); - logger->messagebf(LOG::DEBUG, "%s", __PRETTY_FUNCTION__); + logger->messagebf(LogLevel::DEBUG, "%s", __PRETTY_FUNCTION__); auto openTuner = std::find_if(openDevices.begin(), openDevices.end(), [&tuner](const auto & ot) { return ot.second->tuner == tuner; }); @@ -138,20 +140,20 @@ DevicesI::releaseTuner(const TunerPtr & tuner) } void -DevicesI::Scan(const std::string &, const Ice::Current &) +DevicesI::Scan(const std::string, const Ice::Current &) { Lock(lock); } void -DevicesI::Add(const std::string & frontend, const Ice::Current &) +DevicesI::Add(const std::string frontend, const Ice::Current &) { Lock(lock); devices.push_back(frontend); } void -DevicesI::Remove(const std::string & frontend, const Ice::Current &) +DevicesI::Remove(const std::string frontend, const Ice::Current &) { Lock(lock); devices.erase(std::remove(devices.begin(), devices.end(), frontend), devices.end()); @@ -185,49 +187,49 @@ DevicesI::finiteTunerOperation(TunerPtr && tuner, const Target & target) } void -DevicesI::ScanAndSendNetworkInformation(const RawDataClientPrx & target, const ::Ice::Current&) +DevicesI::ScanAndSendNetworkInformation(const RawDataClientPrxPtr target, const ::Ice::Current&) { finiteTunerOperation(getTuner(), boost::bind(&Tuner::ScanAndSendNetworkInformation, _1, target)); } void -DevicesI::SendNetworkInformation(const ::DVBSI::DeliveryPtr & del, const RawDataClientPrx & target, const ::Ice::Current&) +DevicesI::SendNetworkInformation(const ::DVBSI::DeliveryPtr del, const RawDataClientPrxPtr target, const ::Ice::Current&) { finiteTunerOperation(getTuner(del), boost::bind(&Tuner::SendNetworkInformation, _1, target)); } void -DevicesI::SendBouquetAssociations(const ::DVBSI::DeliveryPtr & del, const RawDataClientPrx & target, const ::Ice::Current &) +DevicesI::SendBouquetAssociations(const ::DVBSI::DeliveryPtr del, const RawDataClientPrxPtr target, const ::Ice::Current &) { finiteTunerOperation(getTuner(del), boost::bind(&Tuner::SendBouquetAssociations, _1, target)); } void -DevicesI::SendServiceDescriptions(const ::DVBSI::DeliveryPtr & del, const RawDataClientPrx & target, const ::Ice::Current&) +DevicesI::SendServiceDescriptions(const ::DVBSI::DeliveryPtr del, const RawDataClientPrxPtr target, const ::Ice::Current&) { finiteTunerOperation(getTuner(del), boost::bind(&Tuner::SendServiceDescriptions, _1, target)); } void -DevicesI::SendProgramAssociationTable(const ::DVBSI::DeliveryPtr & del, const RawDataClientPrx & target, const ::Ice::Current&) +DevicesI::SendProgramAssociationTable(const ::DVBSI::DeliveryPtr del, const RawDataClientPrxPtr target, const ::Ice::Current&) { finiteTunerOperation(getTuner(del), boost::bind(&Tuner::SendProgramAssociationTable, _1, target)); } void -DevicesI::SendProgramMap(const ::DVBSI::DeliveryPtr & del, ::Ice::Int pids, const RawDataClientPrx & target, const ::Ice::Current&) +DevicesI::SendProgramMap(const ::DVBSI::DeliveryPtr del, ::Ice::Int pids, const RawDataClientPrxPtr target, const ::Ice::Current&) { finiteTunerOperation(getTuner(del), boost::bind(&Tuner::SendProgramMap, _1, pids, target)); } void -DevicesI::SendEventInformation(const ::DVBSI::DeliveryPtr & del, const RawDataClientPrx & target, const ::Ice::Current&) +DevicesI::SendEventInformation(const ::DVBSI::DeliveryPtr del, const RawDataClientPrxPtr target, const ::Ice::Current&) { finiteTunerOperation(getTuner(del), boost::bind(&Tuner::SendEventInformation, _1, target)); } ::Ice::Int -DevicesI::StartSendingTS(const ::DVBSI::DeliveryPtr & del, const PacketIds & pids, const RawDataClientPrx & target, const ::Ice::Current&) +DevicesI::StartSendingTS(const ::DVBSI::DeliveryPtr del, const PacketIds pids, const RawDataClientPrxPtr target, const ::Ice::Current&) { auto tuner = getTuner(del); try { @@ -240,7 +242,7 @@ DevicesI::StartSendingTS(const ::DVBSI::DeliveryPtr & del, const PacketIds & pid } ::Ice::Int -DevicesI::StartSendingSection(const ::DVBSI::DeliveryPtr & del, ::Ice::Int sid, const RawDataClientPrx & target, const ::Ice::Current&) +DevicesI::StartSendingSection(const ::DVBSI::DeliveryPtr del, ::Ice::Int sid, const RawDataClientPrxPtr target, const ::Ice::Current&) { auto tuner = getTuner(del); try { |