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

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

Issue 12638030: Make AudioDecoderConfig copyable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « media/filters/source_buffer_stream.cc ('k') | webkit/media/crypto/ppapi_decryptor.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 #include "media/webm/webm_stream_parser.h" 5 #include "media/webm/webm_stream_parser.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 original_audio_config.sample_format(), 357 original_audio_config.sample_format(),
358 original_audio_config.channel_layout(), 358 original_audio_config.channel_layout(),
359 original_audio_config.samples_per_second(), 359 original_audio_config.samples_per_second(),
360 original_audio_config.extra_data(), 360 original_audio_config.extra_data(),
361 original_audio_config.extra_data_size(), 361 original_audio_config.extra_data_size(),
362 is_audio_encrypted, 362 is_audio_encrypted,
363 false); 363 false);
364 364
365 FireNeedKey(tracks_parser.audio_encryption_key_id()); 365 FireNeedKey(tracks_parser.audio_encryption_key_id());
366 } else { 366 } else {
367 audio_config.CopyFrom(config_helper.audio_config()); 367 audio_config = config_helper.audio_config();
368 } 368 }
369 369
370 bool is_video_encrypted = !tracks_parser.video_encryption_key_id().empty(); 370 bool is_video_encrypted = !tracks_parser.video_encryption_key_id().empty();
371 VideoDecoderConfig video_config; 371 VideoDecoderConfig video_config;
372 if (is_video_encrypted) { 372 if (is_video_encrypted) {
373 const VideoDecoderConfig& original_video_config = 373 const VideoDecoderConfig& original_video_config =
374 config_helper.video_config(); 374 config_helper.video_config();
375 video_config.Initialize(original_video_config.codec(), 375 video_config.Initialize(original_video_config.codec(),
376 original_video_config.profile(), 376 original_video_config.profile(),
377 original_video_config.format(), 377 original_video_config.format(),
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 470
471 void WebMStreamParser::FireNeedKey(const std::string& key_id) { 471 void WebMStreamParser::FireNeedKey(const std::string& key_id) {
472 int key_id_size = key_id.size(); 472 int key_id_size = key_id.size();
473 DCHECK_GT(key_id_size, 0); 473 DCHECK_GT(key_id_size, 0);
474 scoped_array<uint8> key_id_array(new uint8[key_id_size]); 474 scoped_array<uint8> key_id_array(new uint8[key_id_size]);
475 memcpy(key_id_array.get(), key_id.data(), key_id_size); 475 memcpy(key_id_array.get(), key_id.data(), key_id_size);
476 need_key_cb_.Run(kWebMInitDataType, key_id_array.Pass(), key_id_size); 476 need_key_cb_.Run(kWebMInitDataType, key_id_array.Pass(), key_id_size);
477 } 477 }
478 478
479 } // namespace media 479 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/source_buffer_stream.cc ('k') | webkit/media/crypto/ppapi_decryptor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698