layout: doc title: “Starboard Configuration Reference Guide”

Architecture Configuration

Properties
SB_IS_BIG_ENDIAN

Whether the current platform is big endian. SB_IS_LITTLE_ENDIAN will be automatically set based on this.

The default value in the Stub implementation is 0
SB_IS_ARCH_ARM

Whether the current platform is an ARM architecture.

The default value in the Stub implementation is 0
SB_IS_ARCH_MIPS

Whether the current platform is a MIPS architecture.

The default value in the Stub implementation is 0
SB_IS_ARCH_PPC

Whether the current platform is a PPC architecture.

The default value in the Stub implementation is 0
SB_IS_ARCH_X86

Whether the current platform is an x86 architecture.

The default value in the Stub implementation is 1
SB_IS_32_BIT

Assume a 64-bit architecture.

The default value in the Stub implementation is 0
SB_IS_64_BIT

The default value in the Stub implementation is 1
SB_HAS_32_BIT_POINTERS

Whether the current platform‘s pointers are 32-bit. Whether the current platform’s longs are 32-bit.

The default value in the Stub implementation is 1
SB_HAS_32_BIT_LONG

The default value in the Stub implementation is 1
SB_HAS_32_BIT_POINTERS

The default value in the Stub implementation is 0
SB_HAS_32_BIT_LONG

The default value in the Stub implementation is 0
SB_HAS_64_BIT_POINTERS

Whether the current platform‘s pointers are 64-bit. Whether the current platform’s longs are 64-bit.

The default value in the Stub implementation is 1
SB_HAS_64_BIT_LONG

The default value in the Stub implementation is 1
SB_HAS_64_BIT_POINTERS

The default value in the Stub implementation is 0
SB_HAS_64_BIT_LONG

The default value in the Stub implementation is 0
SB_HAS_MANY_CORES

Whether the current platform is expected to have many cores (> 6), or a wildly varying number of cores.

The default value in the Stub implementation is 1
SB_HAS_1_CORE

Whether the current platform is expected to have exactly 1 core.

The default value in the Stub implementation is 0
SB_HAS_2_CORES

Whether the current platform is expected to have exactly 2 cores.

The default value in the Stub implementation is 0
SB_HAS_4_CORES

Whether the current platform is expected to have exactly 4 cores.

The default value in the Stub implementation is 0
SB_HAS_6_CORES

Whether the current platform is expected to have exactly 6 cores.

The default value in the Stub implementation is 0
SB_HAS_THREAD_PRIORITY_SUPPORT

Whether the current platform supports thread priorities.

The default value in the Stub implementation is 0
SB_HAS_CROSS_CORE_SCHEDULER

Whether the current platform's thread scheduler will automatically balance threads between cores, as opposed to systems where threads will only ever run on the specifically pinned core.

The default value in the Stub implementation is 1
SB_HAS_QUIRK_DOES_NOT_STACK_ALIGN_OVER_16_BYTES

Some platforms will not align variables on the stack with an alignment greater than 16 bytes. Platforms where this is the case should define the following quirk.

By default, this property is undefined.
SB_HAS_QUIRK_THREAD_AFFINITY_UNSUPPORTED

Some platforms do not have thread affinity support. Platforms where this is the case should define the following quirk.

By default, this property is undefined.

Compiler Configuration

Properties
SB_C_FORCE_INLINE

The platform's annotation for forcing a C function to be inlined.

The default value in the Stub implementation is
__inline__ __attribute__((always_inline))
SB_C_INLINE

The platform's annotation for marking a C function as suggested to be inlined.

The default value in the Stub implementation is inline
SB_C_NOINLINE

The platform's annotation for marking a C function as forcibly not inlined.

The default value in the Stub implementation is __attribute__((noinline))
SB_EXPORT_PLATFORM

The platform's annotation for marking a symbol as exported outside of the current shared library.

The default value in the Stub implementation is
__attribute__((visibility("default")))
SB_IMPORT_PLATFORM

The platform's annotation for marking a symbol as imported from outside of the current linking unit.
SB_HAS_QUIRK_COMPILER_SAYS_GNUC_BUT_ISNT

On some platforms the __GNUC__ is defined even though parts of the functionality are missing. Setting this to non-zero allows disabling missing functionality encountered.

By default, this property is undefined.
SB_HAS_QUIRK_HASFEATURE_NOT_DEFINED_BUT_IT_IS

