chromium/components/cast_streaming/renderer/control/playback_command_forwarding_renderer.cc

// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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 =;

}  // namespace

// Class responsible for receiving Renderer commands from a remote source and
// forwarding them to |owning_renderer| unchanged. This class exists only to
// avoid intersection of media::Renderer and media::mojom::Renderer methods in
// PlaybackCommandForwardingRenderer.
//
// NOTE: This class CANNOT be declared in an unnamed namespace or the friend
// declaration in PlaybackCommandForwardingRenderer will no longer function.
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) {}

// NOTE: The mojo pipe CANNOT be bound to task runner |task_runner_| - this will
// result in runtime errors on the release branch due to an outdated mojo
// implementation. Calls must instead be bounced to the correct task runner in
// each receiver method.
// TODO(b/205307190): Bind the mojo pipe to the task runner directly.
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() {}

}  // namespace cast_streaming