OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef MEDIA_BASE_DECRYPTOR_H_ | 5 #ifndef MEDIA_BASE_DECRYPTOR_H_ |
6 #define MEDIA_BASE_DECRYPTOR_H_ | 6 #define MEDIA_BASE_DECRYPTOR_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 | 49 |
50 // TODO(xhwang): Replace kError with kDecryptError and kDecodeError. | 50 // TODO(xhwang): Replace kError with kDecryptError and kDecodeError. |
51 // TODO(xhwang): Replace kNeedMoreData with kNotEnoughData. | 51 // TODO(xhwang): Replace kNeedMoreData with kNotEnoughData. |
52 enum Status { | 52 enum Status { |
53 kSuccess, // Decryption successfully completed. Decrypted buffer ready. | 53 kSuccess, // Decryption successfully completed. Decrypted buffer ready. |
54 kNoKey, // No key is available to decrypt. | 54 kNoKey, // No key is available to decrypt. |
55 kNeedMoreData, // Decoder needs more data to produce a frame. | 55 kNeedMoreData, // Decoder needs more data to produce a frame. |
56 kError // Key is available but an error occurred during decryption. | 56 kError // Key is available but an error occurred during decryption. |
57 }; | 57 }; |
58 | 58 |
| 59 // TODO(xhwang): Unify this with DemuxerStream::Type. |
59 enum StreamType { | 60 enum StreamType { |
60 kAudio, | 61 kAudio, |
61 kVideo | 62 kVideo |
62 }; | 63 }; |
63 | 64 |
64 Decryptor(); | 65 Decryptor(); |
65 virtual ~Decryptor(); | 66 virtual ~Decryptor(); |
66 | 67 |
67 // Generates a key request for the |key_system| with |type| and | 68 // Generates a key request for the |key_system| with |type| and |
68 // |init_data| provided. | 69 // |init_data| provided. |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 // The decoder can be reinitialized after it is uninitialized. | 200 // The decoder can be reinitialized after it is uninitialized. |
200 virtual void DeinitializeDecoder(StreamType stream_type) = 0; | 201 virtual void DeinitializeDecoder(StreamType stream_type) = 0; |
201 | 202 |
202 private: | 203 private: |
203 DISALLOW_COPY_AND_ASSIGN(Decryptor); | 204 DISALLOW_COPY_AND_ASSIGN(Decryptor); |
204 }; | 205 }; |
205 | 206 |
206 } // namespace media | 207 } // namespace media |
207 | 208 |
208 #endif // MEDIA_BASE_DECRYPTOR_H_ | 209 #endif // MEDIA_BASE_DECRYPTOR_H_ |
OLD | NEW |