| 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..1b372415a28b54057ce9263529a1663c9ef30fdf
|
| --- /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 "decoder_config.h"
|
| +
|
| +namespace chromecast {
|
| +namespace media {
|
| +
|
| +namespace {
|
| +
|
| +// Maximum audio bytes per sample.
|
| +static const int kMaxBytesPerSample = 4;
|
| +
|
| +// Maximum audio sampling rate.
|
| +static const int kMaxSampleRate = 192000;
|
| +
|
| +} // namespace
|
| +
|
| +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(nullptr) {
|
| +}
|
| +
|
| +VideoConfig::~VideoConfig() {
|
| +}
|
| +
|
| +bool VideoConfig::IsValidConfig() const {
|
| + return codec >= kVideoCodecMin && codec <= kVideoCodecMax;
|
| +}
|
| +
|
| +
|
| +} // namespace media
|
| +} // namespace chromecast
|
|
|