On some compilers, the frontend has a quirk such that #ifdef cannot correctly detect __has_feature is defined, and an example error you get is:

By default, this property is undefined.

Decoder-only Params

Properties
SB_MEDIA_BUFFER_ALIGNMENT

Specifies how media buffers must be aligned on this platform as some decoders may have special requirement on the alignment of buffers being decoded.

The default value in the Stub implementation is 128U
SB_MEDIA_VIDEO_FRAME_ALIGNMENT

Specifies how video frame buffers must be aligned on this platform.

The default value in the Stub implementation is 256U
SB_MEDIA_MAXIMUM_VIDEO_PREROLL_FRAMES

The encoded video frames are compressed in different ways, so their decoding time can vary a lot. Occasionally a single frame can take longer time to decode than the average time per frame. The player has to cache some frames to account for such inconsistency. The number of frames being cached are controlled by SB_MEDIA_MAXIMUM_VIDEO_PREROLL_FRAMES and SB_MEDIA_MAXIMUM_VIDEO_FRAMES. Specify the number of video frames to be cached before the playback starts. Note that setting this value too large may increase the playback start delay.

The default value in the Stub implementation is 4
SB_MEDIA_MAXIMUM_VIDEO_FRAMES

Specify the number of video frames to be cached during playback. A large value leads to more stable fps but also causes the app to use more memory.

The default value in the Stub implementation is 12

Extensions Configuration

Properties
SB_HAS_LONG_LONG_HASH

GCC/Clang doesn't define a long long hash function, except for Android and Game consoles.

The default value in the Stub implementation is 0
SB_HAS_STRING_HASH

GCC/Clang doesn't define a string hash function, except for Game Consoles.

The default value in the Stub implementation is 0
SB_HAS_HASH_USING

Desktop Linux needs a using statement for the hash functions.

The default value in the Stub implementation is 0
SB_HAS_HASH_VALUE

Set this to 1 if hash functions for custom types can be defined as a hash_value() function. Otherwise, they need to be placed inside a partially-specified hash struct template with an operator().

The default value in the Stub implementation is 0
SB_HAS_HASH_WARNING

Set this to 1 if use of hash_map or hash_set causes a deprecation warning (which then breaks the build).

The default value in the Stub implementation is 1
SB_HASH_MAP_INCLUDE

The location to include hash_map on this platform.

The default value in the Stub implementation is <ext/hash_map>
SB_HASH_NAMESPACE

C++'s hash_map and hash_set are often found in different namespaces depending on the compiler.

The default value in the Stub implementation is __gnu_cxx
SB_HASH_SET_INCLUDE

The location to include hash_set on this platform.

The default value in the Stub implementation is <ext/hash_set>
SB_VA_COPY(dest, source)

Define this to how this platform copies varargs blocks.

The default value in the Stub implementation is va_copy(dest, source)

Filesystem Configuration

Properties
SB_FILE_MAX_NAME

The current platform's maximum length of the name of a single directory entry, not including the absolute path.

The default value in the Stub implementation is 64
SB_FILE_MAX_PATH

The current platform's maximum length of an absolute path.

The default value in the Stub implementation is 4096
SB_FILE_MAX_OPEN

The current platform's maximum number of files that can be opened at the same time by one process.

The default value in the Stub implementation is 64
SB_FILE_SEP_CHAR

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.

The default value in the Stub implementation is '/'
SB_FILE_ALT_SEP_CHAR

The current platform's alternate file path component separator character. This is like SB_FILE_SEP_CHAR, except if your platform supports an alternate character, then you can place that here. For example, on windows machines, the primary separator character is probably '', but the alternate is ‘/’.

The default value in the Stub implementation is '/'
SB_PATH_SEP_CHAR

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.

The default value in the Stub implementation is ':'
SB_FILE_SEP_STRING

The string form of SB_FILE_SEP_CHAR.

The default value in the Stub implementation is "/"
SB_FILE_ALT_SEP_STRING

The string form of SB_FILE_ALT_SEP_CHAR.

The default value in the Stub implementation is "/"
SB_PATH_SEP_STRING

The string form of SB_PATH_SEP_CHAR.

The default value in the Stub implementation is ":"
SB_HAS_QUIRK_FILESYSTEM_COARSE_ACCESS_TIME

