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

Unified 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: Split the strcutre into {Audio|Video}Config Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
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
« 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