#include "cast/receiver/application_agent.h"
#include <utility>
#include "cast/common/channel/message_util.h"
#include "cast/common/channel/virtual_connection.h"
#include "cast/common/public/cast_socket.h"
#include "platform/base/tls_credentials.h"
#include "platform/base/tls_listen_options.h"
#include "util/json/json_helpers.h"
#include "util/json/json_serialization.h"
#include "util/osp_logging.h"
namespace openscreen::cast {
namespace {
std::string GetFirstAppId(ApplicationAgent::Application* app) { … }
}
ApplicationAgent::ApplicationAgent(
TaskRunner& task_runner,
DeviceAuthNamespaceHandler::CredentialsProvider& credentials_provider)
: … { … }
ApplicationAgent::~ApplicationAgent() { … }
void ApplicationAgent::RegisterApplication(Application* app,
bool auto_launch_for_idle_screen) { … }
void ApplicationAgent::UnregisterApplication(Application* app) { … }
void ApplicationAgent::StopApplicationIfRunning(Application* app) { … }
void ApplicationAgent::OnConnected(ReceiverSocketFactory* factory,
const IPEndpoint& endpoint,
std::unique_ptr<CastSocket> socket) { … }
void ApplicationAgent::OnError(ReceiverSocketFactory* factory,
const Error& error) { … }
void ApplicationAgent::OnMessage(VirtualConnectionRouter* router,
CastSocket* socket,
proto::CastMessage message) { … }
bool ApplicationAgent::IsConnectionAllowed(
const VirtualConnection& virtual_conn) const { … }
void ApplicationAgent::OnClose(CastSocket* socket) { … }
void ApplicationAgent::OnError(CastSocket* socket, const Error& error) { … }
Json::Value ApplicationAgent::HandlePing() { … }
Json::Value ApplicationAgent::HandleGetAppAvailability(
const Json::Value& request) { … }
Json::Value ApplicationAgent::HandleGetStatus(const Json::Value& request) { … }
Json::Value ApplicationAgent::HandleLaunch(const Json::Value& request,
CastSocket* socket) { … }
Json::Value ApplicationAgent::HandleStop(const Json::Value& request) { … }
Json::Value ApplicationAgent::HandleInvalidCommand(const Json::Value& request) { … }
Error ApplicationAgent::SwitchToApplication(std::string app_id,
const Json::Value& app_params,
CastSocket* socket) { … }
void ApplicationAgent::GoIdle() { … }
void ApplicationAgent::PopulateReceiverStatus(Json::Value* out) { … }
void ApplicationAgent::BroadcastReceiverStatus() { … }
ApplicationAgent::Application::~Application() = default;
}