| Index: media/mojo/interfaces/remoter.mojom
|
| diff --git a/media/mojo/interfaces/remoter.mojom b/media/mojo/interfaces/remoter.mojom
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..f904049133e05315d0fe8621247a4fa66b087ff3
|
| --- /dev/null
|
| +++ b/media/mojo/interfaces/remoter.mojom
|
| @@ -0,0 +1,116 @@
|
| +// 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.mojom;
|
| +
|
| +import "media/mojo/interfaces/media_types.mojom";
|
| +
|
| +// An HTML5 media element supports a canPlayType() query. This structure
|
| +// represents a "matcher" for a set of possible container+codec pairs.
|
| +struct RemotePlayType {
|
| + // The base type (i.e., no extra parameters).
|
| + string mime_type; // (e.g., 'video/webm')
|
| +
|
| + // List of regular expressions that each match one or more codecs. For
|
| + // example, to represent that both VP8 and VP9 are supported, one entry
|
| + // would be 'vp[89]'.
|
| + array<string> supported_codecs;
|
| + array<string> ambiguously_supported_codecs;
|
| +};
|
| +
|
| +// Inner structure used in the RemoteKeySystem struct.
|
| +struct RemoteContentCapability {
|
| + RemotePlayType play_type;
|
| + string robustness; // Defined by key system scheme.
|
| +};
|
| +
|
| +// A MediaKeySystemConfiguration (see EME W3C spec) supported by the remote
|
| +// media services.
|
| +struct RemoteKeySystem {
|
| + string name; // Reverse URI (e.g., "org.w3.clearkey")
|
| + array<string> init_data_types;
|
| + array<RemoteContentCapability> audio_capabilities;
|
| + array<RemoteContentCapability> video_capabilities;
|
| + enum Requirement { REQUIRED, OPTIONAL, NOT_ALLOWED };
|
| + Requirement distinctive_identifier;
|
| + Requirement persistent_state;
|
| + array<string> session_types;
|
| +};
|
| +
|
| +// Structure describing the capabilities of the remote media services.
|
| +struct RemoteCapabilities {
|
| + // List of RemotePlayTypes evaluated against canPlayType() queries to
|
| + // determine whether the remote supports playback of a specific format/codec
|
| + // of content (when not using an DRM key system).
|
| + array<RemotePlayType> play_types;
|
| +
|
| + // List of supported DRM key system configurations.
|
| + array<RemoteKeySystem> key_systems;
|
| +};
|
| +
|
| +interface Remoter {
|
| + // Register the client that is to be notified when remote media services are
|
| + // available/gone, and for session-level lifecycle events.
|
| + RegisterClient(RemoterClient client);
|
| +
|
| + // Called to start remote media services. If |success| is true in the result,
|
| + // calls to SendMessageToRemote() and SendBufferToRemote() can be made, and
|
| + // any messages from the remote will be forwarded back to the client via
|
| + // RemoterClient.OnMessageFromRemote().
|
| + //
|
| + // |audio_pipe| and |video_pipe| provide handles to the consumer end of a data
|
| + // pipe. These data pipes are used for the transport of the demuxed bitstream
|
| + // data. The Remoter is instructed to read from these pipes and send the
|
| + // bitstream data to the remote whenever SendBufferToRemote() is called.
|
| + StartMediaServices(handle<data_pipe_consumer>? audio_pipe,
|
| + handle<data_pipe_consumer>? video_pipe) =>
|
| + (bool success, uint32 audio_pipe_id, uint32 video_pipe_id);
|
| +
|
| + // Called to stop remote media services. Messages in both directions will be
|
| + // dropped after this point, and the consumer end of the data pipes passed to
|
| + // StartMediaServices() will be closed. 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.
|
| + StopMediaServices(string? error_reason);
|
| +
|
| + // Forward |message| to the remote endpoint over an encrypted, reliable
|
| + // transport. |message| is a serialized protobuf from
|
| + // src/media/remoting/proto/...
|
| + SendMessageToRemote(array<uint8> message);
|
| +
|
| + // Forward |buffer| to the remote endpoint over an encrypted, reliable
|
| + // transport. Before this is called, the client must write |buffer.data_size|
|
| + // bytes into one of the data pipes. |pipe_id| selects which data pipe will be
|
| + // read from (audio or video).
|
| + SendBufferToRemote(uint32 pipe_id, DecoderBuffer buffer);
|
| +};
|
| +
|
| +interface RemoterClient {
|
| + // Called to notify the client that remote media services are now available,
|
| + // along with some information about their capabilities to help the client
|
| + // decide whether/when to begin remoting (with sufficient support). When the
|
| + // client is ready to start remoting media, it calls
|
| + // Remoter.StartMediaServices().
|
| + OnRemoteServicesAvailable(RemoteCapabilities capabilities);
|
| +
|
| + // Called to notify the client the remote media services are no longer
|
| + // available. Note that this is different from OnMediaServicesStopped() in
|
| + // that it does not indicate active remoting of media services has been
|
| + // stopped.
|
| + OnRemoteServicesGone();
|
| +
|
| + // Called while remoting is active to pass a |message| from the remote media
|
| + // services to the local media stack. The |message| is guaranteed to have been
|
| + // received over an encrypted, reliable transport and consists of a serialized
|
| + // protobuf from src/media/remoting/proto/...
|
| + OnMessageFromRemote(array<uint8> message);
|
| +
|
| + // Called when remote media services have terminated. This may or may not be a
|
| + // response to a Remoter::StopMediaServices() call, as external causes may be
|
| + // the reason remoting was ended. If |error_reason| is present, this indicates
|
| + // remoting was ended due to a fatal error and the string provides a
|
| + // human-readable reason message.
|
| + OnMediaServicesStopped(string? error_reason);
|
| +};
|
|
|