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

Side by Side Diff: content_decryption_module.h

Issue 1536063003: Switch to nullptr, eliminating a dependency on base/basictypes.h and base/macros.h. (Closed) Base URL: https://chromium.googlesource.com/chromium/cdm.git@master
Patch Set: Created 5 years 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 | no next file » | 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 CDM_CONTENT_DECRYPTION_MODULE_H_ 5 #ifndef CDM_CONTENT_DECRYPTION_MODULE_H_
6 #define CDM_CONTENT_DECRYPTION_MODULE_H_ 6 #define CDM_CONTENT_DECRYPTION_MODULE_H_
7 7
8 #if defined(_MSC_VER) 8 #if defined(_MSC_VER)
9 typedef unsigned char uint8_t; 9 typedef unsigned char uint8_t;
10 typedef unsigned int uint32_t; 10 typedef unsigned int uint32_t;
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 144
145 uint32_t clear_bytes; 145 uint32_t clear_bytes;
146 uint32_t cipher_bytes; 146 uint32_t cipher_bytes;
147 }; 147 };
148 148
149 // Represents an input buffer to be decrypted (and possibly decoded). It does 149 // Represents an input buffer to be decrypted (and possibly decoded). It does
150 // not own any pointers in this struct. If |iv_size| = 0, the data is 150 // not own any pointers in this struct. If |iv_size| = 0, the data is
151 // unencrypted. 151 // unencrypted.
152 struct InputBuffer { 152 struct InputBuffer {
153 InputBuffer() 153 InputBuffer()
154 : data(NULL), 154 : data(nullptr),
155 data_size(0), 155 data_size(0),
156 key_id(NULL), 156 key_id(nullptr),
157 key_id_size(0), 157 key_id_size(0),
158 iv(NULL), 158 iv(nullptr),
159 iv_size(0), 159 iv_size(0),
160 subsamples(NULL), 160 subsamples(nullptr),
161 num_subsamples(0), 161 num_subsamples(0),
162 timestamp(0) {} 162 timestamp(0) {}
163 163
164 const uint8_t* data; // Pointer to the beginning of the input data. 164 const uint8_t* data; // Pointer to the beginning of the input data.
165 uint32_t data_size; // Size (in bytes) of |data|. 165 uint32_t data_size; // Size (in bytes) of |data|.
166 166
167 const uint8_t* key_id; // Key ID to identify the decryption key. 167 const uint8_t* key_id; // Key ID to identify the decryption key.
168 uint32_t key_id_size; // Size (in bytes) of |key_id|. 168 uint32_t key_id_size; // Size (in bytes) of |key_id|.
169 169
170 const uint8_t* iv; // Initialization vector. 170 const uint8_t* iv; // Initialization vector.
(...skipping 10 matching lines...) Expand all
181 kUnknownAudioCodec = 0, 181 kUnknownAudioCodec = 0,
182 kCodecVorbis, 182 kCodecVorbis,
183 kCodecAac 183 kCodecAac
184 }; 184 };
185 185
186 AudioDecoderConfig() 186 AudioDecoderConfig()
187 : codec(kUnknownAudioCodec), 187 : codec(kUnknownAudioCodec),
188 channel_count(0), 188 channel_count(0),
189 bits_per_channel(0), 189 bits_per_channel(0),
190 samples_per_second(0), 190 samples_per_second(0),
191 extra_data(NULL), 191 extra_data(nullptr),
192 extra_data_size(0) {} 192 extra_data_size(0) {}
193 193
194 AudioCodec codec; 194 AudioCodec codec;
195 int32_t channel_count; 195 int32_t channel_count;
196 int32_t bits_per_channel; 196 int32_t bits_per_channel;
197 int32_t samples_per_second; 197 int32_t samples_per_second;
198 198
199 // Optional byte data required to initialize audio decoders, such as the 199 // Optional byte data required to initialize audio decoders, such as the
200 // vorbis setup header. 200 // vorbis setup header.
201 uint8_t* extra_data; 201 uint8_t* extra_data;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 kH264ProfileHigh, 245 kH264ProfileHigh,
246 kH264ProfileHigh10, 246 kH264ProfileHigh10,
247 kH264ProfileHigh422, 247 kH264ProfileHigh422,
248 kH264ProfileHigh444Predictive 248 kH264ProfileHigh444Predictive
249 }; 249 };
250 250
251 VideoDecoderConfig() 251 VideoDecoderConfig()
252 : codec(kUnknownVideoCodec), 252 : codec(kUnknownVideoCodec),
253 profile(kUnknownVideoCodecProfile), 253 profile(kUnknownVideoCodecProfile),
254 format(kUnknownVideoFormat), 254 format(kUnknownVideoFormat),
255 extra_data(NULL), 255 extra_data(nullptr),
256 extra_data_size(0) {} 256 extra_data_size(0) {}
257 257
258 VideoCodec codec; 258 VideoCodec codec;
259 VideoCodecProfile profile; 259 VideoCodecProfile profile;
260 VideoFormat format; 260 VideoFormat format;
261 261
262 // Width and height of video frame immediately post-decode. Not all pixels 262 // Width and height of video frame immediately post-decode. Not all pixels
263 // in this region are valid. 263 // in this region are valid.
264 Size coded_size; 264 Size coded_size;
265 265
(...skipping 21 matching lines...) Expand all
287 const uint8_t* signed_data_signature; 287 const uint8_t* signed_data_signature;
288 uint32_t signed_data_signature_length; 288 uint32_t signed_data_signature_length;
289 289
290 // X.509 device specific certificate for the |service_id| requested. 290 // X.509 device specific certificate for the |service_id| requested.
291 const uint8_t* platform_key_certificate; 291 const uint8_t* platform_key_certificate;
292 uint32_t platform_key_certificate_length; 292 uint32_t platform_key_certificate_length;
293 }; 293 };
294 294
295 // Used when passing arrays of binary data. Does not own the referenced data. 295 // Used when passing arrays of binary data. Does not own the referenced data.
296 struct BinaryData { 296 struct BinaryData {
297 BinaryData() : data(NULL), length(0) {} 297 BinaryData() : data(nullptr), length(0) {}
298 const uint8_t* data; 298 const uint8_t* data;
299 uint32_t length; 299 uint32_t length;
300 }; 300 };
301 301
302 // The current status of the associated key. The valid types are defined in the 302 // The current status of the associated key. The valid types are defined in the
303 // spec: https://w3c.github.io/encrypted-media/#idl-def-MediaKeyStatus 303 // spec: https://w3c.github.io/encrypted-media/#idl-def-MediaKeyStatus
304 enum KeyStatus { 304 enum KeyStatus {
305 kUsable = 0, 305 kUsable = 0,
306 kInternalError = 1, 306 kInternalError = 1,
307 kExpired = 2, 307 kExpired = 2,
308 kOutputRestricted = 3, 308 kOutputRestricted = 3,
309 kOutputDownscaled = 4, 309 kOutputDownscaled = 4,
310 kStatusPending = 5, 310 kStatusPending = 5,
311 kReleased = 6 311 kReleased = 6
312 }; 312 };
313 313
314 // Used when passing arrays of key information. Does not own the referenced 314 // Used when passing arrays of key information. Does not own the referenced
315 // data. |system_code| is an additional error code for unusable keys and 315 // data. |system_code| is an additional error code for unusable keys and
316 // should be 0 when |status| == kUsable. 316 // should be 0 when |status| == kUsable.
317 struct KeyInformation { 317 struct KeyInformation {
318 KeyInformation() 318 KeyInformation()
319 : key_id(NULL), key_id_size(0), status(kInternalError), system_code(0) {} 319 : key_id(nullptr),
320 key_id_size(0),
321 status(kInternalError),
322 system_code(0) {}
320 const uint8_t* key_id; 323 const uint8_t* key_id;
321 uint32_t key_id_size; 324 uint32_t key_id_size;
322 KeyStatus status; 325 KeyStatus status;
323 uint32_t system_code; 326 uint32_t system_code;
324 }; 327 };
325 328
326 // Supported output protection methods for use with EnableOutputProtection() and 329 // Supported output protection methods for use with EnableOutputProtection() and
327 // returned by OnQueryOutputProtectionStatus(). 330 // returned by OnQueryOutputProtectionStatus().
328 enum OutputProtectionMethods { 331 enum OutputProtectionMethods {
329 kProtectionNone = 0, 332 kProtectionNone = 0,
(...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after
1190 virtual AudioFormat Format() const = 0; 1193 virtual AudioFormat Format() const = 0;
1191 1194
1192 protected: 1195 protected:
1193 AudioFrames() {} 1196 AudioFrames() {}
1194 virtual ~AudioFrames() {} 1197 virtual ~AudioFrames() {}
1195 }; 1198 };
1196 1199
1197 } // namespace cdm 1200 } // namespace cdm
1198 1201
1199 #endif // CDM_CONTENT_DECRYPTION_MODULE_H_ 1202 #endif // CDM_CONTENT_DECRYPTION_MODULE_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698