On some platforms the file system stores access times at a coarser granularity than other times. When this quirk is defined, we assume the access time is of 1 day precision.

By default, this property is undefined.

Graphics Configuration

Properties
SB_HAS_BLITTER

Specifies whether this platform supports a performant accelerated blitter API. The basic requirement is a scaled, clipped, alpha-blended blit.

The default value in the Stub implementation is 0
SB_PREFERRED_RGBA_BYTE_ORDER

Specifies the preferred byte order of color channels in a pixel. Refer to starboard/configuration.h for the possible values. EGL/GLES platforms should generally prefer a byte order of RGBA, regardless of endianness.

The default value in the Stub implementation is
SB_PREFERRED_RGBA_BYTE_ORDER_RGBA
SB_HAS_BILINEAR_FILTERING_SUPPORT

Indicates whether or not the given platform supports bilinear filtering. This can be checked to enable/disable renderer tests that verify that this is working properly.

The default value in the Stub implementation is 1
SB_HAS_NV12_TEXTURE_SUPPORT

Indicates whether or not the given platform supports rendering of NV12 textures. These textures typically originate from video decoders.

The default value in the Stub implementation is 0
SB_MUST_FREQUENTLY_FLIP_DISPLAY_BUFFER

Whether the current platform should frequently flip its display buffer. If this is not required (i.e. SB_MUST_FREQUENTLY_FLIP_DISPLAY_BUFFER is set to 0), then optimizations are enabled so the display buffer is not flipped if the scene hasn't changed.

The default value in the Stub implementation is 0
SB_HAS_VIRTUAL_REALITY

The default value in the Stub implementation is 1

Media Configuration

Properties
SB_HAS_PLAYER

Specifies whether this platform has support for a possibly-decrypting elementary stream player for at least H.264/AAC (and AES-128-CTR, if decrypting). A player is responsible for ingesting an audio and video elementary stream, optionally-encrypted, and ultimately producing synchronized audio/video. If a player is defined, it must choose one of the supported composition methods below.

The default value in the Stub implementation is 1
SB_HAS_QUIRK_SEEK_TO_KEYFRAME

After a seek is triggerred, the default behavior is to append video frames from the last key frame before the seek time and append audio frames from the seek time because usually all audio frames are key frames. On platforms that cannot decode video frames without displaying them, this will cause the video being played without audio for several seconds after seeking. When the following macro is defined, the app will append audio frames start from the timestamp that is before the timestamp of the video key frame being appended.

By default, this property is undefined.
SB_HAS_QUIRK_NO_FFS

dlmalloc will use the ffs intrinsic if available. Platforms on which this is not available should define the following quirk.

By default, this property is undefined.
SB_MEDIA_MAX_AUDIO_BITRATE_IN_BITS_PER_SECOND

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.

The default value in the Stub implementation is (40 * 1024 * 1024)
SB_MEDIA_MAX_VIDEO_BITRATE_IN_BITS_PER_SECOND

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.

The default value in the Stub implementation is (200 * 1024 * 1024)
SB_HAS_MEDIA_WEBM_VP9_SUPPORT

Specifies whether this platform has webm/vp9 support. This should be set to non-zero on platforms with webm/vp9 support.

The default value in the Stub implementation is 0
SB_MEDIA_THREAD_STACK_SIZE

Specifies the stack size for threads created inside media stack. Set to 0 to use the default thread stack size. Set to non-zero to explicitly set the stack size for media stack threads.

The default value in the Stub implementation is 0U

Memory Configuration

Properties
SB_MEMORY_PAGE_SIZE

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.

The default value in the Stub implementation is 4096
SB_HAS_MMAP

Whether this platform has and should use an MMAP function to map physical memory to the virtual address space.

The default value in the Stub implementation is 1
SB_CAN_MAP_EXECUTABLE_MEMORY

Whether this platform can map executable memory. Implies SB_HAS_MMAP. This is required for platforms that want to JIT.

The default value in the Stub implementation is 1
SB_HAS_VIRTUAL_REGIONS

Whether this platform has and should use an growable heap (e.g. with sbrk()) to map physical memory to the virtual address space.

The default value in the Stub implementation is 0
SB_NETWORK_IO_BUFFER_ALIGNMENT

Specifies the alignment for IO Buffers, in bytes. Some low-level network APIs may require buffers to have a specific alignment, and this is the place to specify that.

