Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

Side by Side Diff: media/base/decryptor.h

Issue 2416373002: media: Use native Decryptor enum types in media mojo interfaces (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | media/base/ipc/media_param_traits_macros.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 10 matching lines...) Expand all
21 class VideoFrame; 21 class VideoFrame;
22 22
23 // Decrypts (and decodes) encrypted buffer. 23 // Decrypts (and decodes) encrypted buffer.
24 // 24 //
25 // All methods are called on the (video/audio) decoder thread. Decryptor 25 // All methods are called on the (video/audio) decoder thread. Decryptor
26 // implementations must be thread safe when methods are called this way. 26 // implementations must be thread safe when methods are called this way.
27 // Depending on the implementation callbacks may be fired synchronously or 27 // Depending on the implementation callbacks may be fired synchronously or
28 // asynchronously. 28 // asynchronously.
29 class MEDIA_EXPORT Decryptor { 29 class MEDIA_EXPORT Decryptor {
30 public: 30 public:
31 // TODO(xhwang): Replace kError with kDecryptError and kDecodeError.
32 // TODO(xhwang): Replace kNeedMoreData with kNotEnoughData.
33 enum Status { 31 enum Status {
34 kSuccess, // Decryption successfully completed. Decrypted buffer ready. 32 kSuccess, // Decryption successfully completed. Decrypted buffer ready.
35 kNoKey, // No key is available to decrypt. 33 kNoKey, // No key is available to decrypt.
36 kNeedMoreData, // Decoder needs more data to produce a frame. 34 kNeedMoreData, // Decoder needs more data to produce a frame.
37 kError // Key is available but an error occurred during decryption. 35 kError, // Key is available but an error occurred during decryption.
36 STATUS_MAX = kError
dcheng 2016/10/14 21:36:42 Nit: it's probably better to be consistent with na
xhwang 2016/10/14 21:40:09 I am not sure. I think at certain point we want to
dcheng 2016/10/14 22:01:12 Shrug, I'm not an owner of this code. But usually,
xhwang 2016/10/14 22:39:54 Agreed. I was updating this then my machine lost p
38 }; 37 };
39 38
40 // TODO(xhwang): Unify this with DemuxerStream::Type. 39 // TODO(xhwang): Unify this with DemuxerStream::Type.
41 enum StreamType { 40 enum StreamType { kAudio, kVideo, STREAM_TYPE_MAX = kVideo };
42 kAudio,
43 kVideo
44 };
45 41
46 Decryptor(); 42 Decryptor();
47 virtual ~Decryptor(); 43 virtual ~Decryptor();
48 44
49 // Indicates that a new key has been added to the MediaKeys object associated 45 // Indicates that a new key has been added to the MediaKeys object associated
50 // with the Decryptor. 46 // with the Decryptor.
51 typedef base::Callback<void()> NewKeyCB; 47 typedef base::Callback<void()> NewKeyCB;
52 48
53 // Registers a NewKeyCB which should be called when a new key is added to the 49 // Registers a NewKeyCB which should be called when a new key is added to the
54 // decryptor. Only one NewKeyCB can be registered for one |stream_type|. 50 // decryptor. Only one NewKeyCB can be registered for one |stream_type|.
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 // The decoder can be reinitialized after it is uninitialized. 155 // The decoder can be reinitialized after it is uninitialized.
160 virtual void DeinitializeDecoder(StreamType stream_type) = 0; 156 virtual void DeinitializeDecoder(StreamType stream_type) = 0;
161 157
162 private: 158 private:
163 DISALLOW_COPY_AND_ASSIGN(Decryptor); 159 DISALLOW_COPY_AND_ASSIGN(Decryptor);
164 }; 160 };
165 161
166 } // namespace media 162 } // namespace media
167 163
168 #endif // MEDIA_BASE_DECRYPTOR_H_ 164 #endif // MEDIA_BASE_DECRYPTOR_H_
OLDNEW
« no previous file with comments | « no previous file | media/base/ipc/media_param_traits_macros.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698