#include "media/remoting/receiver.h"
#include <utility>
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/notreached.h"
#include "base/task/bind_post_task.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/single_thread_task_runner.h"
#include "media/base/decoder_buffer.h"
#include "media/base/renderer.h"
#include "media/cast/openscreen/remoting_message_factories.h"
#include "media/cast/openscreen/remoting_proto_enum_utils.h"
#include "media/cast/openscreen/remoting_proto_utils.h"
#include "media/remoting/receiver_controller.h"
#include "media/remoting/stream_provider.h"
RpcMessenger;
namespace media {
namespace remoting {
namespace {
constexpr base::TimeDelta kTimeUpdateInterval = …;
}
Receiver::Receiver(
int rpc_handle,
int remote_handle,
ReceiverController* receiver_controller,
const scoped_refptr<base::SequencedTaskRunner>& media_task_runner,
std::unique_ptr<Renderer> renderer,
base::OnceCallback<void(int)> acquire_renderer_done_cb)
: … { … }
Receiver::~Receiver() { … }
void Receiver::Initialize(MediaResource* media_resource,
RendererClient* client,
PipelineStatusCallback init_cb) { … }
void Receiver::SetCdm(CdmContext* cdm_context, CdmAttachedCB cdm_attached_cb) { … }
void Receiver::SetLatencyHint(std::optional<base::TimeDelta> latency_hint) { … }
void Receiver::Flush(base::OnceClosure flush_cb) { … }
void Receiver::StartPlayingFrom(base::TimeDelta time) { … }
void Receiver::SetPlaybackRate(double playback_rate) { … }
void Receiver::SetVolume(float volume) { … }
base::TimeDelta Receiver::GetMediaTime() { … }
RendererType Receiver::GetRendererType() { … }
void Receiver::SendRpcMessageOnMainThread(
std::unique_ptr<openscreen::cast::RpcMessage> message) { … }
void Receiver::OnReceivedRpc(
std::unique_ptr<openscreen::cast::RpcMessage> message) { … }
void Receiver::SetRemoteHandle(int remote_handle) { … }
void Receiver::VerifyAcquireRendererDone() { … }
void Receiver::OnRpcInitialize() { … }
void Receiver::ShouldInitializeRenderer() { … }
void Receiver::OnRendererInitialized(PipelineStatus status) { … }
void Receiver::OnRpcSetPlaybackRate(double playback_rate) { … }
void Receiver::OnRpcFlush(uint32_t audio_count, uint32_t video_count) { … }
void Receiver::OnFlushDone() { … }
void Receiver::OnRpcStartPlayingFrom(base::TimeDelta time) { … }
void Receiver::ScheduleMediaTimeUpdates() { … }
void Receiver::OnRpcSetVolume(double volume) { … }
void Receiver::SendMediaTimeUpdate() { … }
void Receiver::OnError(PipelineStatus status) { … }
void Receiver::OnFallback(PipelineStatus status) { … }
void Receiver::OnEnded() { … }
void Receiver::OnStatisticsUpdate(const PipelineStatistics& stats) { … }
void Receiver::OnBufferingStateChange(BufferingState state,
BufferingStateChangeReason reason) { … }
void Receiver::OnWaiting(WaitingReason reason) { … }
void Receiver::OnAudioConfigChange(const AudioDecoderConfig& config) { … }
void Receiver::OnVideoConfigChange(const VideoDecoderConfig& config) { … }
void Receiver::OnVideoNaturalSizeChange(const gfx::Size& size) { … }
void Receiver::OnVideoOpacityChange(bool opaque) { … }
void Receiver::OnVideoFrameRateChange(std::optional<int>) { … }
}
}