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

Side by Side Diff: chromecast/public/media/decoder_config.cc

Issue 1074383002: Introduce VideoConfig/AudioConfig class for CMA backend (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change NULL to nullptr Created 5 years, 7 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
(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
OLDNEW
« chromecast/public/media/decoder_config.h ('K') | « chromecast/public/media/decoder_config.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698