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

Side by Side 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, 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 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 module media.mojom;
6
7 import "media/mojo/interfaces/remoting_common.mojom";
8
9 // Interface used by the source to start/stop remoting and send data to the
10 // sink.
11 interface MirrorServiceRemoter {
12 // Starts a remoting session. Always assumes the remoting session will be
13 // 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.
14 // MirrorServiceRemotingSource::OnError() will be called.
15 Start();
16
17 // Starts remoting the media data streams. This is called after Start() to
18 // indicate audio/video bitstream data is ready to be consumed.
19 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.
20
21 // Stops remoting media. Messages in both directions will be dropped after thi s
miu 2017/06/27 00:23:49 80 chars. (run `git cl format`?)
xjz 2017/06/28 02:09:39 Done.
22 // point as well as any pending or in-transit media bitstream data.
23 Stop(media.mojom.RemotingStopReason reason);
24
25 // Sends|message| to the sink. |message| is a serialized protobuf from
26 // src/media/remoting/proto.
27 SendMessageToSink(array<uint8> message);
28 };
29
30 // Interface used for sending notifications back to the source's control logic,
31 // and to pass messages from the sink back to the source.
32 interface MirrorServiceRemotingSource {
33 // Notifies the source that the sink is now available to start remoting. It is
34 // up to the source's control logic to decide whether/when to start remoting.
35 OnSinkAvailable(media.mojom.RemotingSinkCapabilities capabilities);
36
37 // Called after the remoting data streams are created. Setting the
38 // |audio/video_stream_id| to -1 indicates there is no audio/video stream.
39 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.
40
41 // Passes a |message| from the sink back to the source. The |message| consists
42 // of a serialized protobuf from src/media/remoting/proto. This will only be
43 // called after OnStarted() and before OnStopped().
44 OnMessageFromSink(array<uint8> message);
45
46 // Notifies the source that remoting has terminated. This may or may not be in
47 // response to a Remoter.Stop() call, as other events (possibly external) may
48 // have caused remoting to end.
49 OnStopped(media.mojom.RemotingStopReason reason);
50
51 // 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.
52 // stopped immediately once this is called.
53 OnError();
54 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698