The default value in the Stub implementation is 16
SB_MALLOC_ALIGNMENT

Determines the alignment that allocations should have on this platform.

The default value in the Stub implementation is ((size_t)16U)
SB_DEFAULT_MMAP_THRESHOLD

Determines the threshhold of allocation size that should be done with mmap (if available), rather than allocated within the core heap.

The default value in the Stub implementation is ((size_t)(256 * 1024U))
SB_MEMORY_LOG_PATH

Defines the path where memory debugging logs should be written to.

The default value in the Stub implementation is "/tmp/starboard"

Network Configuration

Properties
SB_HAS_IPV6

Specifies whether this platform supports IPV6.

The default value in the Stub implementation is 1
SB_HAS_PIPE

Specifies whether this platform supports pipe.

The default value in the Stub implementation is 1

System Header Configuration

Any system headers listed here that are not provided by the platform will be emulated in starboard/types.h.

Properties
SB_HAS_STDARG_H

Whether the current platform provides the standard header stdarg.h.

The default value in the Stub implementation is 1
SB_HAS_STDBOOL_H

Whether the current platform provides the standard header stdbool.h.

The default value in the Stub implementation is 1
SB_HAS_STDDEF_H

Whether the current platform provides the standard header stddef.h.

The default value in the Stub implementation is 1
SB_HAS_STDINT_H

Whether the current platform provides the standard header stdint.h.

The default value in the Stub implementation is 1
SB_HAS_INTTYPES_H

Whether the current platform provides the standard header inttypes.h.

The default value in the Stub implementation is 1
SB_HAS_WCHAR_H

Whether the current platform provides the standard header wchar.h.

The default value in the Stub implementation is 1
SB_HAS_LIMITS_H

Whether the current platform provides the standard header limits.h.

The default value in the Stub implementation is 1
SB_HAS_FLOAT_H

Whether the current platform provides the standard header float.h.

The default value in the Stub implementation is 1
SB_HAS_SSIZE_T

Whether the current platform provides ssize_t.

The default value in the Stub implementation is 1
SB_HAS_MICROPHONE

Whether the current platform has microphone supported.

The default value in the Stub implementation is 1
SB_HAS_SPEECH_RECOGNIZER

Whether the current platform has speech recognizer.

The default value in the Stub implementation is 1
SB_HAS_SPEECH_SYNTHESIS

Whether the current platform has speech synthesis.

The default value in the Stub implementation is 1
SB_IS_WCHAR_T_UTF32

Type detection for wchar_t.

The default value in the Stub implementation is 1
SB_IS_WCHAR_T_UTF16

The default value in the Stub implementation is 1
SB_IS_WCHAR_T_UNSIGNED

Chrome only defines these two if ARMEL or MIPSEL are defined. Chrome has an exclusion for iOS here, we should too when we support iOS.

The default value in the Stub implementation is 1
SB_IS_WCHAR_T_SIGNED

The default value in the Stub implementation is 1
SB_HAS_QUIRK_MEMSET_IN_SYSTEM_HEADERS

Some platforms have memset predefined in system headers. Platforms where this is the case should define the following quirk.

By default, this property is undefined.
SB_HAS_QUIRK_SOCKET_BSD_HEADERS

This quirk is used to switch the headers included in starboard/shared/linux/socket_get_interface_address.cc for darwin system headers. It may be removed at some point in favor of a different solution.

By default, this property is undefined.

Thread Configuration

Properties
SB_MAX_THREADS

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 managable.

The default value in the Stub implementation is 90
SB_MAX_THREAD_LOCAL_KEYS

The maximum number of thread local storage keys supported by this platform.

The default value in the Stub implementation is 512
SB_MAX_THREAD_NAME_LENGTH

The maximum length of the name for a thread, including the NULL-terminator.

The default value in the Stub implementation is 16;

Timing API

Properties
SB_HAS_TIME_THREAD_NOW

Whether this platform has an API to retrieve how long the current thread has spent in the executing state.

The default value in the Stub implementation is 1

Tuneable Parameters

Properties
SB_NETWORK_RECEIVE_BUFFER_SIZE

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.

The default value in the Stub implementation is (0)

User Configuration

Properties
SB_USER_MAX_SIGNED_IN

The maximum number of users that can be signed in at the same time.

The default value in the Stub implementation is 1