#include "components/cast_streaming/browser/receiver_session_impl.h"
#include "base/task/sequenced_task_runner.h"
#include "components/cast_streaming/browser/cast_message_port_converter.h"
#include "components/cast_streaming/browser/public/network_context_getter.h"
#include "components/cast_streaming/browser/public/receiver_config.h"
#include "components/cast_streaming/common/public/features.h"
#include "media/base/audio_decoder_config.h"
#include "media/base/video_decoder_config.h"
#include "third_party/openscreen/src/cast/streaming/receiver_constraints.h"
namespace cast_streaming {
std::unique_ptr<ReceiverSession> ReceiverSession::Create(
ReceiverConfig av_constraints,
ReceiverSession::MessagePortProvider message_port_provider,
ReceiverSession::Client* client) { … }
ReceiverSessionImpl::ReceiverSessionImpl(
ReceiverConfig av_constraints,
ReceiverSession::MessagePortProvider message_port_provider,
ReceiverSession::Client* client)
: … { … }
ReceiverSessionImpl::~ReceiverSessionImpl() = default;
void ReceiverSessionImpl::StartStreamingAsync(
mojo::AssociatedRemote<mojom::DemuxerConnector> demuxer_connector) { … }
void ReceiverSessionImpl::StartStreamingAsync(
mojo::AssociatedRemote<mojom::DemuxerConnector> demuxer_connector,
mojo::AssociatedRemote<mojom::RendererController> renderer_controller) { … }
void ReceiverSessionImpl::StartStreamingAsyncInternal(
mojo::AssociatedRemote<mojom::DemuxerConnector> demuxer_connector) { … }
ReceiverSession::RendererController*
ReceiverSessionImpl::GetRendererControls() { … }
void ReceiverSessionImpl::OnReceiverEnabled() { … }
void ReceiverSessionImpl::OnSessionInitialization(
StreamingInitializationInfo initialization_info,
std::optional<mojo::ScopedDataPipeConsumerHandle> audio_pipe_consumer,
std::optional<mojo::ScopedDataPipeConsumerHandle> video_pipe_consumer) { … }
void ReceiverSessionImpl::OnAudioBufferReceived(
media::mojom::DecoderBufferPtr buffer) { … }
void ReceiverSessionImpl::OnVideoBufferReceived(
media::mojom::DecoderBufferPtr buffer) { … }
void ReceiverSessionImpl::OnSessionReinitializationPending() { … }
void ReceiverSessionImpl::OnSessionReinitialization(
StreamingInitializationInfo initialization_info,
std::optional<mojo::ScopedDataPipeConsumerHandle> audio_pipe_consumer,
std::optional<mojo::ScopedDataPipeConsumerHandle> video_pipe_consumer) { … }
void ReceiverSessionImpl::InformClientOfConfigChange() { … }
void ReceiverSessionImpl::OnSessionEnded() { … }
void ReceiverSessionImpl::PreloadBuffersAndStartPlayback() { … }
void ReceiverSessionImpl::OnMojoDisconnect() { … }
ReceiverSessionImpl::RendererControllerImpl::RendererControllerImpl(
base::OnceCallback<void()> on_mojo_disconnect)
: … { … }
ReceiverSessionImpl::RendererControllerImpl::~RendererControllerImpl() =
default;
bool ReceiverSessionImpl::RendererControllerImpl::IsValid() const { … }
void ReceiverSessionImpl::RendererControllerImpl::SetVolume(float volume) { … }
mojo::PendingReceiver<media::mojom::Renderer>
ReceiverSessionImpl::RendererControllerImpl::Bind() { … }
}