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

Side by Side Diff: media/webm/webm_stream_parser.cc

Issue 10535029: Add support for encrypted WebM files as defined in the RFC. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix uint64 literal. Created 8 years, 5 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 | « media/webm/webm_parser.cc ('k') | 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 #include "media/webm/webm_stream_parser.h" 5 #include "media/webm/webm_stream_parser.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "media/ffmpeg/ffmpeg_common.h" 9 #include "media/ffmpeg/ffmpeg_common.h"
10 #include "media/filters/ffmpeg_glue.h" 10 #include "media/filters/ffmpeg_glue.h"
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 if (!config_cb_.Run(config_helper.audio_config(), 345 if (!config_cb_.Run(config_helper.audio_config(),
346 config_helper.video_config())) { 346 config_helper.video_config())) {
347 DVLOG(1) << "New config data isn't allowed."; 347 DVLOG(1) << "New config data isn't allowed.";
348 return -1; 348 return -1;
349 } 349 }
350 350
351 // TODO(xhwang): Support decryption of audio (see http://crbug.com/123421). 351 // TODO(xhwang): Support decryption of audio (see http://crbug.com/123421).
352 if (tracks_parser.video_encryption_key_id()) { 352 if (tracks_parser.video_encryption_key_id()) {
353 int key_id_size = tracks_parser.video_encryption_key_id_size(); 353 int key_id_size = tracks_parser.video_encryption_key_id_size();
354 CHECK_GT(key_id_size, 0); 354 CHECK_GT(key_id_size, 0);
355 CHECK_LT(key_id_size, 2048);
355 scoped_array<uint8> key_id(new uint8[key_id_size]); 356 scoped_array<uint8> key_id(new uint8[key_id_size]);
356 memcpy(key_id.get(), tracks_parser.video_encryption_key_id(), key_id_size); 357 memcpy(key_id.get(), tracks_parser.video_encryption_key_id(), key_id_size);
357 need_key_cb_.Run(key_id.Pass(), key_id_size); 358 need_key_cb_.Run(key_id.Pass(), key_id_size);
358 } 359 }
359 360
360 cluster_parser_.reset(new WebMClusterParser( 361 cluster_parser_.reset(new WebMClusterParser(
361 info_parser.timecode_scale(), 362 info_parser.timecode_scale(),
362 tracks_parser.audio_track_num(), 363 tracks_parser.audio_track_num(),
363 tracks_parser.video_track_num(), 364 tracks_parser.video_track_num(),
364 tracks_parser.video_encryption_key_id(), 365 tracks_parser.video_encryption_key_id(),
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 if (!audio_buffers.empty() && !audio_cb_.Run(audio_buffers)) 420 if (!audio_buffers.empty() && !audio_cb_.Run(audio_buffers))
420 return -1; 421 return -1;
421 422
422 if (!video_buffers.empty() && !video_cb_.Run(video_buffers)) 423 if (!video_buffers.empty() && !video_cb_.Run(video_buffers))
423 return -1; 424 return -1;
424 425
425 return bytes_parsed; 426 return bytes_parsed;
426 } 427 }
427 428
428 } // namespace media 429 } // namespace media
OLDNEW
« no previous file with comments | « media/webm/webm_parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698