Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Side by Side Diff: media/remoting/remoting_sink_observer.h

Issue 2643253003: Media Remoting Clean-up: Less-redundant naming, style consistency, etc. (Closed)
Patch Set: REBASE Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/remoting/remoting_renderer_factory.cc ('k') | media/remoting/remoting_sink_observer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef MEDIA_REMOTING_REMOTING_SINK_OBSERVER_H_
6 #define MEDIA_REMOTING_REMOTING_SINK_OBSERVER_H_
7
8 #include "media/mojo/interfaces/remoting.mojom.h"
9 #include "mojo/public/cpp/bindings/binding.h"
10
11 namespace media {
12
13 // This calss is a pure observer of remoting sink availability to indicate
14 // whether a remoting session can be started.
15 class RemotingSinkObserver final : public mojom::RemotingSource {
16 public:
17 RemotingSinkObserver(mojom::RemotingSourceRequest source_request,
18 mojom::RemoterPtr remoter);
19 ~RemotingSinkObserver() override;
20
21 mojom::RemotingSinkCapabilities sink_capabilities() const {
22 return sink_capabilities_;
23 }
24
25 bool is_remote_decryption_available() const {
26 return sink_capabilities_ ==
27 mojom::RemotingSinkCapabilities::CONTENT_DECRYPTION_AND_RENDERING;
28 }
29
30 // RemotingSource implementations.
31 void OnSinkAvailable(mojom::RemotingSinkCapabilities capabilities) override;
32 void OnSinkGone() override;
33 void OnStarted() override {}
34 void OnStartFailed(mojom::RemotingStartFailReason reason) override {}
35 void OnMessageFromSink(const std::vector<uint8_t>& message) override {}
36 void OnStopped(mojom::RemotingStopReason reason) override {}
37
38 private:
39 const mojo::Binding<mojom::RemotingSource> binding_;
40 const mojom::RemoterPtr remoter_;
41
42 // When the sink is available, this describes its capabilities. When not
43 // available, this is always NONE. Updated by OnSinkAvailable/Gone().
44 mojom::RemotingSinkCapabilities sink_capabilities_ =
45 mojom::RemotingSinkCapabilities::NONE;
46
47 DISALLOW_COPY_AND_ASSIGN(RemotingSinkObserver);
48 };
49
50 } // namespace media
51
52 #endif // MEDIA_REMOTING_REMOTING_SINK_OBSERVER_H_
OLDNEW
« no previous file with comments | « media/remoting/remoting_renderer_factory.cc ('k') | media/remoting/remoting_sink_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698