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

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

Issue 10696182: Add config change handling to SourceBufferStream & ChunkDemuxer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added copyright headers to manifest files Created 8 years, 4 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/base/audio_decoder_config.h ('k') | media/base/byte_queue.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 "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "media/audio/sample_rates.h" 9 #include "media/audio/sample_rates.h"
10 #include "media/base/limits.h" 10 #include "media/base/limits.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 74
75 bool AudioDecoderConfig::IsValidConfig() const { 75 bool AudioDecoderConfig::IsValidConfig() const {
76 return codec_ != kUnknownAudioCodec && 76 return codec_ != kUnknownAudioCodec &&
77 channel_layout_ != CHANNEL_LAYOUT_UNSUPPORTED && 77 channel_layout_ != CHANNEL_LAYOUT_UNSUPPORTED &&
78 bits_per_channel_ > 0 && 78 bits_per_channel_ > 0 &&
79 bits_per_channel_ <= limits::kMaxBitsPerSample && 79 bits_per_channel_ <= limits::kMaxBitsPerSample &&
80 samples_per_second_ > 0 && 80 samples_per_second_ > 0 &&
81 samples_per_second_ <= limits::kMaxSampleRate; 81 samples_per_second_ <= limits::kMaxSampleRate;
82 } 82 }
83 83
84 bool AudioDecoderConfig::Matches(const AudioDecoderConfig& config) const {
85 return ((codec() == config.codec()) &&
86 (bits_per_channel() == config.bits_per_channel()) &&
87 (channel_layout() == config.channel_layout()) &&
88 (samples_per_second() == config.samples_per_second()) &&
89 (extra_data_size() == config.extra_data_size()) &&
90 (!extra_data() || !memcmp(extra_data(), config.extra_data(),
91 extra_data_size())));
92 }
93
84 void AudioDecoderConfig::CopyFrom(const AudioDecoderConfig& audio_config) { 94 void AudioDecoderConfig::CopyFrom(const AudioDecoderConfig& audio_config) {
85 Initialize(audio_config.codec(), 95 Initialize(audio_config.codec(),
86 audio_config.bits_per_channel(), 96 audio_config.bits_per_channel(),
87 audio_config.channel_layout(), 97 audio_config.channel_layout(),
88 audio_config.samples_per_second(), 98 audio_config.samples_per_second(),
89 audio_config.extra_data(), 99 audio_config.extra_data(),
90 audio_config.extra_data_size(), 100 audio_config.extra_data_size(),
91 false); 101 false);
92 } 102 }
93 103
(...skipping 15 matching lines...) Expand all
109 119
110 uint8* AudioDecoderConfig::extra_data() const { 120 uint8* AudioDecoderConfig::extra_data() const {
111 return extra_data_.get(); 121 return extra_data_.get();
112 } 122 }
113 123
114 size_t AudioDecoderConfig::extra_data_size() const { 124 size_t AudioDecoderConfig::extra_data_size() const {
115 return extra_data_size_; 125 return extra_data_size_;
116 } 126 }
117 127
118 } // namespace media 128 } // namespace media
OLDNEW
« no previous file with comments | « media/base/audio_decoder_config.h ('k') | media/base/byte_queue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698