chromium/components/cast_streaming/browser/control/playback_command_dispatcher.h

// 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.

#ifndef COMPONENTS_CAST_STREAMING_BROWSER_CONTROL_PLAYBACK_COMMAND_DISPATCHER_H_
#define COMPONENTS_CAST_STREAMING_BROWSER_CONTROL_PLAYBACK_COMMAND_DISPATCHER_H_

#include <memory>

#include "base/memory/raw_ptr.h"
#include "base/memory/scoped_refptr.h"
#include "base/memory/weak_ptr.h"
#include "base/task/sequenced_task_runner.h"
#include "components/cast_streaming/browser/common/streaming_initialization_info.h"
#include "components/cast_streaming/browser/control/remoting/remoting_session_client.h"
#include "components/cast_streaming/browser/control/remoting/renderer_rpc_call_translator.h"
#include "components/cast_streaming/browser/control/remoting/rpc_demuxer_stream_handler.h"
#include "components/cast_streaming/browser/control/remoting/rpc_initialization_call_handler_base.h"
#include "components/cast_streaming/browser/control/renderer_control_multiplexer.h"
#include "components/cast_streaming/browser/public/receiver_config.h"
#include "components/cast_streaming/common/public/mojom/renderer_controller.mojom.h"
#include "media/base/audio_decoder_config.h"
#include "media/base/video_decoder_config.h"
#include "media/mojo/mojom/renderer.mojom.h"
#include "mojo/public/cpp/bindings/associated_remote.h"
#include "third_party/openscreen/src/cast/streaming/receiver_session.h"
#include "third_party/openscreen/src/cast/streaming/rpc_messenger.h"

namespace openscreen {
namespace cast {
class RpcMessage;
}  // namespace cast
}  // namespace openscreen

namespace cast_streaming {

namespace remoting {
class RendererRpcCallTranslator;
}  // namespace remoting

// This class is responsible for initiating a mojo connection to a
// media::Renderer (expected to be a PlaybackCommandForwardingRenderer) via an
// initial call to |control_configuration| and then setting up any necessary
// infrastructure for messages to be passed across this pipe. While this class
// is used to initiate and maintain control over a Renderer for a Cast Remoting
// session, it is also used for starting playback of a Cast Mirroring session.
class PlaybackCommandDispatcher
    : public remoting::RpcInitializationCallHandlerBase,
      public remoting::RemotingSessionClient,
      public remoting::RpcDemuxerStreamHandler::Client {};

}  // namespace cast_streaming

#endif  // COMPONENTS_CAST_STREAMING_BROWSER_CONTROL_PLAYBACK_COMMAND_DISPATCHER_H_