Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 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 mojo; | |
| 6 | |
| 7 import "media/mojo/interfaces/demuxer_stream.mojom"; | |
| 8 import "media/mojo/interfaces/media_types.mojom"; | |
| 9 | |
| 10 // TODO(xhwang): Add mojo types for AudioBuffer and VideoFrame. | |
| 11 struct AudioBuffer {}; | |
| 12 struct VideoFrame {}; | |
| 13 | |
| 14 [Client=DecryptorClient] | |
| 15 interface Decryptor { | |
|
xhwang
2014/12/02 22:22:45
This is not implemented yet. I'll do that in later
| |
| 16 enum Status { | |
| 17 SUCCESS, // Decryption successfully completed. Decrypted buffer ready. | |
| 18 NO_KEY, // No key is available to decrypt. | |
| 19 NEED_MORE_DATA, // Decoder needs more data to produce an output. | |
| 20 ERROR // Key is available but an error occurred during decryption. | |
| 21 }; | |
| 22 | |
| 23 // TODO(xhwang): Add comments! | |
| 24 Decrypt(DemuxerStream.Type stream_type, MediaDecoderBuffer encrypted) | |
| 25 => (Status status, MediaDecoderBuffer? buffer); | |
| 26 | |
| 27 CancelDecrypt(DemuxerStream.Type stream_type); | |
| 28 | |
| 29 InitializeAudioDecoder(AudioDecoderConfig config) => (bool success); | |
| 30 | |
| 31 InitializeVideoDecoder(VideoDecoderConfig config) => (bool success); | |
| 32 | |
| 33 DecryptAndDecodeAudio(MediaDecoderBuffer encrypted) | |
| 34 => (Status status, array<AudioBuffer>? audio_buffers); | |
| 35 | |
| 36 DecryptAndDecodeVideo( | |
| 37 MediaDecoderBuffer encrypted) => (Status status, VideoFrame? video_frame); | |
| 38 | |
| 39 ResetDecoder(DemuxerStream.Type stream_type); | |
| 40 | |
| 41 DeinitializeDecoder(DemuxerStream.Type stream_type); | |
| 42 }; | |
| 43 | |
| 44 interface DecryptorClient { | |
| 45 OnNewUsableKey(); | |
| 46 }; | |
| OLD | NEW |