#include "cast/streaming/public/receiver_session.h"
#include <algorithm>
#include <chrono>
#include <string>
#include <utility>
#include "cast/common/channel/message_util.h"
#include "cast/common/public/message_port.h"
#include "cast/streaming/message_fields.h"
#include "cast/streaming/public/answer_messages.h"
#include "cast/streaming/public/environment.h"
#include "cast/streaming/public/offer_messages.h"
#include "cast/streaming/public/receiver.h"
#include "cast/streaming/sender_message.h"
#include "util/json/json_helpers.h"
#include "util/osp_logging.h"
#include "util/std_util.h"
namespace openscreen::cast {
namespace {
template <typename Stream, typename Codec>
std::unique_ptr<Stream> SelectStream(
const std::vector<Codec>& preferred_codecs,
ReceiverSession::Client& client,
const std::vector<Stream>& offered_streams) { … }
MediaCapability ToCapability(AudioCodec codec) { … }
MediaCapability ToCapability(VideoCodec codec) { … }
}
ReceiverSession::Client::~Client() = default;
ReceiverSession::ReceiverSession(Client& client,
Environment& environment,
MessagePort& message_port,
ReceiverConstraints constraints)
: … { … }
ReceiverSession::~ReceiverSession() { … }
void ReceiverSession::OnSocketReady() { … }
void ReceiverSession::OnSocketInvalid(const Error& error) { … }
bool ReceiverSession::PendingOffer::IsValid() const { … }
void ReceiverSession::OnOffer(const std::string& sender_id,
SenderMessage message) { … }
void ReceiverSession::OnCapabilitiesRequest(const std::string& sender_id,
SenderMessage message) { … }
void ReceiverSession::OnRpcMessage(const std::string& sender_id,
SenderMessage message) { … }
void ReceiverSession::SendRpcMessage(std::vector<uint8_t> message) { … }
void ReceiverSession::SelectStreams(const Offer& offer,
PendingOffer* properties) { … }
void ReceiverSession::InitializeSession(const PendingOffer& properties) { … }
std::unique_ptr<Receiver> ReceiverSession::ConstructReceiver(
const Stream& stream) { … }
ReceiverSession::ConfiguredReceivers ReceiverSession::SpawnReceivers(
const PendingOffer& properties) { … }
void ReceiverSession::ResetReceivers(Client::ReceiversDestroyingReason reason) { … }
Answer ReceiverSession::ConstructAnswer(const PendingOffer& properties) { … }
ReceiverCapability ReceiverSession::CreateRemotingCapabilityV2() { … }
void ReceiverSession::SendErrorAnswerReply(const std::string& sender_id,
int sequence_number,
const Error& error) { … }
}