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

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

Issue 11226019: Encrypted Media: Replace DecryptorClient with key event callbacks. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 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/mock_filters.h » ('j') | media/crypto/aes_decryptor.cc » ('J')
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 #include <string> 9 #include <string>
10 10
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 // same |stream_type| is fired. 111 // same |stream_type| is fired.
112 virtual void CancelDecrypt(StreamType stream_type) = 0; 112 virtual void CancelDecrypt(StreamType stream_type) = 0;
113 113
114 // Indicates completion of audio/video decoder initialization. 114 // Indicates completion of audio/video decoder initialization.
115 // 115 //
116 // First Parameter: Indicates initialization success. 116 // First Parameter: Indicates initialization success.
117 // - Set to true if initialization was successful. False if an error occurred. 117 // - Set to true if initialization was successful. False if an error occurred.
118 typedef base::Callback<void(bool)> DecoderInitCB; 118 typedef base::Callback<void(bool)> DecoderInitCB;
119 119
120 // Indicates that a key has been added to the Decryptor. 120 // Indicates that a key has been added to the Decryptor.
121 typedef base::Callback<void()> KeyAddedCB; 121 typedef base::Callback<void()> OnKeyAddedCB;
122 122
123 // Initializes a decoder with the given |config|, executing the |init_cb| 123 // Initializes a decoder with the given |config|, executing the |init_cb|
124 // upon completion. 124 // upon completion.
125 // |key_added_cb| should be called when a key is added to the decryptor. 125 // |key_added_cb| should be called when a key is added to the decryptor.
126 virtual void InitializeAudioDecoder(scoped_ptr<AudioDecoderConfig> config, 126 virtual void InitializeAudioDecoder(scoped_ptr<AudioDecoderConfig> config,
127 const DecoderInitCB& init_cb, 127 const DecoderInitCB& init_cb,
128 const KeyAddedCB& key_added_cb) = 0; 128 const OnKeyAddedCB& key_added_cb) = 0;
129 virtual void InitializeVideoDecoder(scoped_ptr<VideoDecoderConfig> config, 129 virtual void InitializeVideoDecoder(scoped_ptr<VideoDecoderConfig> config,
130 const DecoderInitCB& init_cb, 130 const DecoderInitCB& init_cb,
131 const KeyAddedCB& key_added_cb) = 0; 131 const OnKeyAddedCB& key_added_cb) = 0;
132 132
133 // Helper structure for managing multiple decoded audio buffers per input. 133 // Helper structure for managing multiple decoded audio buffers per input.
134 typedef std::list<scoped_refptr<Buffer> > AudioBuffers; 134 typedef std::list<scoped_refptr<Buffer> > AudioBuffers;
135 135
136 // Indicates completion of audio/video decrypt-and-decode operation. 136 // Indicates completion of audio/video decrypt-and-decode operation.
137 // 137 //
138 // First parameter: The status of the decrypt-and-decode operation. 138 // First parameter: The status of the decrypt-and-decode operation.
139 // - Set to kSuccess if the encrypted buffer is successfully decrypted and 139 // - Set to kSuccess if the encrypted buffer is successfully decrypted and
140 // decoded. In this case, the decoded frame/buffers can be/contain: 140 // decoded. In this case, the decoded frame/buffers can be/contain:
141 // 1) NULL, which means the operation has been aborted. 141 // 1) NULL, which means the operation has been aborted.
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 // The decoder can be reinitialized after it is uninitialized. 185 // The decoder can be reinitialized after it is uninitialized.
186 virtual void DeinitializeDecoder(StreamType stream_type) = 0; 186 virtual void DeinitializeDecoder(StreamType stream_type) = 0;
187 187
188 private: 188 private:
189 DISALLOW_COPY_AND_ASSIGN(Decryptor); 189 DISALLOW_COPY_AND_ASSIGN(Decryptor);
190 }; 190 };
191 191
192 } // namespace media 192 } // namespace media
193 193
194 #endif // MEDIA_BASE_DECRYPTOR_H_ 194 #endif // MEDIA_BASE_DECRYPTOR_H_
OLDNEW
« no previous file with comments | « no previous file | media/base/mock_filters.h » ('j') | media/crypto/aes_decryptor.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698