summaryrefslogtreecommitdiffstats
path: root/media/base
diff options
context:
space:
mode:
authorcevans@chromium.org <cevans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-04 01:48:54 +0000
committercevans@chromium.org <cevans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-04 01:48:54 +0000
commitd2c0b40f5ab663392f2da36cf92ccb695b8b3790 (patch)
tree0aed2cd03b4a7edc00e545babc9db0e2c61aa80b /media/base
parent05c1aefc1a4e68906a1e57262fb8e211e6f73408 (diff)
downloadchromium_src-d2c0b40f5ab663392f2da36cf92ccb695b8b3790.zip
chromium_src-d2c0b40f5ab663392f2da36cf92ccb695b8b3790.tar.gz
chromium_src-d2c0b40f5ab663392f2da36cf92ccb695b8b3790.tar.bz2
Apply some sanity checks to the values coming back to us from FFmpeg.
Put the limits in a new standalone header file that can be re-used in other place where we have similar limits. BUG=NONE TEST=media_unittests pass Review URL: http://codereview.chromium.org/200011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25416 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base')
-rw-r--r--media/base/limits.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/media/base/limits.h b/media/base/limits.h
new file mode 100644
index 0000000..583d6dd
--- /dev/null
+++ b/media/base/limits.h
@@ -0,0 +1,28 @@
+// Copyright (c) 2009 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.
+
+// Contains limit definition constants for the media subsystem.
+
+#ifndef MEDIA_BASE_LIMITS_H_
+#define MEDIA_BASE_LIMITS_H_
+
+#include "base/basictypes.h"
+
+namespace media {
+
+struct Limits {
+ // For video.
+ static const size_t kMaxDimension = (1 << 15) - 1; // 32767
+ static const size_t kMaxCanvas = (1 << (14 * 2)); // 16384 x 16384
+
+ // For audio.
+ static const size_t kMaxSampleRate = 192000;
+ static const size_t kMaxChannels = 32;
+ static const size_t kMaxBPS = 64;
+};
+
+} // namespace media
+
+#endif // MEDIA_BASE_LIMITS_H_
+