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

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

Issue 2752323002: Support Opus Ambisonics playback (Closed)
Patch Set: actually add config_ change Created 3 years, 8 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
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 #include "media/base/media_util.h"
10 10
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 codec_ = codec; 44 codec_ = codec;
45 channel_layout_ = channel_layout; 45 channel_layout_ = channel_layout;
46 samples_per_second_ = samples_per_second; 46 samples_per_second_ = samples_per_second;
47 sample_format_ = sample_format; 47 sample_format_ = sample_format;
48 bytes_per_channel_ = SampleFormatToBytesPerChannel(sample_format); 48 bytes_per_channel_ = SampleFormatToBytesPerChannel(sample_format);
49 extra_data_ = extra_data; 49 extra_data_ = extra_data;
50 encryption_scheme_ = encryption_scheme; 50 encryption_scheme_ = encryption_scheme;
51 seek_preroll_ = seek_preroll; 51 seek_preroll_ = seek_preroll;
52 codec_delay_ = codec_delay; 52 codec_delay_ = codec_delay;
53 53
54 int channels = ChannelLayoutToChannelCount(channel_layout_); 54 // If |channel_layout_| is CHANNEL_LAYOUT_DISCRETE, |channels_| and
55 bytes_per_frame_ = channels * bytes_per_channel_; 55 // |bytes_per_frame_| will be overwritten in SetChannelsForDiscrete()
56 channels_ = ChannelLayoutToChannelCount(channel_layout_);
57 bytes_per_frame_ = channels_ * bytes_per_channel_;
56 } 58 }
57 59
58 AudioDecoderConfig::~AudioDecoderConfig() {} 60 AudioDecoderConfig::~AudioDecoderConfig() {}
59 61
60 bool AudioDecoderConfig::IsValidConfig() const { 62 bool AudioDecoderConfig::IsValidConfig() const {
61 return codec_ != kUnknownAudioCodec && 63 return codec_ != kUnknownAudioCodec &&
62 channel_layout_ != CHANNEL_LAYOUT_UNSUPPORTED && 64 channel_layout_ != CHANNEL_LAYOUT_UNSUPPORTED &&
63 bytes_per_channel_ > 0 && 65 bytes_per_channel_ > 0 &&
64 bytes_per_channel_ <= limits::kMaxBytesPerSample && 66 bytes_per_channel_ <= limits::kMaxBytesPerSample &&
65 samples_per_second_ > 0 && 67 samples_per_second_ > 0 &&
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 << "Config is already encrypted."; 107 << "Config is already encrypted.";
106 // TODO(xhwang): This is only used to guide decoder selection, so set 108 // TODO(xhwang): This is only used to guide decoder selection, so set
107 // a common encryption scheme that should be supported by all decrypting 109 // a common encryption scheme that should be supported by all decrypting
108 // decoders. We should be able to remove this when we support switching 110 // decoders. We should be able to remove this when we support switching
109 // decoders at run time. See http://crbug.com/695595 111 // decoders at run time. See http://crbug.com/695595
110 encryption_scheme_ = AesCtrEncryptionScheme(); 112 encryption_scheme_ = AesCtrEncryptionScheme();
111 } 113 }
112 } 114 }
113 115
114 } // namespace media 116 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698