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

Unified Diff: chrome/browser/media/router/media_remoting_provider.h

Issue 2138013003: media::mojom::Remoter and CastRemotingConnector/Sender (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Split-out some interfaces in prep for landing multi-part changes. Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/media/router/media_remoting_provider.h
diff --git a/chrome/browser/media/router/media_remoting_provider.h b/chrome/browser/media/router/media_remoting_provider.h
new file mode 100644
index 0000000000000000000000000000000000000000..2020922bfb967c80e6ca207325c2fd1c6ffd1b55
--- /dev/null
+++ b/chrome/browser/media/router/media_remoting_provider.h
@@ -0,0 +1,55 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_MEDIA_ROUTER_MEDIA_REMOTING_PROVIDER_IMPL_H_
+#define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_REMOTING_PROVIDER_IMPL_H_
+
+#include "base/callback.h"
+#include "media/mojo/interfaces/remoter.mojom.h"
+
+namespace media_router {
+
+// Interface for a provider of remote media services.
+class MediaRemotingProvider {
+ public:
+ // Returns the remote's capabilities if remote services are
+ // available. Otherwise, nullptr.
+ virtual const media::mojom::RemoteCapabilities*
+ GetRemoteCapabilities() const = 0;
+
+ // Requests that remote media services be started, returning true if
+ // successful. |audio_pipe| and |video_pipe| are handles to data pipes for
+ // consuming buffer data whenever SendBufferToRemote() is
+ // called. |message_callback| is run to dispatch messages received from the
+ // remote to the local implementation.
+ using RemoteMessageCallback = base::Callback<void(mojo::Array<uint8_t>)>;
+ virtual bool StartMediaServices(
+ mojo::ScopedDataPipeConsumerHandle audio_pipe,
+ mojo::ScopedDataPipeConsumerHandle video_pipe,
+ const RemoteMessageCallback& message_callback) = 0;
+
+ // Stops media remoting services. The data pipes provided in the call to
+ // StartMediaServices() are closed. If |error_reason| is non-empty, it
+ // contains a human-readable error message.
+ virtual void StopMediaServices(const mojo::String& error_reason) = 0;
+
+ // Sends a |message| or |buffer| to the remote. Messages are passed to the
+ // MediaRemotingProvider for transmission over the third-party messaging
+ // channel, which must be encrypted and reliable. Buffers are passed to the
+ // bitstream transport implementation.
+ virtual void SendMessageToRemote(mojo::Array<uint8_t> message) = 0;
+ virtual void SendBufferToRemote(uint32_t pipe_id,
+ media::mojom::DecoderBufferPtr buffer) = 0;
+
+ protected:
+ MediaRemotingProvider() {}
+ virtual ~MediaRemotingProvider() {}
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(MediaRemotingProvider);
+};
+
+} // namespace media_router
+
+#endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_REMOTING_PROVIDER_IMPL_H_
« no previous file with comments | « chrome/browser/media/router/media_remoting_connector.cc ('k') | chrome/browser/media/router/media_router.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698