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 // Key is available but an error occurred during decryption. |
| 20 DECRYPTION_ERROR |
20 }; | 21 }; |
21 | 22 |
22 // Pass the two data pipes used to transfer DecoderBuffer contents to and | 23 // Pass the two data pipes used to transfer DecoderBuffer contents to and |
23 // from the Decryptor. |receive_pipe| will be used to receive DecoderBuffer | 24 // from the Decryptor. |receive_pipe| will be used to receive DecoderBuffer |
24 // data on Decrypt(), DecryptAndDecodeAudio(), and DecryptAndDecodeVideo() | 25 // data on Decrypt(), DecryptAndDecodeAudio(), and DecryptAndDecodeVideo() |
25 // calls. |transmit_pipe| will be used to pass the DecoderBuffer data | 26 // calls. |transmit_pipe| will be used to pass the DecoderBuffer data |
26 // back with OnDecryptDone() calls. This method must be called before any | 27 // back with OnDecryptDone() calls. This method must be called before any |
27 // methods listed are called. | 28 // methods listed are called. |
28 Initialize(handle<data_pipe_consumer> receive_pipe, | 29 Initialize(handle<data_pipe_consumer> receive_pipe, |
29 handle<data_pipe_producer> transmit_pipe); | 30 handle<data_pipe_producer> transmit_pipe); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 | 64 |
64 // Releases decoder resources, deinitializes the decoder, aborts any pending | 65 // Releases decoder resources, deinitializes the decoder, aborts any pending |
65 // initialization (with false) or decrypt-and-decode (with ERROR) for | 66 // initialization (with false) or decrypt-and-decode (with ERROR) for |
66 // |stream_type| immediately. | 67 // |stream_type| immediately. |
67 // This method can be called any time after Initialize{Audio|Video}Decoder() | 68 // This method can be called any time after Initialize{Audio|Video}Decoder() |
68 // has been called (with the correct stream type). | 69 // has been called (with the correct stream type). |
69 // After this operation, the decoder is set to an uninitialized state. | 70 // After this operation, the decoder is set to an uninitialized state. |
70 // The decoder can be reinitialized after it is deinitialized. | 71 // The decoder can be reinitialized after it is deinitialized. |
71 DeinitializeDecoder(DemuxerStream.Type stream_type); | 72 DeinitializeDecoder(DemuxerStream.Type stream_type); |
72 }; | 73 }; |
OLD | NEW |