OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "decoder_config.h" |
| 6 |
| 7 namespace chromecast { |
| 8 namespace media { |
| 9 |
| 10 namespace { |
| 11 |
| 12 // Maximum audio bytes per sample. |
| 13 static const int kMaxBytesPerSample = 4; |
| 14 |
| 15 // Maximum audio sampling rate. |
| 16 static const int kMaxSampleRate = 192000; |
| 17 |
| 18 } // namespace |
| 19 |
| 20 DecoderConfig::DecoderConfig() |
| 21 : is_encrypted(false) { |
| 22 } |
| 23 |
| 24 DecoderConfig::~DecoderConfig() { |
| 25 } |
| 26 |
| 27 AudioConfig::AudioConfig() |
| 28 : codec(kAudioCodecUnknown), |
| 29 bytes_per_channel(0), |
| 30 channel_number(0), |
| 31 samples_per_second(0) { |
| 32 } |
| 33 |
| 34 AudioConfig::~AudioConfig() { |
| 35 } |
| 36 |
| 37 bool AudioConfig::IsValidConfig() const { |
| 38 return codec >= kAudioCodecMin && |
| 39 codec <= kAudioCodecMax && |
| 40 channel_number > 0 && |
| 41 bytes_per_channel > 0 && |
| 42 bytes_per_channel <= kMaxBytesPerSample && |
| 43 samples_per_second > 0 && |
| 44 samples_per_second <= kMaxSampleRate; |
| 45 } |
| 46 |
| 47 VideoConfig::VideoConfig() |
| 48 : codec(kVideoCodecUnknown), |
| 49 profile(kVideoProfileUnknown), |
| 50 additional_config(nullptr) { |
| 51 } |
| 52 |
| 53 VideoConfig::~VideoConfig() { |
| 54 } |
| 55 |
| 56 bool VideoConfig::IsValidConfig() const { |
| 57 return codec >= kVideoCodecMin && codec <= kVideoCodecMax; |
| 58 } |
| 59 |
| 60 |
| 61 } // namespace media |
| 62 } // namespace chromecast |
OLD | NEW |