#include "components/cast_streaming/renderer/control/playback_command_forwarding_renderer.h"
#include "base/memory/raw_ptr.h"
#include "base/notreached.h"
#include "base/task/bind_post_task.h"
#include "base/task/sequenced_task_runner.h"
namespace cast_streaming {
namespace {
constexpr base::TimeDelta kTimeUpdateInterval = …;
}
class RendererCommandForwarder : public media::mojom::Renderer { … };
PlaybackCommandForwardingRenderer::PlaybackCommandForwardingRenderer(
std::unique_ptr<media::Renderer> renderer,
scoped_refptr<base::SequencedTaskRunner> task_runner,
mojo::PendingReceiver<media::mojom::Renderer> pending_renderer_controls)
: … { … }
PlaybackCommandForwardingRenderer::~PlaybackCommandForwardingRenderer() =
default;
void PlaybackCommandForwardingRenderer::Initialize(
media::MediaResource* media_resource,
media::RendererClient* client,
media::PipelineStatusCallback init_cb) { … }
void PlaybackCommandForwardingRenderer::SetCdm(media::CdmContext* cdm_context,
CdmAttachedCB cdm_attached_cb) { … }
void PlaybackCommandForwardingRenderer::SetLatencyHint(
std::optional<base::TimeDelta> latency_hint) { … }
void PlaybackCommandForwardingRenderer::Flush(base::OnceClosure flush_cb) { … }
void PlaybackCommandForwardingRenderer::StartPlayingFrom(base::TimeDelta time) { … }
void PlaybackCommandForwardingRenderer::SetPlaybackRate(double playback_rate) { … }
void PlaybackCommandForwardingRenderer::SetVolume(float volume) { … }
base::TimeDelta PlaybackCommandForwardingRenderer::GetMediaTime() { … }
media::RendererType PlaybackCommandForwardingRenderer::GetRendererType() { … }
void PlaybackCommandForwardingRenderer::OnRealRendererInitializationComplete(
media::PipelineStatus status) { … }
void PlaybackCommandForwardingRenderer::MojoRendererInitialize(
::mojo::PendingAssociatedRemote<media::mojom::RendererClient> client,
std::optional<
std::vector<::mojo::PendingRemote<::media::mojom::DemuxerStream>>>
streams,
media::mojom::MediaUrlParamsPtr media_url_params,
media::mojom::Renderer::InitializeCallback callback) { … }
void PlaybackCommandForwardingRenderer::MojoRendererFlush(
media::mojom::Renderer::FlushCallback callback) { … }
void PlaybackCommandForwardingRenderer::MojoRendererStartPlayingFrom(
::base::TimeDelta time) { … }
void PlaybackCommandForwardingRenderer::MojoRendererSetPlaybackRate(
double playback_rate) { … }
void PlaybackCommandForwardingRenderer::MojoRendererSetVolume(float volume) { … }
void PlaybackCommandForwardingRenderer::MojoRendererSetCdm(
const std::optional<::base::UnguessableToken>& cdm_id,
media::mojom::Renderer::SetCdmCallback callback) { … }
void PlaybackCommandForwardingRenderer::OnError(media::PipelineStatus status) { … }
void PlaybackCommandForwardingRenderer::OnFallback(
media::PipelineStatus status) { … }
void PlaybackCommandForwardingRenderer::OnEnded() { … }
void PlaybackCommandForwardingRenderer::OnStatisticsUpdate(
const media::PipelineStatistics& stats) { … }
void PlaybackCommandForwardingRenderer::OnBufferingStateChange(
media::BufferingState state,
media::BufferingStateChangeReason reason) { … }
void PlaybackCommandForwardingRenderer::OnWaiting(media::WaitingReason reason) { … }
void PlaybackCommandForwardingRenderer::OnAudioConfigChange(
const media::AudioDecoderConfig& config) { … }
void PlaybackCommandForwardingRenderer::OnVideoConfigChange(
const media::VideoDecoderConfig& config) { … }
void PlaybackCommandForwardingRenderer::OnVideoNaturalSizeChange(
const gfx::Size& size) { … }
void PlaybackCommandForwardingRenderer::OnVideoOpacityChange(bool opaque) { … }
void PlaybackCommandForwardingRenderer::OnVideoFrameRateChange(
std::optional<int> fps) { … }
void PlaybackCommandForwardingRenderer::SendTimestampUpdate() { … }
void PlaybackCommandForwardingRenderer::InitializeSendTimestampUpdateCaller() { … }
void PlaybackCommandForwardingRenderer::OnMojoDisconnect() { … }
}