Chromium Code Reviews| Index: media/mojo/interfaces/decryptor.mojom |
| diff --git a/media/mojo/interfaces/decryptor.mojom b/media/mojo/interfaces/decryptor.mojom |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..be0fe18dfed39b698f42c252d2bcaa2ec70e94a4 |
| --- /dev/null |
| +++ b/media/mojo/interfaces/decryptor.mojom |
| @@ -0,0 +1,46 @@ |
| +// Copyright 2014 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 mojo; |
| + |
| +import "media/mojo/interfaces/demuxer_stream.mojom"; |
| +import "media/mojo/interfaces/media_types.mojom"; |
| + |
| +// TODO(xhwang): Add mojo types for AudioBuffer and VideoFrame. |
| +struct AudioBuffer {}; |
| +struct VideoFrame {}; |
| + |
| +[Client=DecryptorClient] |
| +interface Decryptor { |
|
xhwang
2014/12/02 22:22:45
This is not implemented yet. I'll do that in later
|
| + enum Status { |
| + SUCCESS, // Decryption successfully completed. Decrypted buffer ready. |
| + NO_KEY, // No key is available to decrypt. |
| + NEED_MORE_DATA, // Decoder needs more data to produce an output. |
| + ERROR // Key is available but an error occurred during decryption. |
| + }; |
| + |
| + // TODO(xhwang): Add comments! |
| + Decrypt(DemuxerStream.Type stream_type, MediaDecoderBuffer encrypted) |
| + => (Status status, MediaDecoderBuffer? buffer); |
| + |
| + CancelDecrypt(DemuxerStream.Type stream_type); |
| + |
| + InitializeAudioDecoder(AudioDecoderConfig config) => (bool success); |
| + |
| + InitializeVideoDecoder(VideoDecoderConfig config) => (bool success); |
| + |
| + DecryptAndDecodeAudio(MediaDecoderBuffer encrypted) |
| + => (Status status, array<AudioBuffer>? audio_buffers); |
| + |
| + DecryptAndDecodeVideo( |
| + MediaDecoderBuffer encrypted) => (Status status, VideoFrame? video_frame); |
| + |
| + ResetDecoder(DemuxerStream.Type stream_type); |
| + |
| + DeinitializeDecoder(DemuxerStream.Type stream_type); |
| +}; |
| + |
| +interface DecryptorClient { |
| + OnNewUsableKey(); |
| +}; |