Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 module media.interfaces; | 5 module media.interfaces; |
| 6 | 6 |
| 7 import "media/mojo/interfaces/demuxer_stream.mojom"; | 7 import "media/mojo/interfaces/demuxer_stream.mojom"; |
| 8 import "media/mojo/interfaces/media_types.mojom"; | 8 import "media/mojo/interfaces/media_types.mojom"; |
| 9 | 9 |
| 10 // Interface for decrypting (and decoding) encrypted streams. | 10 // Interface for decrypting (and decoding) encrypted streams. |
| 11 // See media/base/decryptor.h for details. | 11 // See media/base/decryptor.h for details. |
| 12 interface Decryptor { | 12 interface Decryptor { |
| 13 // Status of a decrypt or decrypt-and-decode operation. The returned | 13 // Status of a decrypt or decrypt-and-decode operation. The returned |
| 14 // buffer/frame of such an operation is NOT null iff the status is SUCCESS. | 14 // buffer/frame of such an operation is NOT null iff the status is SUCCESS. |
| 15 enum Status { | 15 enum Status { |
| 16 SUCCESS, // Successfully completed. Decrypted buffer ready. | 16 SUCCESS, // Successfully completed. Decrypted buffer ready. |
| 17 NO_KEY, // No key is available to decrypt. | 17 NO_KEY, // No key is available to decrypt. |
| 18 NEED_MORE_DATA, // Decoder needs more data to produce an output. | 18 NEED_MORE_DATA, // Decoder needs more data to produce an output. |
| 19 ERROR // Key is available but an error occurred during decryption. | 19 ERROR // Key is available but an error occurred during decryption. |
| 20 }; | 20 }; |
| 21 | 21 |
| 22 // Pass the two data pipes used to transfer DecoderBuffer contents to and | |
| 23 // from the Decryptor. | |
|
xhwang
2015/12/19 18:16:30
Must be called before all other methods?
jrummell
2015/12/21 23:20:54
Done.
| |
| 24 Initialize(handle<data_pipe_consumer> receive_pipe, | |
| 25 handle<data_pipe_producer> transmit_pipe); | |
|
xhwang
2015/12/19 18:16:30
Since this is an interface, provide more details a
jrummell
2015/12/21 23:20:54
Done.
| |
| 26 | |
| 22 // Decrypts the |encrypted| buffer and returns the decrypt |status| and | 27 // Decrypts the |encrypted| buffer and returns the decrypt |status| and |
| 23 // decrypted |buffer|. | 28 // decrypted |buffer|. |
| 24 // At most one decrypt call is allowed at any time for a |stream_type|. | 29 // At most one decrypt call is allowed at any time for a |stream_type|. |
| 25 Decrypt(DemuxerStream.Type stream_type, DecoderBuffer encrypted) | 30 Decrypt(DemuxerStream.Type stream_type, DecoderBuffer encrypted) |
| 26 => (Status status, DecoderBuffer? buffer); | 31 => (Status status, DecoderBuffer? buffer); |
| 27 | 32 |
| 28 // Cancels any pending decrypt for |stream_type| with SUCCESS. | 33 // Cancels any pending decrypt for |stream_type| with SUCCESS. |
| 29 CancelDecrypt(DemuxerStream.Type stream_type); | 34 CancelDecrypt(DemuxerStream.Type stream_type); |
| 30 | 35 |
| 31 // Initializes a decoder with the given |config|. Returns whether the | 36 // Initializes a decoder with the given |config|. Returns whether the |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 54 | 59 |
| 55 // Releases decoder resources, deinitializes the decoder, aborts any pending | 60 // Releases decoder resources, deinitializes the decoder, aborts any pending |
| 56 // initialization (with false) or decrypt-and-decode (with ERROR) for | 61 // initialization (with false) or decrypt-and-decode (with ERROR) for |
| 57 // |stream_type| immediately. | 62 // |stream_type| immediately. |
| 58 // This method can be called any time after Initialize{Audio|Video}Decoder() | 63 // This method can be called any time after Initialize{Audio|Video}Decoder() |
| 59 // has been called (with the correct stream type). | 64 // has been called (with the correct stream type). |
| 60 // After this operation, the decoder is set to an uninitialized state. | 65 // After this operation, the decoder is set to an uninitialized state. |
| 61 // The decoder can be reinitialized after it is deinitialized. | 66 // The decoder can be reinitialized after it is deinitialized. |
| 62 DeinitializeDecoder(DemuxerStream.Type stream_type); | 67 DeinitializeDecoder(DemuxerStream.Type stream_type); |
| 63 }; | 68 }; |
| OLD | NEW |