chromium/media/remoting/receiver.h

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

#ifndef MEDIA_REMOTING_RECEIVER_H_
#define MEDIA_REMOTING_RECEIVER_H_

#include <memory>

#include "base/functional/callback_forward.h"
#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 "base/task/single_thread_task_runner.h"
#include "base/timer/timer.h"
#include "media/base/buffering_state.h"
#include "media/base/demuxer_stream.h"
#include "media/base/renderer.h"
#include "media/base/renderer_client.h"
#include "media/cast/openscreen/rpc_call_message_handler.h"
#include "third_party/openscreen/src/cast/streaming/remoting.pb.h"
#include "third_party/openscreen/src/cast/streaming/rpc_messenger.h"

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

namespace base {
class SingleThreadTaskRunner;
}  // namespace base

namespace media {
namespace remoting {

class ReceiverController;

// Receiver runs on a remote device, and forwards the information sent from a
// CourierRenderer to |renderer_|, which actually renders the media.
//
// Receiver implements media::Renderer to be able to work with
// WebMediaPlayerImpl. However, most of the APIs of media::Renderer are dummy
// functions, because the media playback of the remoting media is not controlled
// by the local pipeline of WMPI. It should be controlled by the remoting sender
// via RPC calls. When Receiver receives RPC calls, it will call the
// corresponding functions of |renderer_| to control the media playback of
// the remoting media.
class Receiver final : public Renderer,
                       public RendererClient,
                       public media::cast::RpcRendererCallMessageHandler {};

}  // namespace remoting
}  // namespace media

#endif  // MEDIA_REMOTING_RECEIVER_H_