Add helper method to determine the current application horizontal size classes.
[chromium-blink-merge.git] / media / base / limits.h
blobc3cd6777d6c6500f1b48cb44c60601b9b8bf9254
1 // Copyright (c) 2011 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.
5 // Contains limit definition constants for the media subsystem.
7 #ifndef MEDIA_BASE_LIMITS_H_
8 #define MEDIA_BASE_LIMITS_H_
10 #include "base/basictypes.h"
12 namespace media {
14 namespace limits {
16 enum {
17 // Maximum possible dimension (width or height) for any video.
18 kMaxDimension = (1 << 15) - 1, // 32767
20 // Maximum possible canvas size (width multiplied by height) for any video.
21 kMaxCanvas = (1 << (14 * 2)), // 16384 x 16384
23 // Total number of video frames which are populating in the pipeline.
24 kMaxVideoFrames = 4,
26 // The following limits are used by AudioParameters::IsValid().
28 // A few notes on sample rates of common formats:
29 // - AAC files are limited to 96 kHz.
30 // - MP3 files are limited to 48 kHz.
31 // - Vorbis used to be limited to 96 KHz, but no longer has that
32 // restriction.
33 // - Most PC audio hardware is limited to 192 KHz.
34 kMaxSampleRate = 192000,
35 kMinSampleRate = 3000,
36 kMaxChannels = 32,
37 kMaxBytesPerSample = 4,
38 kMaxBitsPerSample = kMaxBytesPerSample * 8,
39 kMaxSamplesPerPacket = kMaxSampleRate,
40 kMaxPacketSizeInBytes =
41 kMaxBytesPerSample * kMaxChannels * kMaxSamplesPerPacket,
43 // This limit is used by ParamTraits<VideoCaptureParams>.
44 kMaxFramesPerSecond = 1000,
46 // Maximum lengths for various EME API parameters. These are checks to
47 // prevent unnecessarily large parameters from being passed around, and the
48 // lengths are somewhat arbitrary as the EME spec doesn't specify any limits.
49 kMinCertificateLength = 128,
50 kMaxCertificateLength = 16 * 1024,
51 kMaxSessionIdLength = 512,
52 kMinKeyIdLength = 1,
53 kMaxKeyIdLength = 512,
54 kMaxKeyIds = 128,
55 kMaxInitDataLength = 64 * 1024, // 64 KB
56 kMaxSessionResponseLength = 64 * 1024, // 64 KB
57 kMaxKeySystemLength = 256,
60 } // namespace limits
62 } // namespace media
64 #endif // MEDIA_BASE_LIMITS_H_