| OLD | NEW |
| (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 module media_router.interfaces; |
| 6 |
| 7 import "media/mojo/interfaces/remoter.mojom"; |
| 8 |
| 9 // Interface for a specific media remoting session. A provider uses this to |
| 10 // notify the media remoting service when remote media services are available, |
| 11 // to associate a transport for the bitstream data, and to pass messages from |
| 12 // the remote media services to the local media stack. |
| 13 interface MediaRemotingSession { |
| 14 // Notify that remote media services are now available at the sink, along with |
| 15 // some information about their capabilities. |
| 16 OnRemoteServicesAvailable(media.mojom.RemoteCapabilities capabilities); |
| 17 |
| 18 // Notify that remote media services are no longer available at the sink. |
| 19 OnRemoteServicesGone(); |
| 20 |
| 21 // Notify that a transport for streaming data to the sink is now |
| 22 // available. |transport_session_id| is provided by an external transport |
| 23 // implementation (e.g., Cast Streaming), allowing the local media stack to |
| 24 // pass bitstream data directly to the transport implementation. |
| 25 OnBitstreamTransportAvailable(string transport_session_id); |
| 26 |
| 27 // Notify that the bitstream transport is no longer available. |
| 28 OnBitstreamTransportGone(); |
| 29 |
| 30 // Called by the provider whenever the remote media services have sent back a |
| 31 // |message| over an encrypted, reliable transport. This message will be |
| 32 // forwarded to the local proxy (and, from there, eventually to the media |
| 33 // stack in the source renderer). |
| 34 OnMessageFromRemote(array<uint8> message); |
| 35 |
| 36 // Terminate this remoting session, safely tearing-down the session regardles |
| 37 // of its current state. If the optional |error_reason| is missing, this is a |
| 38 // normal shut-down command; otherwise, |error_reason| contains a |
| 39 // human-readable string indicating the failure(s) that forced the session to |
| 40 // be stopped. |
| 41 Terminate(string? error_reason); |
| 42 }; |
| 43 |
| 44 // Interface for a specific media remoting provider instance. The provider acts |
| 45 // as a "device driver" to allow the browser's remoting service to: execute the |
| 46 // start/stop of a remote media services session, set up messaging and bitstream |
| 47 // transport channels, and forward control/status messages. |
| 48 interface MediaRemotingProvider { |
| 49 // Called to start remote media services. Following this, multiple calls to |
| 50 // SendMessageToRemote() will be made, and the provider is expected to forward |
| 51 // any messages it gets from the remote by calling the session's |
| 52 // OnMessageFromRemote(). |
| 53 StartMediaServices(); |
| 54 |
| 55 // Called to stop remote media services. The provider should not forward |
| 56 // messages (in either direction) after this point. If the optional |
| 57 // |error_reason| is missing, this is a normal stop command; otherwise, |
| 58 // |error_reason| contains a human-readable string indicating the failure(s) |
| 59 // that forced remoting to be stopped. |
| 60 // |
| 61 // This is not the same as OnSessionTerminated() below. It is possible |
| 62 // remoting will start again, within this same session, with a future call to |
| 63 // StartMediaServices(). |
| 64 StopMediaServices(string? error_reason); |
| 65 |
| 66 // Called by the local media services proxy implementation to have the |
| 67 // provider forward |message| to the remote device (over an encrypted, |
| 68 // reliable transport). |
| 69 SendMessageToRemote(array<uint8> message); |
| 70 |
| 71 // Called when the media remoting session is terminated. This may or may not |
| 72 // be in response to a MediaRemotingSession::Terminate() call, as external |
| 73 // entities may have been the cause. If the optional |error_reason| is |
| 74 // missing, the session has ended normally; otherwise, |error_reason| contains |
| 75 // a human-readable string indicating the failure(s) that forced the session |
| 76 // to terminate. |
| 77 OnSessionTerminated(string? error_reason); |
| 78 }; |
| OLD | NEW |