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

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: Change NULL to nullptr 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..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
« 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