Chromium Code Reviews| Index: chromecast/public/media/decoder_config.cc |
| diff --git a/chromecast/public/media/decoder_config.cc b/chromecast/public/media/decoder_config.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..fe5d6ed312ebc2b317c192712fc46c56bbbf1e4f |
| --- /dev/null |
| +++ b/chromecast/public/media/decoder_config.cc |
| @@ -0,0 +1,62 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "chromecast/public/media/decoder_config.h" |
|
gunsch
2015/04/29 17:42:52
Should this be "decoder_config.h" or "media/decode
erickung1
2015/04/29 20:49:15
Done.
|
| + |
| +namespace { |
|
gunsch
2015/04/29 17:42:52
nit: put anonymous namespace within chromecast::me
erickung1
2015/04/29 20:49:15
Done.
|
| + |
| +// Maximum audio bytes per sample. |
| +static int kMaxBytesPerSample = 4; |
|
gunsch
2015/04/29 17:42:52
const (here and below)
erickung1
2015/04/29 20:49:15
Done.
|
| + |
| +// Maximum audio sampling rate. |
| +static int kMaxSampleRate = 192000; |
| + |
| +} |
|
gunsch
2015/04/29 17:42:52
// namespace
erickung1
2015/04/29 20:49:15
Done.
|
| + |
| +namespace chromecast { |
| +namespace media { |
| + |
| +DecoderConfig::DecoderConfig() |
| + : is_encrypted(false) { |
| +} |
| + |
| +DecoderConfig::~DecoderConfig() { |
| +} |
| + |
| +AudioConfig::AudioConfig() |
| + : codec(kAudioCodecUnknown), |
| + bytes_per_channel(0), |
| + channel_number(0), |
| + samples_per_second(0) { |
| +} |
| + |
| +AudioConfig::~AudioConfig() { |
| +} |
| + |
| +bool AudioConfig::IsValidConfig() const { |
| + return codec >= kAudioCodecMin && |
| + codec <= kAudioCodecMax && |
| + channel_number > 0 && |
| + bytes_per_channel > 0 && |
| + bytes_per_channel <= kMaxBytesPerSample && |
| + samples_per_second > 0 && |
| + samples_per_second <= kMaxSampleRate; |
| +} |
| + |
| +VideoConfig::VideoConfig() |
| + : codec(kVideoCodecUnknown), |
| + profile(kVideoProfileUnknown), |
| + additional_config(NULL) { |
| +} |
| + |
| +VideoConfig::~VideoConfig() { |
| +} |
| + |
| +bool VideoConfig::IsValidConfig() const { |
| + return (codec >= kVideoCodecMin && codec <= kVideoCodecMax); |
|
gunsch
2015/04/29 17:42:52
nit: unnecessary parens
erickung1
2015/04/29 20:49:15
Done.
|
| +} |
| + |
| + |
| +} // namespace media |
| +} // namespace chromecast |