| Index: chrome/browser/media/router/mojo/media_remoter.mojom
|
| diff --git a/chrome/browser/media/router/mojo/media_remoter.mojom b/chrome/browser/media/router/mojo/media_remoter.mojom
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..328b302ef36e44255f47ce95575a0022c74fed12
|
| --- /dev/null
|
| +++ b/chrome/browser/media/router/mojo/media_remoter.mojom
|
| @@ -0,0 +1,78 @@
|
| +// 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.
|
| +
|
| +module media_router.interfaces;
|
| +
|
| +import "media/mojo/interfaces/remoter.mojom";
|
| +
|
| +// Interface for a specific media remoting session. A provider uses this to
|
| +// notify the media remoting service when remote media services are available,
|
| +// to associate a transport for the bitstream data, and to pass messages from
|
| +// the remote media services to the local media stack.
|
| +interface MediaRemotingSession {
|
| + // Notify that remote media services are now available at the sink, along with
|
| + // some information about their capabilities.
|
| + OnRemoteServicesAvailable(media.mojom.RemoteCapabilities capabilities);
|
| +
|
| + // Notify that remote media services are no longer available at the sink.
|
| + OnRemoteServicesGone();
|
| +
|
| + // Notify that a transport for streaming data to the sink is now
|
| + // available. |transport_session_id| is provided by an external transport
|
| + // implementation (e.g., Cast Streaming), allowing the local media stack to
|
| + // pass bitstream data directly to the transport implementation.
|
| + OnBitstreamTransportAvailable(string transport_session_id);
|
| +
|
| + // Notify that the bitstream transport is no longer available.
|
| + OnBitstreamTransportGone();
|
| +
|
| + // Called by the provider whenever the remote media services have sent back a
|
| + // |message| over an encrypted, reliable transport. This message will be
|
| + // forwarded to the local proxy (and, from there, eventually to the media
|
| + // stack in the source renderer).
|
| + OnMessageFromRemote(array<uint8> message);
|
| +
|
| + // Terminate this remoting session, safely tearing-down the session regardles
|
| + // of its current state. If the optional |error_reason| is missing, this is a
|
| + // normal shut-down command; otherwise, |error_reason| contains a
|
| + // human-readable string indicating the failure(s) that forced the session to
|
| + // be stopped.
|
| + Terminate(string? error_reason);
|
| +};
|
| +
|
| +// Interface for a specific media remoting provider instance. The provider acts
|
| +// as a "device driver" to allow the browser's remoting service to: execute the
|
| +// start/stop of a remote media services session, set up messaging and bitstream
|
| +// transport channels, and forward control/status messages.
|
| +interface MediaRemotingProvider {
|
| + // Called to start remote media services. Following this, multiple calls to
|
| + // SendMessageToRemote() will be made, and the provider is expected to forward
|
| + // any messages it gets from the remote by calling the session's
|
| + // OnMessageFromRemote().
|
| + StartMediaServices();
|
| +
|
| + // Called to stop remote media services. The provider should not forward
|
| + // messages (in either direction) after this point. If the optional
|
| + // |error_reason| is missing, this is a normal stop command; otherwise,
|
| + // |error_reason| contains a human-readable string indicating the failure(s)
|
| + // that forced remoting to be stopped.
|
| + //
|
| + // This is not the same as OnSessionTerminated() below. It is possible
|
| + // remoting will start again, within this same session, with a future call to
|
| + // StartMediaServices().
|
| + StopMediaServices(string? error_reason);
|
| +
|
| + // Called by the local media services proxy implementation to have the
|
| + // provider forward |message| to the remote device (over an encrypted,
|
| + // reliable transport).
|
| + SendMessageToRemote(array<uint8> message);
|
| +
|
| + // Called when the media remoting session is terminated. This may or may not
|
| + // be in response to a MediaRemotingSession::Terminate() call, as external
|
| + // entities may have been the cause. If the optional |error_reason| is
|
| + // missing, the session has ended normally; otherwise, |error_reason| contains
|
| + // a human-readable string indicating the failure(s) that forced the session
|
| + // to terminate.
|
| + OnSessionTerminated(string? error_reason);
|
| +};
|
|
|