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

Unified Diff: media/mojo/interfaces/mirror_service_remoting.mojom

Issue 2951523002: Media Remoting: Add mojo interfaces between browser and extension. (Closed)
Patch Set: Addressed imcheng's comments. Removed OnStarted/Failed interface. Created 3 years, 6 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: media/mojo/interfaces/mirror_service_remoting.mojom
diff --git a/media/mojo/interfaces/mirror_service_remoting.mojom b/media/mojo/interfaces/mirror_service_remoting.mojom
new file mode 100644
index 0000000000000000000000000000000000000000..6fc955ac92fd4431893960bc3273fa06444ab45e
--- /dev/null
+++ b/media/mojo/interfaces/mirror_service_remoting.mojom
@@ -0,0 +1,54 @@
+// Copyright 2017 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.
+
+module media.mojom;
+
+import "media/mojo/interfaces/remoting_common.mojom";
+
+// Interface used by the source to start/stop remoting and send data to the
+// sink.
+interface MirrorServiceRemoter {
+ // Starts a remoting session. Always assumes the remoting session will be
+ // stared successfully. Once any failure happens,
miu 2017/06/27 00:23:49 nit: s/Once/If/ Let's be optimistic, eh? :-)
xjz 2017/06/28 02:09:39 Done.
+ // MirrorServiceRemotingSource::OnError() will be called.
+ Start();
+
+ // Starts remoting the media data streams. This is called after Start() to
+ // indicate audio/video bitstream data is ready to be consumed.
+ StartDataStreams(bool has_audio, bool has_video);
miu 2017/06/27 00:23:49 Suggestion: This should return values so that the
xjz 2017/06/28 02:09:39 Done.
+
+ // Stops remoting media. Messages in both directions will be dropped after this
miu 2017/06/27 00:23:49 80 chars. (run `git cl format`?)
xjz 2017/06/28 02:09:39 Done.
+ // point as well as any pending or in-transit media bitstream data.
+ Stop(media.mojom.RemotingStopReason reason);
+
+ // Sends|message| to the sink. |message| is a serialized protobuf from
+ // src/media/remoting/proto.
+ SendMessageToSink(array<uint8> message);
+};
+
+// Interface used for sending notifications back to the source's control logic,
+// and to pass messages from the sink back to the source.
+interface MirrorServiceRemotingSource {
+ // Notifies the source that the sink is now available to start remoting. It is
+ // up to the source's control logic to decide whether/when to start remoting.
+ OnSinkAvailable(media.mojom.RemotingSinkCapabilities capabilities);
+
+ // Called after the remoting data streams are created. Setting the
+ // |audio/video_stream_id| to -1 indicates there is no audio/video stream.
+ OnDataStreamsStarted(int32 audio_stream_id, int32 video_stream_id);
miu 2017/06/27 00:23:49 Per the suggestion above, you can remove this.
xjz 2017/06/28 02:09:39 Done.
+
+ // Passes a |message| from the sink back to the source. The |message| consists
+ // of a serialized protobuf from src/media/remoting/proto. This will only be
+ // called after OnStarted() and before OnStopped().
+ OnMessageFromSink(array<uint8> message);
+
+ // Notifies the source that remoting has terminated. This may or may not be in
+ // response to a Remoter.Stop() call, as other events (possibly external) may
+ // have caused remoting to end.
+ OnStopped(media.mojom.RemotingStopReason reason);
+
+ // Notifies the source that fatal error occurs. Remoting session will be
miu 2017/06/27 00:23:49 nit: s/that fatal error occurs/that a fatal error
xjz 2017/06/28 02:09:39 Done.
+ // stopped immediately once this is called.
+ OnError();
+};

Powered by Google App Engine
This is Rietveld 408576698