Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 // Start a remoting session. Either MirrorServiceRemotingSource.OnStarted() or | |
|
imcheng
2017/06/22 01:13:27
Please use third person verbs when describing the
xjz
2017/06/23 19:02:42
Done.
| |
| 13 // OnStartFailed() will be called to indicate success or failure. Once | |
| 14 // OnStarted() has been invoked, the source may then make calls to | |
| 15 // SendMessageToSink() and expect messages from the remote via | |
| 16 // MirrorServiceRemotingSource.OnMessageFromSink(). | |
| 17 Start(); | |
| 18 | |
| 19 // Start remoting the media data streams. This is called after Start() to | |
| 20 // indicate audio/video bitstream data is ready to be consumed. | |
| 21 StartDataStreams(bool has_audio, bool has_video); | |
| 22 | |
| 23 // Stop remoting media. Messages in both directions will be dropped after this | |
| 24 // point as well as any pending or in-transit media bitstream data. | |
| 25 Stop(media.mojom.RemotingStopReason reason); | |
| 26 | |
| 27 // Send |message| to the sink. |message| is a serialized protobuf from | |
| 28 // src/media/remoting/proto. | |
| 29 SendMessageToSink(array<uint8> message); | |
| 30 }; | |
| 31 | |
| 32 // Interface used for sending notifications back to the source's control logic, | |
| 33 // and to pass messages from the sink back to the source. | |
| 34 interface MirrorServiceRemotingSource { | |
| 35 // Notify the source that the sink is now available to start remoting. It is | |
| 36 // up to the source's control logic to decide whether/when to start remoting. | |
| 37 OnSinkAvailable(media.mojom.RemotingSinkCapabilities capabilities); | |
| 38 | |
| 39 // One of these is called after the source attempts to start remoting. If | |
| 40 // OnStarted() is called, messages may begin flowing; and this will continue | |
| 41 // until OnStopped() is called. On the other hand, if OnStartFailed() is | |
| 42 // called, then no messages are being passed between source and sink and | |
| 43 // remoting is not taking place. | |
| 44 OnStarted(); | |
| 45 OnStartFailed(media.mojom.RemotingStartFailReason reason); | |
| 46 | |
| 47 // Called after the remoting data streams are created. Setting the | |
| 48 // |audio/video_stream_id| to -1 indicates there is no audio/video stream. | |
| 49 OnDataStreamsStarted(int32 audio_stream_id, int32 video_stream_id); | |
| 50 | |
| 51 // Pass a |message| from the sink back to the source. The |message| consists | |
| 52 // of a serialized protobuf from src/media/remoting/proto. This will only be | |
| 53 // called after OnStarted() and before OnStopped(). | |
| 54 OnMessageFromSink(array<uint8> message); | |
| 55 | |
| 56 // Notify the source that remoting has terminated. This may or may not be in | |
| 57 // response to a Remoter.Stop() call, as other events (possibly external) may | |
| 58 // have caused remoting to end. | |
| 59 OnStopped(media.mojom.RemotingStopReason reason); | |
| 60 | |
| 61 // Notify the source that error occurs while streaming. | |
| 62 OnError(); | |
| 63 }; | |
| OLD | NEW |