#include "cast/sender/cast_app_discovery_service_impl.h"
#include <algorithm>
#include <chrono>
#include <utility>
#include "cast/sender/public/cast_media_source.h"
#include "util/osp_logging.h"
namespace openscreen::cast {
namespace {
static constexpr std::chrono::minutes kRefreshThreshold = …;
}
CastAppDiscoveryServiceImpl::CastAppDiscoveryServiceImpl(
CastPlatformClient& platform_client,
ClockNowFunctionPtr clock)
: … { … }
CastAppDiscoveryServiceImpl::~CastAppDiscoveryServiceImpl() { … }
CastAppDiscoveryService::Subscription
CastAppDiscoveryServiceImpl::StartObservingAvailability(
const CastMediaSource& source,
AvailabilityCallback callback) { … }
void CastAppDiscoveryServiceImpl::Refresh() { … }
void CastAppDiscoveryServiceImpl::AddOrUpdateReceiver(
const ReceiverInfo& receiver) { … }
void CastAppDiscoveryServiceImpl::RemoveReceiver(const ReceiverInfo& receiver) { … }
void CastAppDiscoveryServiceImpl::RequestAppAvailability(
const std::string& receiver_id,
const std::string& app_id) { … }
void CastAppDiscoveryServiceImpl::UpdateAppAvailability(
const std::string& receiver_id,
const std::string& app_id,
AppAvailabilityResult availability) { … }
void CastAppDiscoveryServiceImpl::UpdateAvailabilityQueries(
const std::vector<CastMediaSource>& sources) { … }
std::vector<ReceiverInfo> CastAppDiscoveryServiceImpl::GetReceiversByIds(
const std::vector<std::string>& receiver_ids) const { … }
bool CastAppDiscoveryServiceImpl::ShouldRefreshAppAvailability(
const std::string& receiver_id,
const std::string& app_id,
Clock::time_point now) const { … }
void CastAppDiscoveryServiceImpl::RemoveAvailabilityCallback(uint32_t id) { … }
}