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

Side by Side Diff: media/base/audio_decoder_config.cc

Issue 2701203003: media: Prefer decrypting pipeline when CDM is attached (Closed)
Patch Set: comments addressed Created 3 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
« no previous file with comments | « media/base/audio_decoder_config.h ('k') | media/base/video_decoder_config.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/base/audio_decoder_config.h" 5 #include "media/base/audio_decoder_config.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "media/base/limits.h" 8 #include "media/base/limits.h"
9 #include "media/base/media_util.h"
9 10
10 namespace media { 11 namespace media {
11 12
12 AudioDecoderConfig::AudioDecoderConfig() 13 AudioDecoderConfig::AudioDecoderConfig()
13 : codec_(kUnknownAudioCodec), 14 : codec_(kUnknownAudioCodec),
14 sample_format_(kUnknownSampleFormat), 15 sample_format_(kUnknownSampleFormat),
15 bytes_per_channel_(0), 16 bytes_per_channel_(0),
16 channel_layout_(CHANNEL_LAYOUT_UNSUPPORTED), 17 channel_layout_(CHANNEL_LAYOUT_UNSUPPORTED),
17 samples_per_second_(0), 18 samples_per_second_(0),
18 bytes_per_frame_(0), 19 bytes_per_frame_(0),
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 << " samples_per_second: " << samples_per_second() 89 << " samples_per_second: " << samples_per_second()
89 << " sample_format: " << sample_format() 90 << " sample_format: " << sample_format()
90 << " bytes_per_frame: " << bytes_per_frame() 91 << " bytes_per_frame: " << bytes_per_frame()
91 << " seek_preroll: " << seek_preroll().InMilliseconds() << "ms" 92 << " seek_preroll: " << seek_preroll().InMilliseconds() << "ms"
92 << " codec_delay: " << codec_delay() << " has extra data? " 93 << " codec_delay: " << codec_delay() << " has extra data? "
93 << (extra_data().empty() ? "false" : "true") << " encrypted? " 94 << (extra_data().empty() ? "false" : "true") << " encrypted? "
94 << (is_encrypted() ? "true" : "false"); 95 << (is_encrypted() ? "true" : "false");
95 return s.str(); 96 return s.str();
96 } 97 }
97 98
99 void AudioDecoderConfig::SetIsEncrypted(bool is_encrypted) {
100 if (!is_encrypted) {
101 DCHECK(encryption_scheme_.is_encrypted()) << "Config is already clear.";
102 encryption_scheme_ = Unencrypted();
103 } else {
104 DCHECK(!encryption_scheme_.is_encrypted())
105 << "Config is already encrypted.";
106 // TODO(xhwang): This is only used to guide decoder selection, so set
107 // a common encryption scheme that should be supported by all decrypting
108 // decoders. We should be able to remove this when we support switching
109 // decoders at run time. See http://crbug.com/695595
110 encryption_scheme_ = AesCtrEncryptionScheme();
111 }
112 }
113
98 } // namespace media 114 } // namespace media
OLDNEW
« no previous file with comments | « media/base/audio_decoder_config.h ('k') | media/base/video_decoder_config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698