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 "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.
| |
6 | |
7 namespace { | |
gunsch
2015/04/29 17:42:52
nit: put anonymous namespace within chromecast::me
erickung1
2015/04/29 20:49:15
Done.
| |
8 | |
9 // Maximum audio bytes per sample. | |
10 static int kMaxBytesPerSample = 4; | |
gunsch
2015/04/29 17:42:52
const (here and below)
erickung1
2015/04/29 20:49:15
Done.
| |
11 | |
12 // Maximum audio sampling rate. | |
13 static int kMaxSampleRate = 192000; | |
14 | |
15 } | |
gunsch
2015/04/29 17:42:52
// namespace
erickung1
2015/04/29 20:49:15
Done.
| |
16 | |
17 namespace chromecast { | |
18 namespace media { | |
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(NULL) { | |
51 } | |
52 | |
53 VideoConfig::~VideoConfig() { | |
54 } | |
55 | |
56 bool VideoConfig::IsValidConfig() const { | |
57 return (codec >= kVideoCodecMin && codec <= kVideoCodecMax); | |
gunsch
2015/04/29 17:42:52
nit: unnecessary parens
erickung1
2015/04/29 20:49:15
Done.
| |
58 } | |
59 | |
60 | |
61 } // namespace media | |
62 } // namespace chromecast | |
OLD | NEW |