forked from youtube/cobalt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configuration_constants.cc
101 lines (81 loc) · 4.23 KB
/
configuration_constants.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
// Copyright 2019 The Cobalt Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// This file defines all configuration constants for a platform.
#include "starboard/configuration_constants.h"
// The current platform's maximum length of the name of a single directory
// entry, not including the absolute path.
const int32_t kSbFileMaxName = 64;
// The current platform's maximum number of files that can be opened at the
// same time by one process.
const uint32_t kSbFileMaxOpen = 64;
// The current platform's maximum length of an absolute path.
const uint32_t kSbFileMaxPath = 4096;
// The current platform's file path component separator character. This is the
// character that appears after a directory in a file path. For example, the
// absolute canonical path of the file "/path/to/a/file.txt" uses '/' as a path
// component separator character.
const char kSbFileSepChar = '/';
// The string form of SB_FILE_SEP_CHAR.
const char* kSbFileSepString = "/";
// Whether the current platform supports thread priorities.
const bool kSbHasThreadPrioritySupport = false;
// The maximum number of thread local storage keys supported by this platform.
const uint32_t kSbMaxThreadLocalKeys = 512;
// The maximum length of a name for a thread, including the NULL-terminator.
const int32_t kSbMaxThreadNameLength = 16;
// The maximum audio bitrate the platform can decode. The following value
// equals to 5M bytes per seconds which is more than enough for compressed
// audio.
const uint32_t kSbMediaMaxAudioBitrateInBitsPerSecond = 40 * 1024 * 1024;
// The maximum video bitrate the platform can decode. The following value
// equals to 25M bytes per seconds which is more than enough for compressed
// video.
const uint32_t kSbMediaMaxVideoBitrateInBitsPerSecond = 200 * 1024 * 1024;
// The memory page size, which controls the size of chunks on memory that
// allocators deal with, and the alignment of those chunks. This doesn't have to
// be the hardware-defined physical page size, but it should be a multiple of
// it.
const size_t kSbMemoryPageSize = 4096;
// Specifies the network receive buffer size in bytes, set via
// SbSocketSetReceiveBufferSize().
//
// Setting this to 0 indicates that SbSocketSetReceiveBufferSize() should
// not be called. Use this for OSs (such as Linux) where receive buffer
// auto-tuning is better.
//
// On some platforms, this may affect max TCP window size which may
// dramatically affect throughput in the presence of latency.
//
// If your platform does not have a good TCP auto-tuning mechanism,
// a setting of (128 * 1024) here is recommended.
const uint32_t kSbNetworkReceiveBufferSize = 0;
// Defines the maximum number of simultaneous threads for this platform. Some
// platforms require sharing thread handles with other kinds of system handles,
// like mutexes, so we want to keep this manageable.
const uint32_t kSbMaxThreads = 90;
// The current platform's search path component separator character. When
// specifying an ordered list of absolute paths of directories to search for a
// given reason, this is the character that appears between entries. For
// example, the search path of "/etc/search/first:/etc/search/second" uses ':'
// as a search path component separator character.
const char kSbPathSepChar = ':';
// The string form of SB_PATH_SEP_CHAR.
const char* kSbPathSepString = ":";
// The maximum size the cache directory is allowed to use in bytes.
const uint32_t kSbMaxSystemPathCacheDirectorySize = 24 << 20; // 24MiB
// Whether this platform can map executable memory. This is required for
// platforms that want to JIT.
SB_EXPORT extern const bool kSbCanMapExecutableMemory = false;
// Platform can support partial audio frames
SB_EXPORT extern const bool kHasPartialAudioFramesSupport = false;