[CI20] Add support for CI20 platform This change adds starboard files for CI20 Creator platform. Change-Id: If137089e298c9cc1119d924419272f7b3ad85dd3
diff --git a/src/starboard/creator/__init__.py b/src/starboard/creator/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/starboard/creator/__init__.py
diff --git a/src/starboard/creator/ci20x11/atomic_public.h b/src/starboard/creator/ci20x11/atomic_public.h new file mode 100644 index 0000000..932fe9d --- /dev/null +++ b/src/starboard/creator/ci20x11/atomic_public.h
@@ -0,0 +1,20 @@ +// Copyright 2016 Google Inc. 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. + +#ifndef STARBOARD_CREATOR_CI20X11_ATOMIC_PUBLIC_H_ +#define STARBOARD_CREATOR_CI20X11_ATOMIC_PUBLIC_H_ + +#include "starboard/linux/shared/atomic_public.h" + +#endif // STARBOARD_CREATOR_CI20X11_ATOMIC_PUBLIC_H_
diff --git a/src/starboard/creator/ci20x11/configuration_public.h b/src/starboard/creator/ci20x11/configuration_public.h new file mode 100644 index 0000000..4c00bad --- /dev/null +++ b/src/starboard/creator/ci20x11/configuration_public.h
@@ -0,0 +1,20 @@ +// Copyright 2016 Google Inc. 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. + +#ifndef STARBOARD_CREATOR_CI20X11_CONFIGURATION_PUBLIC_H_ +#define STARBOARD_CREATOR_CI20X11_CONFIGURATION_PUBLIC_H_ + +#include "starboard/creator/shared/configuration_public.h" + +#endif // STARBOARD_CREATOR_CI20X11_CONFIGURATION_PUBLIC_H_
diff --git a/src/starboard/creator/ci20x11/gcc/4.9/atomic_public.h b/src/starboard/creator/ci20x11/gcc/4.9/atomic_public.h new file mode 100644 index 0000000..547cf9a --- /dev/null +++ b/src/starboard/creator/ci20x11/gcc/4.9/atomic_public.h
@@ -0,0 +1,20 @@ +// Copyright 2016 Google Inc. 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. + +#ifndef STARBOARD_CREATOR_CI20X11_GCC_4_9_ATOMIC_PUBLIC_H_ +#define STARBOARD_CREATOR_CI20X11_GCC_4_9_ATOMIC_PUBLIC_H_ + +#include "starboard/linux/shared/atomic_public.h" + +#endif // STARBOARD_CREATOR_CI20X11_GCC_4_9_ATOMIC_PUBLIC_H_
diff --git a/src/starboard/creator/ci20x11/gcc/4.9/compiler_flags.gypi b/src/starboard/creator/ci20x11/gcc/4.9/compiler_flags.gypi new file mode 100644 index 0000000..2e7df1d --- /dev/null +++ b/src/starboard/creator/ci20x11/gcc/4.9/compiler_flags.gypi
@@ -0,0 +1,121 @@ +# Copyright 2016 Google Inc. 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. + +# Platform specific compiler flags for Linux on Starboard. Included from +# gyp_configuration.gypi. +# +{ + 'variables': { + 'compiler_flags_host': [ + '-O2', + ], + 'linker_flags': [ + '-Wl,-rpath=<@(toolchain_lib_path)', + ], + 'compiler_flags_cc_debug': [ + '-frtti', + ], + 'compiler_flags_debug': [ + '-O0', + ], + 'compiler_flags_cc_devel': [ + '-frtti', + ], + 'compiler_flags_devel': [ + '-O2', + ], + 'compiler_flags_cc_qa': [ + '-fno-rtti', + ], + 'compiler_flags_qa': [ + '-O2', + ], + 'compiler_flags_cc_gold': [ + '-fno-rtti', + ], + 'compiler_flags_gold': [ + '-O2', + ], + 'common_compiler_flags': [ + # Default visibility to hidden, to enable dead stripping. + '-fvisibility=hidden', + # protobuf uses hash_map. + '-fno-exceptions', + # Don't warn about the "struct foo f = {0};" initialization pattern. + '-Wno-missing-field-initializers', + '-fno-strict-aliasing', # See http://crbug.com/32204 + # Don't warn about any conversions. + '-Wno-conversion', + # Don't warn about unreachable code. See + # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46158 + '-Wno-unreachable-code', + '-Wno-deprecated-declarations', + # Disable warning: + # 'comparison is always true due to limited range of data type' + '-Wno-extra', + # Don't warn about inlining + '-Wno-inline', + # Disable warning: 'typedef locally defined but not used'. + '-Wno-unused-local-typedefs', + # Disable warning: 'narrowing conversion' + '-Wno-narrowing', + # Do not remove null this checks. + '-fno-delete-null-pointer-checks', + ], + 'conditions': [ + ['cobalt_fastbuild==0', { + 'compiler_flags_debug': [ + '-g', + ], + 'compiler_flags_devel': [ + '-g', + ], + 'compiler_flags_qa': [ + ], + 'compiler_flags_gold': [ + ], + }], + ], + }, + + 'target_defaults': { + 'cflags_c': [ + # Limit to C99. This allows Linux to be a canary build for any + # C11 features that are not supported on some platforms' compilers. + '-std=c99', + ], + 'cflags_cc': [ + '-std=gnu++11', + # Don't warn for invalid access to non-static data member of NULL object. + '-Wno-invalid-offsetof', + # Don't warn about deprecated use + '-Wno-deprecated', + ], + 'target_conditions': [ + ['sb_pedantic_warnings==1', { + 'cflags': [ + '-Wall', + '-Wextra', + '<@(common_compiler_flags)', + ], + },{ + 'cflags': [ + '<@(common_compiler_flags)', + # Do not warn about unused function params. + '-Wno-unused-parameter', + ], + }], + ], + }, # end of target_defaults +}
diff --git a/src/starboard/creator/ci20x11/gcc/4.9/configuration_public.h b/src/starboard/creator/ci20x11/gcc/4.9/configuration_public.h new file mode 100644 index 0000000..e47392a --- /dev/null +++ b/src/starboard/creator/ci20x11/gcc/4.9/configuration_public.h
@@ -0,0 +1,20 @@ +// Copyright 2016 Google Inc. 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. + +#ifndef STARBOARD_CREATOR_CI20X11_GCC_4_9_CONFIGURATION_PUBLIC_H_ +#define STARBOARD_CREATOR_CI20X11_GCC_4_9_CONFIGURATION_PUBLIC_H_ + +#include "starboard/creator/shared/configuration_public.h" + +#endif // STARBOARD_CREATOR_CI20X11_GCC_4_9_CONFIGURATION_PUBLIC_H_
diff --git a/src/starboard/creator/ci20x11/gcc/4.9/gyp_configuration.gypi b/src/starboard/creator/ci20x11/gcc/4.9/gyp_configuration.gypi new file mode 100644 index 0000000..edd0533 --- /dev/null +++ b/src/starboard/creator/ci20x11/gcc/4.9/gyp_configuration.gypi
@@ -0,0 +1,45 @@ +# Copyright 2016 Google Inc. 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. + +{ + 'variables': { + 'linker_flags!': [ + '-Wl,--wrap=malloc', + '-Wl,--wrap=free', + ], + }, + + 'target_defaults': { + 'default_configuration': 'creator-ci20x11-gcc-4-9_debug', + 'configurations': { + 'creator-ci20x11-gcc-4-9_debug': { + 'inherit_from': ['debug_base'], + }, + 'creator-ci20x11-gcc-4-9_devel': { + 'inherit_from': ['devel_base'], + }, + 'creator-ci20x11-gcc-4-9_qa': { + 'inherit_from': ['qa_base'], + }, + 'creator-ci20x11-gcc-4-9_gold': { + 'inherit_from': ['gold_base'], + }, + }, # end of configurations + }, + + 'includes': [ + 'compiler_flags.gypi', + '../gyp_configuration.gypi', + ], +}
diff --git a/src/starboard/creator/ci20x11/gcc/4.9/gyp_configuration.py b/src/starboard/creator/ci20x11/gcc/4.9/gyp_configuration.py new file mode 100644 index 0000000..f180c32 --- /dev/null +++ b/src/starboard/creator/ci20x11/gcc/4.9/gyp_configuration.py
@@ -0,0 +1,118 @@ +# Copyright 2016 Google Inc. 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. +"""Starboard Creator CI20 X11 gcc 4.9 platform configuration for gyp_cobalt.""" + +import logging +import os +import subprocess + +# pylint: disable=import-self,g-import-not-at-top +import gyp_utils +# Import the shared Linux platform configuration. +from starboard.creator.shared import gyp_configuration +from starboard.tools.testing import test_filter + +class PlatformConfig(gyp_configuration.PlatformConfig): + """Starboard Creator platform configuration.""" + + def __init__(self, platform): + super(PlatformConfig, self).__init__(platform) + + def GetVariables(self, configuration): + variables = super(PlatformConfig, self).GetVariables(configuration) + variables.update({'clang': 0,}) + toolchain_lib_path = os.path.join(self.toolchain_dir, 'lib') + variables.update({'toolchain_lib_path': toolchain_lib_path,}) + return variables + + def GetEnvironmentVariables(self): + env_variables = super(PlatformConfig, self).GetEnvironmentVariables() + self.toolchain_dir = os.path.join(self.ci20_home) + toolchain_bin_dir = os.path.join(self.toolchain_dir, 'bin') + env_variables.update({ + 'CC': os.path.join(toolchain_bin_dir, 'mipsel-linux-gnu-gcc'), + 'CXX': os.path.join(toolchain_bin_dir, 'mipsel-linux-gnu-g++'), + 'CC_host': 'gcc', + 'CXX_host': 'g++', + 'LD_host': 'g++', + 'ARFLAGS_host': 'rcs', + 'ARTHINFLAGS_host': 'rcsT', + }) + return env_variables + + def GetTestFilters(self): + """Gets all tests to be excluded from a unit test run. + + Returns: + A list of initialized TestFilter objects. + """ + return [ + # test is disabled on x64 + test_filter.TestFilter( + 'bindings_test', ('GlobalInterfaceBindingsTest.' + 'PropertiesAndOperationsAreOwnProperties')), + # tests miss the defined delay + test_filter.TestFilter( + 'nplb', 'SbConditionVariableWaitTimedTest.SunnyDay'), + test_filter.TestFilter( + 'nplb', 'SbConditionVariableWaitTimedTest.SunnyDayAutoInit'), + # tests sometimes miss the threshold of 10ms + test_filter.TestFilter( + 'nplb', 'Semaphore.ThreadTakesWait_PutBeforeTimeExpires'), + test_filter.TestFilter( + 'nplb', 'RWLock.HoldsLockForTime'), + # tests sometimes miss the threshold of 5ms + test_filter.TestFilter( + 'nplb', 'Semaphore.ThreadTakesWait_TimeExpires'), + test_filter.TestFilter( + 'nplb', 'SbWindowCreateTest.SunnyDayDefault'), + test_filter.TestFilter( + 'nplb', 'SbWindowCreateTest.SunnyDayDefaultSet'), + test_filter.TestFilter( + 'nplb', 'SbWindowGetPlatformHandleTest.SunnyDay'), + test_filter.TestFilter( + 'nplb', 'SbWindowGetSizeTest.SunnyDay'), + test_filter.TestFilter( + 'nplb', 'SbPlayerTest.SunnyDay'), + # test fails when built with GCC 4.9, issue was fixed in later versions of GCC + test_filter.TestFilter( + 'nplb', 'SbAlignTest.AlignAsStackVariable'), + # tests fail also on x86 + test_filter.TestFilter( + 'nplb', 'SbSocketAddressTypes/SbSocketGetInterfaceAddressTest.SunnyDayDestination/1'), + test_filter.TestFilter( + 'nplb', 'SbSocketAddressTypes/SbSocketGetInterfaceAddressTest.SunnyDaySourceForDestination/1'), + test_filter.TestFilter( + 'nplb', 'SbSocketAddressTypes/SbSocketGetInterfaceAddressTest.SunnyDaySourceNotLoopback/1'), + # there are no test cases in this test + test_filter.TestFilter( + 'starboard_platform_tests', test_filter.FILTER_ALL), + # there are no test cases in this test + test_filter.TestFilter( + 'nplb_blitter_pixel_tests', test_filter.FILTER_ALL), + # test fails on x64 also + test_filter.TestFilter( + 'net_unittests', 'HostResolverImplDnsTest.DnsTaskUnspec'), + # we don't have proper procedure for running this test + test_filter.TestFilter( + 'web_platform_tests', test_filter.FILTER_ALL), + ] + + +def CreatePlatformConfig(): + try: + return PlatformConfig('creator-ci20x11-gcc-4-9') + except RuntimeError as e: + logging.critical(e) + return None
diff --git a/src/starboard/creator/ci20x11/gcc/4.9/starboard_platform.gyp b/src/starboard/creator/ci20x11/gcc/4.9/starboard_platform.gyp new file mode 100644 index 0000000..71a6d38 --- /dev/null +++ b/src/starboard/creator/ci20x11/gcc/4.9/starboard_platform.gyp
@@ -0,0 +1,18 @@ +# Copyright 2016 Google Inc. 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. +{ + 'includes': [ + '../starboard_platform.gyp', + ], +}
diff --git a/src/starboard/creator/ci20x11/gcc/4.9/thread_types_public.h b/src/starboard/creator/ci20x11/gcc/4.9/thread_types_public.h new file mode 100644 index 0000000..34bd624 --- /dev/null +++ b/src/starboard/creator/ci20x11/gcc/4.9/thread_types_public.h
@@ -0,0 +1,20 @@ +// Copyright 2016 Google Inc. 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. + +#ifndef STARBOARD_CREATOR_CI20X11_GCC_4_9_THREAD_TYPES_PUBLIC_H_ +#define STARBOARD_CREATOR_CI20X11_GCC_4_9_THREAD_TYPES_PUBLIC_H_ + +#include "starboard/linux/shared/thread_types_public.h" + +#endif // STARBOARD_CREATOR_CI20X11_GCC_4_9_THREAD_TYPES_PUBLIC_H_
diff --git a/src/starboard/creator/ci20x11/gcc/gyp_configuration.gypi b/src/starboard/creator/ci20x11/gcc/gyp_configuration.gypi new file mode 100644 index 0000000..6fe92c5 --- /dev/null +++ b/src/starboard/creator/ci20x11/gcc/gyp_configuration.gypi
@@ -0,0 +1,23 @@ +# Copyright 2016 Google Inc. 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. + +{ + 'variables': { + + }, + 'includes': [ + '../libraries.gypi', + '../../shared/gyp_configuration.gypi', + ], +}
diff --git a/src/starboard/creator/ci20x11/gcc/starboard_platform.gyp b/src/starboard/creator/ci20x11/gcc/starboard_platform.gyp new file mode 100644 index 0000000..71a6d38 --- /dev/null +++ b/src/starboard/creator/ci20x11/gcc/starboard_platform.gyp
@@ -0,0 +1,18 @@ +# Copyright 2016 Google Inc. 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. +{ + 'includes': [ + '../starboard_platform.gyp', + ], +}
diff --git a/src/starboard/creator/ci20x11/gyp_configuration.gypi b/src/starboard/creator/ci20x11/gyp_configuration.gypi new file mode 100644 index 0000000..312333e --- /dev/null +++ b/src/starboard/creator/ci20x11/gyp_configuration.gypi
@@ -0,0 +1,38 @@ +# Copyright 2016 Google Inc. 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. + +{ + 'target_defaults': { + 'default_configuration': 'creator-ci20x11_debug', + 'configurations': { + 'creator-ci20x11_debug': { + 'inherit_from': ['debug_base'], + }, + 'creator-ci20x11_devel': { + 'inherit_from': ['devel_base'], + }, + 'creator-ci20x11_qa': { + 'inherit_from': ['qa_base'], + }, + 'creator-ci20x11_gold': { + 'inherit_from': ['gold_base'], + }, + }, # end of configurations + }, + + 'includes': [ + 'libraries.gypi', + '../shared/gyp_configuration.gypi', + ], +}
diff --git a/src/starboard/creator/ci20x11/gyp_configuration.py b/src/starboard/creator/ci20x11/gyp_configuration.py new file mode 100644 index 0000000..3d62ed8 --- /dev/null +++ b/src/starboard/creator/ci20x11/gyp_configuration.py
@@ -0,0 +1,90 @@ +# Copyright 2016 Google Inc. 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. +"""Starboard Creator Ci20 X11 platform configuration for gyp_cobalt.""" + +import logging +import os +import sys + +# Import the shared Creator platform configuration. +from starboard.creator.shared import gyp_configuration +from starboard.tools.testing import test_filter + +class PlatformConfig(gyp_configuration.PlatformConfig): + + def __init__(self, platform): + super(PlatformConfig, self).__init__(platform) + + def GetTestFilters(self): + """Gets all tests to be excluded from a unit test run. + + Returns: + A list of initialized TestFilter objects. + """ + return [ + # test is disabled on x64 + test_filter.TestFilter( + 'bindings_test', ('GlobalInterfaceBindingsTest.' + 'PropertiesAndOperationsAreOwnProperties')), + # tests sometimes miss the defined delay + test_filter.TestFilter( + 'nplb', 'SbConditionVariableWaitTimedTest.SunnyDay'), + test_filter.TestFilter( + 'nplb', 'SbConditionVariableWaitTimedTest.SunnyDayAutoInit'), + # tests sometimes miss the threshold of 10ms + test_filter.TestFilter( + 'nplb', 'Semaphore.ThreadTakesWait_PutBeforeTimeExpires'), + test_filter.TestFilter( + 'nplb', 'RWLock.HoldsLockForTime'), + # tests sometimes miss the threshold of 5ms + test_filter.TestFilter( + 'nplb', 'Semaphore.ThreadTakesWait_TimeExpires'), + test_filter.TestFilter( + 'nplb', 'SbWindowCreateTest.SunnyDayDefault'), + test_filter.TestFilter( + 'nplb', 'SbWindowCreateTest.SunnyDayDefaultSet'), + test_filter.TestFilter( + 'nplb', 'SbWindowGetPlatformHandleTest.SunnyDay'), + test_filter.TestFilter( + 'nplb', 'SbWindowGetSizeTest.SunnyDay'), + test_filter.TestFilter( + 'nplb', 'SbPlayerTest.SunnyDay'), + # tests fail also on x86 + test_filter.TestFilter( + 'nplb', 'SbSocketAddressTypes/SbSocketGetInterfaceAddressTest.SunnyDayDestination/1'), + test_filter.TestFilter( + 'nplb', 'SbSocketAddressTypes/SbSocketGetInterfaceAddressTest.SunnyDaySourceForDestination/1'), + test_filter.TestFilter( + 'nplb', 'SbSocketAddressTypes/SbSocketGetInterfaceAddressTest.SunnyDaySourceNotLoopback/1'), + # there are no test cases in this test + test_filter.TestFilter( + 'starboard_platform_tests', test_filter.FILTER_ALL), + # there are no test cases in this test + test_filter.TestFilter( + 'nplb_blitter_pixel_tests', test_filter.FILTER_ALL), + # test fails on x64 also + test_filter.TestFilter( + 'net_unittests', 'HostResolverImplDnsTest.DnsTaskUnspec'), + # we don't have proper procedure for running this test + test_filter.TestFilter( + 'web_platform_tests', test_filter.FILTER_ALL), + ] + + +def CreatePlatformConfig(): + try: + return PlatformConfig("creator-ci20x11") + except RuntimeError as e: + logging.critical(e) + return None
diff --git a/src/starboard/creator/ci20x11/libraries.gypi b/src/starboard/creator/ci20x11/libraries.gypi new file mode 100644 index 0000000..60a0f7e --- /dev/null +++ b/src/starboard/creator/ci20x11/libraries.gypi
@@ -0,0 +1,26 @@ +# Copyright 2014 Google Inc. 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. + +{ + 'variables': { + 'platform_libraries': [ + '-lEGL', + '-lGLESv2', + '-lX11', + '-lXcomposite', + '-lXext', + '-lXrender', + ], + }, +}
diff --git a/src/starboard/creator/ci20x11/main.cc b/src/starboard/creator/ci20x11/main.cc new file mode 100644 index 0000000..7086895 --- /dev/null +++ b/src/starboard/creator/ci20x11/main.cc
@@ -0,0 +1,29 @@ +// Copyright 2016 Google Inc. 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. + +#include "starboard/configuration.h" +#include "starboard/shared/signal/crash_signals.h" +#include "starboard/shared/signal/suspend_signals.h" +#include "starboard/shared/x11/application_x11.h" + +extern "C" SB_EXPORT_PLATFORM int main(int argc, char** argv) { + tzset(); + starboard::shared::signal::InstallCrashSignalHandlers(); + starboard::shared::signal::InstallSuspendSignalHandlers(); + starboard::shared::x11::ApplicationX11 application; + int result = application.Run(argc, argv); + starboard::shared::signal::UninstallSuspendSignalHandlers(); + starboard::shared::signal::UninstallCrashSignalHandlers(); + return result; +}
diff --git a/src/starboard/creator/ci20x11/starboard_platform.gyp b/src/starboard/creator/ci20x11/starboard_platform.gyp new file mode 100644 index 0000000..c1e7eb0 --- /dev/null +++ b/src/starboard/creator/ci20x11/starboard_platform.gyp
@@ -0,0 +1,360 @@ +# Copyright 2016 Google Inc. 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. +{ + 'targets': [ + { + 'target_name': 'starboard_base_symbolize', + 'type': 'static_library', + 'sources': [ + '<(DEPTH)/base/third_party/symbolize/demangle.cc', + '<(DEPTH)/base/third_party/symbolize/symbolize.cc', + ], + }, + { + 'target_name': 'starboard_platform', + 'type': 'static_library', + 'sources': [ + '<(DEPTH)/starboard/creator/ci20x11/atomic_public.h', + '<(DEPTH)/starboard/creator/ci20x11/configuration_public.h', + '<(DEPTH)/starboard/creator/ci20x11/main.cc', + '<(DEPTH)/starboard/creator/ci20x11/system_get_property.cc', + '<(DEPTH)/starboard/creator/shared/player_components_impl.cc', + '<(DEPTH)/starboard/linux/shared/atomic_public.h', + '<(DEPTH)/starboard/linux/shared/decode_target_internal.h', + '<(DEPTH)/starboard/linux/shared/decode_target_internal.cc', + '<(DEPTH)/starboard/linux/shared/system_get_connection_type.cc', + '<(DEPTH)/starboard/linux/shared/system_get_device_type.cc', + '<(DEPTH)/starboard/linux/shared/system_get_path.cc', + '<(DEPTH)/starboard/linux/shared/system_has_capability.cc', + '<(DEPTH)/starboard/shared/alsa/alsa_audio_sink_type.cc', + '<(DEPTH)/starboard/shared/alsa/alsa_audio_sink_type.h', + '<(DEPTH)/starboard/shared/alsa/alsa_util.cc', + '<(DEPTH)/starboard/shared/alsa/alsa_util.h', + '<(DEPTH)/starboard/shared/alsa/audio_sink_get_max_channels.cc', + '<(DEPTH)/starboard/shared/alsa/audio_sink_get_nearest_supported_sample_frequency.cc', + '<(DEPTH)/starboard/shared/alsa/audio_sink_is_audio_frame_storage_type_supported.cc', + '<(DEPTH)/starboard/shared/alsa/audio_sink_is_audio_sample_type_supported.cc', + '<(DEPTH)/starboard/shared/dlmalloc/memory_allocate_aligned_unchecked.cc', + '<(DEPTH)/starboard/shared/dlmalloc/memory_allocate_unchecked.cc', + '<(DEPTH)/starboard/shared/dlmalloc/memory_free.cc', + '<(DEPTH)/starboard/shared/dlmalloc/memory_free_aligned.cc', + '<(DEPTH)/starboard/shared/dlmalloc/memory_map.cc', + '<(DEPTH)/starboard/shared/dlmalloc/memory_reallocate_unchecked.cc', + '<(DEPTH)/starboard/shared/dlmalloc/memory_unmap.cc', + '<(DEPTH)/starboard/shared/ffmpeg/ffmpeg_audio_decoder.cc', + '<(DEPTH)/starboard/shared/ffmpeg/ffmpeg_audio_decoder.h', + '<(DEPTH)/starboard/shared/ffmpeg/ffmpeg_audio_resampler.cc', + '<(DEPTH)/starboard/shared/ffmpeg/ffmpeg_audio_resampler.h', + '<(DEPTH)/starboard/shared/ffmpeg/ffmpeg_common.cc', + '<(DEPTH)/starboard/shared/ffmpeg/ffmpeg_common.h', + '<(DEPTH)/starboard/shared/ffmpeg/ffmpeg_video_decoder.cc', + '<(DEPTH)/starboard/shared/ffmpeg/ffmpeg_video_decoder.h', + '<(DEPTH)/starboard/shared/gcc/atomic_gcc_public.h', + '<(DEPTH)/starboard/shared/iso/character_is_alphanumeric.cc', + '<(DEPTH)/starboard/shared/iso/character_is_digit.cc', + '<(DEPTH)/starboard/shared/iso/character_is_hex_digit.cc', + '<(DEPTH)/starboard/shared/iso/character_is_space.cc', + '<(DEPTH)/starboard/shared/iso/character_is_upper.cc', + '<(DEPTH)/starboard/shared/iso/character_to_lower.cc', + '<(DEPTH)/starboard/shared/iso/character_to_upper.cc', + '<(DEPTH)/starboard/shared/iso/directory_close.cc', + '<(DEPTH)/starboard/shared/iso/directory_get_next.cc', + '<(DEPTH)/starboard/shared/iso/directory_open.cc', + '<(DEPTH)/starboard/shared/iso/double_absolute.cc', + '<(DEPTH)/starboard/shared/iso/double_exponent.cc', + '<(DEPTH)/starboard/shared/iso/double_floor.cc', + '<(DEPTH)/starboard/shared/iso/double_is_finite.cc', + '<(DEPTH)/starboard/shared/iso/double_is_nan.cc', + '<(DEPTH)/starboard/shared/iso/memory_compare.cc', + '<(DEPTH)/starboard/shared/iso/memory_copy.cc', + '<(DEPTH)/starboard/shared/iso/memory_find_byte.cc', + '<(DEPTH)/starboard/shared/iso/memory_move.cc', + '<(DEPTH)/starboard/shared/iso/memory_set.cc', + '<(DEPTH)/starboard/shared/iso/string_compare.cc', + '<(DEPTH)/starboard/shared/iso/string_compare_all.cc', + '<(DEPTH)/starboard/shared/iso/string_find_character.cc', + '<(DEPTH)/starboard/shared/iso/string_find_last_character.cc', + '<(DEPTH)/starboard/shared/iso/string_find_string.cc', + '<(DEPTH)/starboard/shared/iso/string_get_length.cc', + '<(DEPTH)/starboard/shared/iso/string_get_length_wide.cc', + '<(DEPTH)/starboard/shared/iso/string_parse_double.cc', + '<(DEPTH)/starboard/shared/iso/string_parse_signed_integer.cc', + '<(DEPTH)/starboard/shared/iso/string_parse_uint64.cc', + '<(DEPTH)/starboard/shared/iso/string_parse_unsigned_integer.cc', + '<(DEPTH)/starboard/shared/iso/string_scan.cc', + '<(DEPTH)/starboard/shared/iso/system_binary_search.cc', + '<(DEPTH)/starboard/shared/iso/system_sort.cc', + '<(DEPTH)/starboard/shared/libevent/socket_waiter_add.cc', + '<(DEPTH)/starboard/shared/libevent/socket_waiter_create.cc', + '<(DEPTH)/starboard/shared/libevent/socket_waiter_destroy.cc', + '<(DEPTH)/starboard/shared/libevent/socket_waiter_internal.cc', + '<(DEPTH)/starboard/shared/libevent/socket_waiter_remove.cc', + '<(DEPTH)/starboard/shared/libevent/socket_waiter_wait.cc', + '<(DEPTH)/starboard/shared/libevent/socket_waiter_wait_timed.cc', + '<(DEPTH)/starboard/shared/libevent/socket_waiter_wake_up.cc', + '<(DEPTH)/starboard/shared/linux/byte_swap.cc', + '<(DEPTH)/starboard/shared/linux/get_home_directory.cc', + '<(DEPTH)/starboard/shared/linux/dev_input/dev_input.cc', + '<(DEPTH)/starboard/shared/linux/memory_get_stack_bounds.cc', + '<(DEPTH)/starboard/shared/linux/page_internal.cc', + '<(DEPTH)/starboard/shared/linux/socket_get_interface_address.cc', + '<(DEPTH)/starboard/shared/linux/system_get_random_data.cc', + '<(DEPTH)/starboard/shared/linux/system_get_stack.cc', + '<(DEPTH)/starboard/shared/linux/system_get_total_cpu_memory.cc', + '<(DEPTH)/starboard/shared/linux/system_get_used_cpu_memory.cc', + '<(DEPTH)/starboard/shared/linux/system_is_debugger_attached.cc', + '<(DEPTH)/starboard/shared/linux/system_symbolize.cc', + '<(DEPTH)/starboard/shared/linux/thread_get_id.cc', + '<(DEPTH)/starboard/shared/linux/thread_get_name.cc', + '<(DEPTH)/starboard/shared/linux/thread_set_name.cc', + '<(DEPTH)/starboard/shared/nouser/user_get_current.cc', + '<(DEPTH)/starboard/shared/nouser/user_get_property.cc', + '<(DEPTH)/starboard/shared/nouser/user_get_signed_in.cc', + '<(DEPTH)/starboard/shared/nouser/user_internal.cc', + '<(DEPTH)/starboard/shared/posix/directory_create.cc', + '<(DEPTH)/starboard/shared/posix/file_can_open.cc', + '<(DEPTH)/starboard/shared/posix/file_close.cc', + '<(DEPTH)/starboard/shared/posix/file_delete.cc', + '<(DEPTH)/starboard/shared/posix/file_exists.cc', + '<(DEPTH)/starboard/shared/posix/file_flush.cc', + '<(DEPTH)/starboard/shared/posix/file_get_info.cc', + '<(DEPTH)/starboard/shared/posix/file_get_path_info.cc', + '<(DEPTH)/starboard/shared/posix/file_open.cc', + '<(DEPTH)/starboard/shared/posix/file_read.cc', + '<(DEPTH)/starboard/shared/posix/file_seek.cc', + '<(DEPTH)/starboard/shared/posix/file_truncate.cc', + '<(DEPTH)/starboard/shared/posix/file_write.cc', + '<(DEPTH)/starboard/shared/posix/log.cc', + '<(DEPTH)/starboard/shared/posix/log_flush.cc', + '<(DEPTH)/starboard/shared/posix/log_format.cc', + '<(DEPTH)/starboard/shared/posix/log_is_tty.cc', + '<(DEPTH)/starboard/shared/posix/log_raw.cc', + '<(DEPTH)/starboard/shared/posix/memory_flush.cc', + '<(DEPTH)/starboard/shared/posix/set_non_blocking_internal.cc', + '<(DEPTH)/starboard/shared/posix/socket_accept.cc', + '<(DEPTH)/starboard/shared/posix/socket_bind.cc', + '<(DEPTH)/starboard/shared/posix/socket_clear_last_error.cc', + '<(DEPTH)/starboard/shared/posix/socket_connect.cc', + '<(DEPTH)/starboard/shared/posix/socket_create.cc', + '<(DEPTH)/starboard/shared/posix/socket_destroy.cc', + '<(DEPTH)/starboard/shared/posix/socket_free_resolution.cc', + '<(DEPTH)/starboard/shared/posix/socket_get_last_error.cc', + '<(DEPTH)/starboard/shared/posix/socket_get_local_address.cc', + '<(DEPTH)/starboard/shared/posix/socket_internal.cc', + '<(DEPTH)/starboard/shared/posix/socket_is_connected.cc', + '<(DEPTH)/starboard/shared/posix/socket_is_connected_and_idle.cc', + '<(DEPTH)/starboard/shared/posix/socket_join_multicast_group.cc', + '<(DEPTH)/starboard/shared/posix/socket_listen.cc', + '<(DEPTH)/starboard/shared/posix/socket_receive_from.cc', + '<(DEPTH)/starboard/shared/posix/socket_resolve.cc', + '<(DEPTH)/starboard/shared/posix/socket_send_to.cc', + '<(DEPTH)/starboard/shared/posix/socket_set_broadcast.cc', + '<(DEPTH)/starboard/shared/posix/socket_set_receive_buffer_size.cc', + '<(DEPTH)/starboard/shared/posix/socket_set_reuse_address.cc', + '<(DEPTH)/starboard/shared/posix/socket_set_send_buffer_size.cc', + '<(DEPTH)/starboard/shared/posix/socket_set_tcp_keep_alive.cc', + '<(DEPTH)/starboard/shared/posix/socket_set_tcp_no_delay.cc', + '<(DEPTH)/starboard/shared/posix/socket_set_tcp_window_scaling.cc', + '<(DEPTH)/starboard/shared/posix/string_compare_no_case.cc', + '<(DEPTH)/starboard/shared/posix/string_compare_no_case_n.cc', + '<(DEPTH)/starboard/shared/posix/string_compare_wide.cc', + '<(DEPTH)/starboard/shared/posix/string_format.cc', + '<(DEPTH)/starboard/shared/posix/string_format_wide.cc', + '<(DEPTH)/starboard/shared/posix/system_break_into_debugger.cc', + '<(DEPTH)/starboard/shared/posix/system_clear_last_error.cc', + '<(DEPTH)/starboard/shared/posix/system_get_error_string.cc', + '<(DEPTH)/starboard/shared/posix/system_get_last_error.cc', + '<(DEPTH)/starboard/shared/posix/system_get_locale_id.cc', + '<(DEPTH)/starboard/shared/posix/system_get_number_of_processors.cc', + '<(DEPTH)/starboard/shared/posix/thread_sleep.cc', + '<(DEPTH)/starboard/shared/posix/time_get_monotonic_now.cc', + '<(DEPTH)/starboard/shared/posix/time_get_monotonic_thread_now.cc', + '<(DEPTH)/starboard/shared/posix/time_get_now.cc', + '<(DEPTH)/starboard/shared/posix/time_zone_get_current.cc', + '<(DEPTH)/starboard/shared/posix/time_zone_get_dst_name.cc', + '<(DEPTH)/starboard/shared/posix/time_zone_get_name.cc', + '<(DEPTH)/starboard/shared/pthread/condition_variable_broadcast.cc', + '<(DEPTH)/starboard/shared/pthread/condition_variable_create.cc', + '<(DEPTH)/starboard/shared/pthread/condition_variable_destroy.cc', + '<(DEPTH)/starboard/shared/pthread/condition_variable_signal.cc', + '<(DEPTH)/starboard/shared/pthread/condition_variable_wait.cc', + '<(DEPTH)/starboard/shared/pthread/condition_variable_wait_timed.cc', + '<(DEPTH)/starboard/shared/pthread/mutex_acquire.cc', + '<(DEPTH)/starboard/shared/pthread/mutex_acquire_try.cc', + '<(DEPTH)/starboard/shared/pthread/mutex_create.cc', + '<(DEPTH)/starboard/shared/pthread/mutex_destroy.cc', + '<(DEPTH)/starboard/shared/pthread/mutex_release.cc', + '<(DEPTH)/starboard/shared/pthread/once.cc', + '<(DEPTH)/starboard/shared/pthread/thread_create.cc', + '<(DEPTH)/starboard/shared/pthread/thread_create_local_key.cc', + '<(DEPTH)/starboard/shared/pthread/thread_create_priority.h', + '<(DEPTH)/starboard/shared/pthread/thread_destroy_local_key.cc', + '<(DEPTH)/starboard/shared/pthread/thread_detach.cc', + '<(DEPTH)/starboard/shared/pthread/thread_get_current.cc', + '<(DEPTH)/starboard/shared/pthread/thread_get_local_value.cc', + '<(DEPTH)/starboard/shared/pthread/thread_is_equal.cc', + '<(DEPTH)/starboard/shared/pthread/thread_join.cc', + '<(DEPTH)/starboard/shared/pthread/thread_set_local_value.cc', + '<(DEPTH)/starboard/shared/pthread/thread_yield.cc', + '<(DEPTH)/starboard/shared/signal/crash_signals.h', + '<(DEPTH)/starboard/shared/signal/crash_signals_sigaction.cc', + '<(DEPTH)/starboard/shared/signal/suspend_signals.cc', + '<(DEPTH)/starboard/shared/signal/suspend_signals.h', + '<(DEPTH)/starboard/shared/starboard/application.cc', + '<(DEPTH)/starboard/shared/starboard/command_line.cc', + '<(DEPTH)/starboard/shared/starboard/command_line.h', + '<(DEPTH)/starboard/shared/starboard/audio_sink/audio_sink_create.cc', + '<(DEPTH)/starboard/shared/starboard/audio_sink/audio_sink_destroy.cc', + '<(DEPTH)/starboard/shared/starboard/audio_sink/audio_sink_internal.cc', + '<(DEPTH)/starboard/shared/starboard/audio_sink/audio_sink_internal.h', + '<(DEPTH)/starboard/shared/starboard/audio_sink/audio_sink_is_valid.cc', + '<(DEPTH)/starboard/shared/starboard/audio_sink/stub_audio_sink_type.cc', + '<(DEPTH)/starboard/shared/starboard/audio_sink/stub_audio_sink_type.h', + '<(DEPTH)/starboard/shared/starboard/directory_can_open.cc', + '<(DEPTH)/starboard/shared/starboard/event_cancel.cc', + '<(DEPTH)/starboard/shared/starboard/event_schedule.cc', + '<(DEPTH)/starboard/shared/starboard/file_mode_string_to_flags.cc', + '<(DEPTH)/starboard/shared/starboard/file_storage/storage_close_record.cc', + '<(DEPTH)/starboard/shared/starboard/file_storage/storage_delete_record.cc', + '<(DEPTH)/starboard/shared/starboard/file_storage/storage_get_record_size.cc', + '<(DEPTH)/starboard/shared/starboard/file_storage/storage_open_record.cc', + '<(DEPTH)/starboard/shared/starboard/file_storage/storage_read_record.cc', + '<(DEPTH)/starboard/shared/starboard/file_storage/storage_write_record.cc', + '<(DEPTH)/starboard/shared/starboard/log_message.cc', + '<(DEPTH)/starboard/shared/starboard/log_raw_dump_stack.cc', + '<(DEPTH)/starboard/shared/starboard/log_raw_format.cc', + '<(DEPTH)/starboard/shared/starboard/media/codec_util.cc', + '<(DEPTH)/starboard/shared/starboard/media/codec_util.h', + '<(DEPTH)/starboard/shared/starboard/media/media_can_play_mime_and_key_system.cc', + '<(DEPTH)/starboard/shared/starboard/media/media_get_audio_configuration_stereo_only.cc', + '<(DEPTH)/starboard/shared/starboard/media/media_get_audio_output_count_stereo_only.cc', + '<(DEPTH)/starboard/shared/starboard/media/media_is_audio_supported_aac_only.cc', + '<(DEPTH)/starboard/shared/starboard/media/media_is_output_protected.cc', + '<(DEPTH)/starboard/shared/starboard/media/media_is_video_supported_h264_1080p_sfr_only.cc', + '<(DEPTH)/starboard/shared/starboard/media/media_set_output_protection.cc', + '<(DEPTH)/starboard/shared/starboard/media/media_util.cc', + '<(DEPTH)/starboard/shared/starboard/media/media_util.h', + '<(DEPTH)/starboard/shared/starboard/media/mime_type.cc', + '<(DEPTH)/starboard/shared/starboard/media/mime_type.h', + '<(DEPTH)/starboard/shared/starboard/media/codec_util.cc', + '<(DEPTH)/starboard/shared/starboard/media/codec_util.h', + '<(DEPTH)/starboard/shared/starboard/media/media_can_play_mime_and_key_system.cc', + '<(DEPTH)/starboard/shared/starboard/media/media_is_output_protected.cc', + '<(DEPTH)/starboard/shared/starboard/media/media_set_output_protection.cc', + '<(DEPTH)/starboard/shared/starboard/media/mime_type.cc', + '<(DEPTH)/starboard/shared/starboard/media/mime_type.h', + '<(DEPTH)/starboard/shared/starboard/new.cc', + '<(DEPTH)/starboard/shared/starboard/player/decoded_audio_internal.cc', + '<(DEPTH)/starboard/shared/starboard/player/decoded_audio_internal.h', + '<(DEPTH)/starboard/shared/starboard/player/filter/audio_decoder_internal.h', + '<(DEPTH)/starboard/shared/starboard/player/filter/audio_frame_tracker.cc', + '<(DEPTH)/starboard/shared/starboard/player/filter/audio_frame_tracker.h', + '<(DEPTH)/starboard/shared/starboard/player/filter/audio_time_stretcher.h', + '<(DEPTH)/starboard/shared/starboard/player/filter/audio_time_stretcher.cc', + '<(DEPTH)/starboard/shared/starboard/player/filter/audio_renderer_impl_internal.cc', + '<(DEPTH)/starboard/shared/starboard/player/filter/audio_renderer_impl_internal.h', + '<(DEPTH)/starboard/shared/starboard/player/filter/audio_renderer_internal.h', + '<(DEPTH)/starboard/shared/starboard/player/filter/audio_renderer_sink.h', + '<(DEPTH)/starboard/shared/starboard/player/filter/audio_renderer_sink_impl.cc', + '<(DEPTH)/starboard/shared/starboard/player/filter/audio_renderer_sink_impl.h', + '<(DEPTH)/starboard/shared/starboard/player/filter/decoded_audio_queue.h', + '<(DEPTH)/starboard/shared/starboard/player/filter/decoded_audio_queue.cc', + '<(DEPTH)/starboard/shared/starboard/player/filter/filter_based_player_worker_handler.cc', + '<(DEPTH)/starboard/shared/starboard/player/filter/filter_based_player_worker_handler.h', + '<(DEPTH)/starboard/shared/starboard/player/filter/player_components.h', + '<(DEPTH)/starboard/shared/starboard/player/filter/video_decoder_internal.h', + '<(DEPTH)/starboard/shared/starboard/player/filter/video_renderer_impl_internal.cc', + '<(DEPTH)/starboard/shared/starboard/player/filter/video_renderer_impl_internal.h', + '<(DEPTH)/starboard/shared/starboard/player/filter/video_renderer_internal.h', + '<(DEPTH)/starboard/shared/starboard/player/filter/wsola_internal.h', + '<(DEPTH)/starboard/shared/starboard/player/filter/wsola_internal.cc', + '<(DEPTH)/starboard/shared/starboard/player/input_buffer_internal.cc', + '<(DEPTH)/starboard/shared/starboard/player/input_buffer_internal.h', + '<(DEPTH)/starboard/shared/starboard/player/job_queue.cc', + '<(DEPTH)/starboard/shared/starboard/player/job_queue.h', + '<(DEPTH)/starboard/shared/starboard/player/player_create.cc', + '<(DEPTH)/starboard/shared/starboard/player/player_destroy.cc', + '<(DEPTH)/starboard/shared/starboard/player/player_get_current_frame.cc', + '<(DEPTH)/starboard/shared/starboard/player/player_get_info.cc', + '<(DEPTH)/starboard/shared/starboard/player/player_output_mode_supported.cc', + '<(DEPTH)/starboard/shared/starboard/player/player_internal.cc', + '<(DEPTH)/starboard/shared/starboard/player/player_internal.h', + '<(DEPTH)/starboard/shared/starboard/player/player_seek.cc', + '<(DEPTH)/starboard/shared/starboard/player/player_set_bounds.cc', + '<(DEPTH)/starboard/shared/starboard/player/player_set_playback_rate.cc', + '<(DEPTH)/starboard/shared/starboard/player/player_set_volume.cc', + '<(DEPTH)/starboard/shared/starboard/player/player_worker.cc', + '<(DEPTH)/starboard/shared/starboard/player/player_worker.h', + '<(DEPTH)/starboard/shared/starboard/player/player_write_end_of_stream.cc', + '<(DEPTH)/starboard/shared/starboard/player/player_write_sample.cc', + '<(DEPTH)/starboard/shared/starboard/player/video_frame_internal.cc', + '<(DEPTH)/starboard/shared/starboard/player/video_frame_internal.h', + '<(DEPTH)/starboard/shared/starboard/queue_application.cc', + '<(DEPTH)/starboard/shared/starboard/string_concat.cc', + '<(DEPTH)/starboard/shared/starboard/string_concat_wide.cc', + '<(DEPTH)/starboard/shared/starboard/string_copy.cc', + '<(DEPTH)/starboard/shared/starboard/string_copy_wide.cc', + '<(DEPTH)/starboard/shared/starboard/string_duplicate.cc', + '<(DEPTH)/starboard/shared/starboard/system_get_random_uint64.cc', + '<(DEPTH)/starboard/shared/starboard/system_request_pause.cc', + '<(DEPTH)/starboard/shared/starboard/system_request_stop.cc', + '<(DEPTH)/starboard/shared/starboard/system_request_suspend.cc', + '<(DEPTH)/starboard/shared/starboard/system_request_unpause.cc', + '<(DEPTH)/starboard/shared/starboard/window_set_default_options.cc', + '<(DEPTH)/starboard/shared/stub/accessibility_get_display_settings.cc', + '<(DEPTH)/starboard/shared/stub/accessibility_get_text_to_speech_settings.cc', + '<(DEPTH)/starboard/shared/stub/cryptography_create_transformer.cc', + '<(DEPTH)/starboard/shared/stub/cryptography_destroy_transformer.cc', + '<(DEPTH)/starboard/shared/stub/cryptography_get_tag.cc', + '<(DEPTH)/starboard/shared/stub/cryptography_set_authenticated_data.cc', + '<(DEPTH)/starboard/shared/stub/cryptography_set_initialization_vector.cc', + '<(DEPTH)/starboard/shared/stub/cryptography_transform.cc', + '<(DEPTH)/starboard/shared/stub/decode_target_get_info.cc', + '<(DEPTH)/starboard/shared/stub/decode_target_release.cc', + '<(DEPTH)/starboard/shared/stub/drm_close_session.cc', + '<(DEPTH)/starboard/shared/stub/drm_create_system.cc', + '<(DEPTH)/starboard/shared/stub/drm_destroy_system.cc', + '<(DEPTH)/starboard/shared/stub/drm_generate_session_update_request.cc', + '<(DEPTH)/starboard/shared/stub/drm_system_internal.h', + '<(DEPTH)/starboard/shared/stub/drm_update_session.cc', + '<(DEPTH)/starboard/shared/stub/image_decode.cc', + '<(DEPTH)/starboard/shared/stub/image_is_decode_supported.cc', + '<(DEPTH)/starboard/shared/stub/media_is_supported.cc', + '<(DEPTH)/starboard/shared/stub/media_is_transfer_characteristics_supported.cc', + '<(DEPTH)/starboard/shared/stub/system_clear_platform_error.cc', + '<(DEPTH)/starboard/shared/stub/system_get_total_gpu_memory.cc', + '<(DEPTH)/starboard/shared/stub/system_get_used_gpu_memory.cc', + '<(DEPTH)/starboard/shared/stub/system_hide_splash_screen.cc', + '<(DEPTH)/starboard/shared/stub/system_raise_platform_error.cc', + '<(DEPTH)/starboard/shared/x11/application_x11.cc', + '<(DEPTH)/starboard/shared/x11/window_create.cc', + '<(DEPTH)/starboard/shared/x11/window_destroy.cc', + '<(DEPTH)/starboard/shared/x11/window_get_platform_handle.cc', + '<(DEPTH)/starboard/shared/x11/window_get_size.cc', + '<(DEPTH)/starboard/shared/x11/window_internal.cc', + ], + 'defines': [ + # This must be defined when building Starboard, and must not when + # building Starboard client code. + 'STARBOARD_IMPLEMENTATION', + ], + 'dependencies': [ + '<(DEPTH)/starboard/common/common.gyp:common', + '<(DEPTH)/third_party/dlmalloc/dlmalloc.gyp:dlmalloc', + '<(DEPTH)/third_party/libevent/libevent.gyp:libevent', + 'starboard_base_symbolize', + ], + }, + ], +}
diff --git a/src/starboard/creator/ci20x11/system_get_property.cc b/src/starboard/creator/ci20x11/system_get_property.cc new file mode 100644 index 0000000..35aba8b --- /dev/null +++ b/src/starboard/creator/ci20x11/system_get_property.cc
@@ -0,0 +1,70 @@ +// Copyright 2016 Google Inc. 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. + +#include "starboard/system.h" + +#include "starboard/log.h" +#include "starboard/string.h" + +namespace { + +const char kFriendlyName[] = "Creator Ci20"; +const char kPlatformName[] = "Creator Ci20 JZ4780"; + +bool CopyStringAndTestIfSuccess(char* out_value, + int value_length, + const char* from_value) { + if (SbStringGetLength(from_value) + 1 > value_length) + return false; + SbStringCopy(out_value, from_value, value_length); + return true; +} + +} // namespace + +bool SbSystemGetProperty(SbSystemPropertyId property_id, + char* out_value, + int value_length) { + if (!out_value || !value_length) { + return false; + } + + switch (property_id) { + case kSbSystemPropertyBrandName: + case kSbSystemPropertyChipsetModelNumber: + case kSbSystemPropertyFirmwareVersion: + case kSbSystemPropertyModelName: + case kSbSystemPropertyModelYear: + case kSbSystemPropertyNetworkOperatorName: + case kSbSystemPropertySpeechApiKey: + return false; + + case kSbSystemPropertyFriendlyName: + return CopyStringAndTestIfSuccess(out_value, value_length, kFriendlyName); + + case kSbSystemPropertyPlatformName: + return CopyStringAndTestIfSuccess(out_value, value_length, kPlatformName); + + case kSbSystemPropertyPlatformUuid: + SB_NOTIMPLEMENTED(); + return CopyStringAndTestIfSuccess(out_value, value_length, "N/A"); + + default: + SB_DLOG(WARNING) << __FUNCTION__ + << ": Unrecognized property: " << property_id; + break; + } + + return false; +}
diff --git a/src/starboard/creator/ci20x11/thread_types_public.h b/src/starboard/creator/ci20x11/thread_types_public.h new file mode 100644 index 0000000..7437a70 --- /dev/null +++ b/src/starboard/creator/ci20x11/thread_types_public.h
@@ -0,0 +1,20 @@ +// Copyright 2016 Google Inc. 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. + +#ifndef STARBOARD_CREATOR_CI20X11_THREAD_TYPES_PUBLIC_H_ +#define STARBOARD_CREATOR_CI20X11_THREAD_TYPES_PUBLIC_H_ + +#include "starboard/linux/shared/thread_types_public.h" + +#endif // STARBOARD_CREATOR_CI20X11_THREAD_TYPES_PUBLIC_H_
diff --git a/src/starboard/creator/shared/__init__.py b/src/starboard/creator/shared/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/starboard/creator/shared/__init__.py
diff --git a/src/starboard/creator/shared/configuration_public.h b/src/starboard/creator/shared/configuration_public.h new file mode 100644 index 0000000..9172529 --- /dev/null +++ b/src/starboard/creator/shared/configuration_public.h
@@ -0,0 +1,447 @@ +// Copyright 2016 Google Inc. 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. + +// The shared Starboard configuration for Creator devices. + +#ifndef STARBOARD_CREATOR_SHARED_CONFIGURATION_PUBLIC_H_ +#define STARBOARD_CREATOR_SHARED_CONFIGURATION_PUBLIC_H_ + +// --- Architecture Configuration -------------------------------------------- + +// Whether the current platform is big endian. SB_IS_LITTLE_ENDIAN will be +// automatically set based on this. +#define SB_IS_BIG_ENDIAN 0 + +// Whether the current platform is an ARM architecture. +#define SB_IS_ARCH_ARM 0 + +// Whether the current platform is a MIPS architecture. +#define SB_IS_ARCH_MIPS 1 + +// Whether the current platform is a PPC architecture. +#define SB_IS_ARCH_PPC 0 + +// Whether the current platform is an x86 architecture. +#define SB_IS_ARCH_X86 0 + +// Whether the current platform is a 32-bit architecture. +#define SB_IS_32_BIT 1 + +// Whether the current platform is a 64-bit architecture. +#define SB_IS_64_BIT 0 + +// Whether the current platform's pointers are 32-bit. +// Whether the current platform's longs are 32-bit. +#if SB_IS(32_BIT) +#define SB_HAS_32_BIT_POINTERS 1 +#define SB_HAS_32_BIT_LONG 1 +#else +#define SB_HAS_32_BIT_POINTERS 0 +#define SB_HAS_32_BIT_LONG 0 +#endif + +// Whether the current platform's pointers are 64-bit. +// Whether the current platform's longs are 64-bit. +#if SB_IS(64_BIT) +#define SB_HAS_64_BIT_POINTERS 1 +#define SB_HAS_64_BIT_LONG 1 +#else +#define SB_HAS_64_BIT_POINTERS 0 +#define SB_HAS_64_BIT_LONG 0 +#endif + +// Configuration parameters that allow the application to make some general +// compile-time decisions with respect to the the number of cores likely to be +// available on this platform. For a definitive measure, the application should +// still call SbSystemGetNumberOfProcessors at runtime. + +// Whether the current platform is expected to have many cores (> 6), or a +// wildly varying number of cores. +#define SB_HAS_MANY_CORES 0 + +// Whether the current platform is expected to have exactly 1 core. +#define SB_HAS_1_CORE 0 + +// Whether the current platform is expected to have exactly 2 cores. +#define SB_HAS_2_CORES 1 + +// Whether the current platform is expected to have exactly 4 cores. +#define SB_HAS_4_CORES 0 + +// Whether the current platform is expected to have exactly 6 cores. +#define SB_HAS_6_CORES 0 + +// 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. +#define SB_HAS_CROSS_CORE_SCHEDULER 1 + +// The API version implemented by this platform. +#define SB_API_VERSION 6 + +// CI20 platform with 1.14 version of SGX libraries does not support +// EGL_BIND_TO_TEXTURE_RGBA +#define SB_HAS_QUIRK_NO_EGL_BIND_TO_TEXTURE 1 + + +// --- System Header Configuration ------------------------------------------- + +// Any system headers listed here that are not provided by the platform will be +// emulated in starboard/types.h. + +// Whether the current platform provides the standard header stdarg.h. +#define SB_HAS_STDARG_H 1 + +// Whether the current platform provides the standard header stdbool.h. +#define SB_HAS_STDBOOL_H 1 + +// Whether the current platform provides the standard header stddef.h. +#define SB_HAS_STDDEF_H 1 + +// Whether the current platform provides the standard header stdint.h. +#define SB_HAS_STDINT_H 1 + +// Whether the current platform provides the standard header inttypes.h. +#define SB_HAS_INTTYPES_H 1 + +// Whether the current platform provides the standard header wchar.h. +#define SB_HAS_WCHAR_H 1 + +// Whether the current platform provides the standard header limits.h. +#define SB_HAS_LIMITS_H 1 + +// Whether the current platform provides the standard header float.h. +#define SB_HAS_FLOAT_H 1 + +// Whether the current platform provides ssize_t. +#define SB_HAS_SSIZE_T 1 + +// Whether the current platform has microphone supported. +#define SB_HAS_MICROPHONE 0 + +// Whether the current platform has speech recognizer. +#define SB_HAS_SPEECH_RECOGNIZER 0 + +// Whether the current platform has speech synthesis. +#define SB_HAS_SPEECH_SYNTHESIS 0 + +// Type detection for wchar_t. +#if defined(__WCHAR_MAX__) && \ + (__WCHAR_MAX__ == 0x7fffffff || __WCHAR_MAX__ == 0xffffffff) +#define SB_IS_WCHAR_T_UTF32 1 +#elif defined(__WCHAR_MAX__) && \ + (__WCHAR_MAX__ == 0x7fff || __WCHAR_MAX__ == 0xffff) +#define SB_IS_WCHAR_T_UTF16 1 +#endif + +// Chrome only defines these two if ARMEL or MIPSEL are defined. +#if defined(__ARMEL__) +// Chrome has an exclusion for iOS here, we should too when we support iOS. +#define SB_IS_WCHAR_T_UNSIGNED 1 +#elif defined(__MIPSEL__) +#define SB_IS_WCHAR_T_SIGNED 1 +#endif + +// --- Architecture Configuration -------------------------------------------- + +// On default Linux, you must be a superuser in order to set real time +// scheduling on threads. +#define SB_HAS_THREAD_PRIORITY_SUPPORT 0 + +// --- Compiler Configuration ------------------------------------------------ + +// The platform's annotation for forcing a C function to be inlined. +#define SB_C_FORCE_INLINE __inline__ __attribute__((always_inline)) + +// The platform's annotation for marking a C function as suggested to be +// inlined. +#define SB_C_INLINE inline + +// The platform's annotation for marking a C function as forcibly not +// inlined. +#define SB_C_NOINLINE __attribute__((noinline)) + +// The platform's annotation for marking a symbol as exported outside of the +// current shared library. +#define SB_EXPORT_PLATFORM __attribute__((visibility("default"))) + +// The platform's annotation for marking a symbol as imported from outside of +// the current linking unit. +#define SB_IMPORT_PLATFORM + +// --- Extensions Configuration ---------------------------------------------- + +// GCC/Clang doesn't define a long long hash function, except for Android and +// Game consoles. +#define SB_HAS_LONG_LONG_HASH 0 + +// GCC/Clang doesn't define a string hash function, except for Game Consoles. +#define SB_HAS_STRING_HASH 0 + +// Desktop Linux needs a using statement for the hash functions. +#define SB_HAS_HASH_USING 0 + +// 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(). +#define SB_HAS_HASH_VALUE 0 + +// Set this to 1 if use of hash_map or hash_set causes a deprecation warning +// (which then breaks the build). +#define SB_HAS_HASH_WARNING 1 + +// The location to include hash_map on this platform. +#define SB_HASH_MAP_INCLUDE <ext/hash_map> + +// C++'s hash_map and hash_set are often found in different namespaces depending +// on the compiler. +#define SB_HASH_NAMESPACE __gnu_cxx + +// The location to include hash_set on this platform. +#define SB_HASH_SET_INCLUDE <ext/hash_set> + +// Define this to how this platform copies varargs blocks. +#define SB_VA_COPY(dest, source) va_copy(dest, source) + +// --- Filesystem Configuration ---------------------------------------------- + +// The current platform's maximum length of the name of a single directory +// entry, not including the absolute path. +#define SB_FILE_MAX_NAME 64 + +// The current platform's maximum length of an absolute path. +#define SB_FILE_MAX_PATH 4096 + +// The current platform's maximum number of files that can be opened at the +// same time by one process. +#define SB_FILE_MAX_OPEN 256 + +// 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. +#define SB_FILE_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 '/'. +#define SB_FILE_ALT_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. +#define SB_PATH_SEP_CHAR ':' + +// The string form of SB_FILE_SEP_CHAR. +#define SB_FILE_SEP_STRING "/" + +// The string form of SB_FILE_ALT_SEP_CHAR. +#define SB_FILE_ALT_SEP_STRING "/" + +// The string form of SB_PATH_SEP_CHAR. +#define SB_PATH_SEP_STRING ":" + +// --- Memory Configuration -------------------------------------------------- + +// 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. +#define SB_MEMORY_PAGE_SIZE 4096 + +// Whether this platform has and should use an MMAP function to map physical +// memory to the virtual address space. +#define SB_HAS_MMAP 1 + +// Whether this platform can map executable memory. Implies SB_HAS_MMAP. This is +// required for platforms that want to JIT. +#define SB_CAN_MAP_EXECUTABLE_MEMORY 1 + +// Whether this platform has and should use an growable heap (e.g. with sbrk()) +// to map physical memory to the virtual address space. +#define SB_HAS_VIRTUAL_REGIONS 0 + +// 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. +#define SB_NETWORK_IO_BUFFER_ALIGNMENT 16 + +// Determines the alignment that allocations should have on this platform. +#define SB_MALLOC_ALIGNMENT ((size_t)16U) + +// Determines the threshhold of allocation size that should be done with mmap +// (if available), rather than allocated within the core heap. +#define SB_DEFAULT_MMAP_THRESHOLD ((size_t)(256 * 1024U)) + +// Defines the path where memory debugging logs should be written to. +#define SB_MEMORY_LOG_PATH "/tmp/starboard" + +// --- Thread Configuration -------------------------------------------------- + +// 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. +#define SB_MAX_THREADS 90 + +// The maximum number of thread local storage keys supported by this platform. +#define SB_MAX_THREAD_LOCAL_KEYS 512 + +// The maximum length of the name for a thread, including the NULL-terminator. +#define SB_MAX_THREAD_NAME_LENGTH 16; + +// --- Graphics Configuration ------------------------------------------------ + +// Specifies whether this platform supports a performant accelerated blitter +// API. The basic requirement is a scaled, clipped, alpha-blended blit. +#define SB_HAS_BLITTER 0 + +// 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. +#define SB_PREFERRED_RGBA_BYTE_ORDER SB_PREFERRED_RGBA_BYTE_ORDER_RGBA + +// 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. +#define SB_HAS_BILINEAR_FILTERING_SUPPORT 1 + +// Indicates whether or not the given platform supports rendering of NV12 +// textures. These textures typically originate from video decoders. +#define SB_HAS_NV12_TEXTURE_SUPPORT 1 + +// Whether the current platform should frequently flip their display buffer. +// If this is not required (e.g. SB_MUST_FREQUENTLY_FLIP_DISPLAY_BUFFER is set +// to 0), then optimizations where the display buffer is not flipped if the +// scene hasn't changed are enabled. +#define SB_MUST_FREQUENTLY_FLIP_DISPLAY_BUFFER 0 + +// --- Media Configuration --------------------------------------------------- + +// 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. +#define SB_HAS_PLAYER 1 + +#if SB_API_VERSION < 4 +// Specifies whether this platform's player will produce an OpenGL texture that +// the client must draw every frame with its graphics rendering. It may be that +// we get a texture handle, but cannot perform operations like GlReadPixels on +// it if it is DRM-protected. +#define SB_IS_PLAYER_PRODUCING_TEXTURE 0 + +// Specifies whether this platform's player is composited with a formal +// compositor, where the client must specify how video is to be composited into +// the graphicals scene. +#define SB_IS_PLAYER_COMPOSITED 0 + +// Specifies whether this platform's player uses a "punch-out" model, where +// video is rendered to the far background, and the graphics plane is +// automatically composited on top of the video by the platform. The client must +// punch an alpha hole out of the graphics plane for video to show through. In +// this case, changing the video bounds must be tightly synchronized between the +// player and the graphics plane. +#define SB_IS_PLAYER_PUNCHED_OUT 1 +#endif // SB_API_VERSION < 4 + +// 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. +#define SB_MEDIA_MAX_AUDIO_BITRATE_IN_BITS_PER_SECOND (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. +#define SB_MEDIA_MAX_VIDEO_BITRATE_IN_BITS_PER_SECOND (200 * 1024 * 1024) + +// Specifies whether this platform has webm/vp9 support. This should be set to +// non-zero on platforms with webm/vp9 support. +#define SB_HAS_MEDIA_WEBM_VP9_SUPPORT 0 + +// 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. +#define SB_MEDIA_THREAD_STACK_SIZE 0U + +// --- Decoder-only Params --- + +// Specifies how media buffers must be aligned on this platform as some +// decoders may have special requirement on the alignment of buffers being +// decoded. +#define SB_MEDIA_BUFFER_ALIGNMENT 128U + +// Specifies how video frame buffers must be aligned on this platform. +#define SB_MEDIA_VIDEO_FRAME_ALIGNMENT 256U + +// The encoded video frames are compressed in different ways, 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 the following two macros. +// +// Specify the number of video frames to be cached before the playback starts. +// Note that set this value too large may increase the playback start delay. +#define SB_MEDIA_MAXIMUM_VIDEO_PREROLL_FRAMES 4 + +// 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. +#define SB_MEDIA_MAXIMUM_VIDEO_FRAMES 12 + +// --- Network Configuration ------------------------------------------------- + +// Specifies whether this platform supports IPV6. +#define SB_HAS_IPV6 1 + +// Specifies whether this platform supports pipe. +#define SB_HAS_PIPE 1 + +// --- Tuneable Parameters --------------------------------------------------- + +// 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. +#define SB_NETWORK_RECEIVE_BUFFER_SIZE (0) + +// --- User Configuration ---------------------------------------------------- + +// The maximum number of users that can be signed in at the same time. +#define SB_USER_MAX_SIGNED_IN 1 + +// --- Timing API ------------------------------------------------------------ + +// Whether this platform has an API to retrieve how long the current thread +// has spent in the executing state. +#define SB_HAS_TIME_THREAD_NOW 1 + +// --- Platform Specific Audits ---------------------------------------------- + +#if !defined(__GNUC__) +#error "CREATOR_SHARED builds need a GCC-like compiler (for the moment)." +#endif + +#endif // STARBOARD_CREATOR_SHARED_CONFIGURATION_PUBLIC_H_
diff --git a/src/starboard/creator/shared/gyp_configuration.gypi b/src/starboard/creator/shared/gyp_configuration.gypi new file mode 100644 index 0000000..4710bfd --- /dev/null +++ b/src/starboard/creator/shared/gyp_configuration.gypi
@@ -0,0 +1,233 @@ +# Copyright 2016 Google Inc. 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. + +{ + 'variables': { + 'target_arch': 'mips', + 'target_os': 'linux', + + 'enable_webdriver': 0, + 'in_app_dial%': 0, + 'gl_type%': 'system_gles2', + 'rasterizer_type': 'direct-gles', + + 'scratch_surface_cache_size_in_bytes' : 0, + + # This should have a default value in cobalt/base.gypi. See the comment + # there for acceptable values for this variable. + 'javascript_engine': 'mozjs-45', + 'cobalt_enable_jit': 1, + 'cobalt_media_source_2016': 1, + + 'cobalt_font_package': 'expanded', + # Define platform specific compiler and linker flags. + # Refer to base.gypi for a list of all available variables. + 'compiler_flags_host': [ + '-O2', + ], + 'compiler_flags': [ + # We'll pretend not to be Linux, but Starboard instead. + '-U__linux__', + '--sysroot=<(sysroot)', + '-EL', + + # Suppress some warnings that will be hard to fix. + '-Wno-unused-local-typedefs', + '-Wno-unused-result', + '-Wno-deprecated-declarations', + '-Wno-missing-field-initializers', + '-Wno-comment', + '-Wno-narrowing', + '-Wno-unknown-pragmas', + '-Wno-type-limits', # TODO: We should actually look into these. + # Do not warn about sign compares. + '-Wno-sign-compare', + ], + 'linker_flags': [ + '--sysroot=<(sysroot)', + '-EL', + + # We don't wrap these symbols, but this ensures that they aren't + # linked in. + '-Wl,--wrap=malloc', + '-Wl,--wrap=calloc', + '-Wl,--wrap=realloc', + '-Wl,--wrap=memalign', + '-Wl,--wrap=reallocalign', + '-Wl,--wrap=free', + '-Wl,--wrap=strdup', + '-Wl,--wrap=malloc_usable_size', + '-Wl,--wrap=malloc_stats_fast', + '-Wl,--wrap=__cxa_demangle', + ], + 'compiler_flags_debug': [ + '-O0', + ], + 'compiler_flags_cc_debug': [ + '-frtti', + ], + 'compiler_flags_devel': [ + '-O2', + ], + 'compiler_flags_cc_devel': [ + '-frtti', + ], + 'compiler_flags_qa': [ + '-O2', + ], + 'compiler_flags_cc_qa': [ + '-fno-rtti', + ], + 'compiler_flags_gold': [ + '-O2', + ], + 'compiler_flags_cc_gold': [ + '-fno-rtti', + ], + 'platform_libraries': [ + '-lasound', + '-lavcodec', + '-lavformat', + '-lavresample', + '-lavutil', + '-lm', + '-lpthread', + '-lrt', + ], + 'conditions': [ + ['cobalt_fastbuild==0', { + 'compiler_flags_debug': [ + '-g', + ], + 'compiler_flags_devel': [ + '-g', + ], + 'compiler_flags_qa': [ + ], + 'compiler_flags_gold': [ + ], + }], + ['clang==1', { + 'linker_flags': [ + '-fuse-ld=lld', + '--target=mipsel-linux-gnu', + '--gcc-toolchain=<(sysroot)/..', + ], + }], + ], + }, + + 'target_defaults': { + 'defines': [ + # Cobalt on Linux flag + 'COBALT_LINUX', + '__STDC_FORMAT_MACROS', # so that we get PRI* + # Enable GNU extensions to get prototypes like ffsl. + '_GNU_SOURCE=1', + ], + 'conditions': [ + ['clang==1', { + 'cflags_c': [ + '-std=c11', + '--target=mipsel-linux-gnu', + '-march=mipsel', + '-mcpu=mips32r2', + '--gcc-toolchain=<(sysroot)/..', + ], + 'cflags_cc': [ + '-std=gnu++11', + '--target=mipsel-linux-gnu', + '-march=mipsel', + '-mcpu=mips32r2', + '-Werror', + '-fcolor-diagnostics', + # Default visibility to hidden, to enable dead stripping. + '-fvisibility=hidden', + '-Wno-c++11-compat', + # This complains about 'override', which we use heavily. + '-Wno-c++11-extensions', + # Warns on switches on enums that cover all enum values but + # also contain a default: branch. Chrome is full of that. + '-Wno-covered-switch-default', + # protobuf uses hash_map. + '-Wno-deprecated', + '-fno-exceptions', + # needed for backtrace() + '-fasynchronous-unwind-tables', + # Don't warn about the "struct foo f = {0};" initialization pattern. + '-Wno-missing-field-initializers', + # Do not warn for implicit sign conversions. + '-Wno-sign-conversion', + '-fno-strict-aliasing', # See http://crbug.com/32204 + '-Wno-unnamed-type-template-args', + # Triggered by the COMPILE_ASSERT macro. + '-Wno-unused-local-typedef', + # Do not warn if a function or variable cannot be implicitly + # instantiated. + '-Wno-undefined-var-template', + # Do not warn about an implicit exception spec mismatch. + '-Wno-implicit-exception-spec-mismatch', + '-Wno-tautological-constant-out-of-range-compare', + '-Wno-undefined-inline', + ], + },{ + # gcc + 'cflags_c': [ + '-std=c11', + '-EL', + ], + 'cflags_cc': [ + '-std=gnu++11', + '-Wno-literal-suffix', + # needed for backtrace() + '-fasynchronous-unwind-tables', + ], + }], + ], + 'target_conditions': [ + ['sb_pedantic_warnings==1', { + 'cflags': [ + '-Wall', + '-Wextra', + '-Wunreachable-code', + ], + },{ + 'conditions': [ + ['clang==1', { + 'cflags': [ + # 'this' pointer cannot be NULL...pointer may be assumed + # to always convert to true. + '-Wno-undefined-bool-conversion', + # Skia doesn't use overrides. + '-Wno-inconsistent-missing-override', + # Do not warn about unused function params. + '-Wno-unused-parameter', + # Do not warn for implicit type conversions that may change a value. + '-Wno-conversion', + # shifting a negative signed value is undefined + '-Wno-shift-negative-value', + # Width of bit-field exceeds width of its type- value will be truncated + '-Wno-bitfield-width', + '-Wno-undefined-var-template', + ], + },{ # gcc + 'cflags': [ + '-Wno-multichar', + ], + }], + ], + }], + ], + }, # end of target_defaults +}
diff --git a/src/starboard/creator/shared/gyp_configuration.py b/src/starboard/creator/shared/gyp_configuration.py new file mode 100644 index 0000000..b5f75cb --- /dev/null +++ b/src/starboard/creator/shared/gyp_configuration.py
@@ -0,0 +1,138 @@ +# Copyright 2016 Google Inc. 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. +"""Starboard Creator Ci20 platform configuration for gyp_cobalt.""" + +import logging +import imp +import os +import sys + +import config.base +import gyp_utils +from starboard.tools.testing import test_filter + + +class PlatformConfig(config.starboard.PlatformConfigStarboard): + """Starboard ci20 platform configuration.""" + + def __init__(self, platform): + super(PlatformConfig, self).__init__(platform) + + def _GetCi20Home(self): + try: + ci20_home = os.environ['CI20_HOME'] + except KeyError: + logging.critical('ci20 builds require the `CI20_HOME\' ' + 'environment variable to be set.') + sys.exit(1) + return ci20_home + + def GetVariables(self, configuration): + relative_sysroot = os.path.join('sysroot') + sysroot = os.path.join(self.ci20_home, relative_sysroot) + + if not os.path.isdir(sysroot): + logging.critical( + 'ci20 builds require $CI20_HOME/%s to be a valid directory.', + relative_sysroot) + sys.exit(1) + variables = super(PlatformConfig, self).GetVariables(configuration) + variables.update({ + 'clang': 1, + 'sysroot': sysroot, + }) + + return variables + + def GetEnvironmentVariables(self): + self.ci20_home = self._GetCi20Home() + self.host_compiler_environment = gyp_utils.GetHostCompilerEnvironment(0) + env_variables = self.host_compiler_environment + env_variables = { + 'CC': self.host_compiler_environment['CC_host'], + 'CXX': self.host_compiler_environment['CXX_host'], + 'CC_host': 'gcc', + 'CXX_host': 'g++', + 'LD_host': 'g++', + 'ARFLAGS_host': 'rcs', + 'ARTHINFLAGS_host': 'rcsT', + } + + return env_variables + + def GetLauncher(self): + """Gets the module used to launch applications on this platform.""" + # Use launcher.py from src/starboard/linux/shared/ + linux_shared = os.path.join( + os.path.dirname(__file__), '..', '..', 'linux', 'shared') + module_path = os.path.abspath(os.path.join( + linux_shared, 'launcher.py')) + launcher_module = imp.load_source('launcher', module_path) + return launcher_module + + def GetTestFilters(self): + """Gets all tests to be excluded from a unit test run. + + Returns: + A list of initialized TestFilter objects. + """ + return [ + # test is disabled on x64 + test_filter.TestFilter( + 'bindings_test', ('GlobalInterfaceBindingsTest.' + 'PropertiesAndOperationsAreOwnProperties')), + # tests miss the defined delay + test_filter.TestFilter( + 'nplb', 'SbConditionVariableWaitTimedTest.SunnyDay'), + test_filter.TestFilter( + 'nplb', 'SbConditionVariableWaitTimedTest.SunnyDayAutoInit'), + # tests sometimes miss the threshold of 10ms + test_filter.TestFilter( + 'nplb', 'Semaphore.ThreadTakesWait_PutBeforeTimeExpires'), + test_filter.TestFilter( + 'nplb', 'RWLock.HoldsLockForTime'), + # tests sometimes miss the threshold of 5ms + test_filter.TestFilter( + 'nplb', 'Semaphore.ThreadTakesWait_TimeExpires'), + test_filter.TestFilter( + 'nplb', 'SbWindowCreateTest.SunnyDayDefault'), + test_filter.TestFilter( + 'nplb', 'SbWindowCreateTest.SunnyDayDefaultSet'), + test_filter.TestFilter( + 'nplb', 'SbWindowGetPlatformHandleTest.SunnyDay'), + test_filter.TestFilter( + 'nplb', 'SbWindowGetSizeTest.SunnyDay'), + test_filter.TestFilter( + 'nplb', 'SbPlayerTest.SunnyDay'), + # tests fail also on x86 + test_filter.TestFilter( + 'nplb', 'SbSocketAddressTypes/SbSocketGetInterfaceAddressTest.SunnyDayDestination/1'), + test_filter.TestFilter( + 'nplb', 'SbSocketAddressTypes/SbSocketGetInterfaceAddressTest.SunnyDaySourceForDestination/1'), + test_filter.TestFilter( + 'nplb', 'SbSocketAddressTypes/SbSocketGetInterfaceAddressTest.SunnyDaySourceNotLoopback/1'), + # there are no test cases in this test + test_filter.TestFilter( + 'starboard_platform_tests', test_filter.FILTER_ALL), + # there are no test cases in this test + test_filter.TestFilter( + 'nplb_blitter_pixel_tests', test_filter.FILTER_ALL), + # test fails on x64 also + test_filter.TestFilter( + 'net_unittests', 'HostResolverImplDnsTest.DnsTaskUnspec'), + # we don't have proper procedure for running this test + test_filter.TestFilter( + 'web_platform_tests', test_filter.FILTER_ALL), + ] +
diff --git a/src/starboard/creator/shared/player_components_impl.cc b/src/starboard/creator/shared/player_components_impl.cc new file mode 100644 index 0000000..5b3410b --- /dev/null +++ b/src/starboard/creator/shared/player_components_impl.cc
@@ -0,0 +1,78 @@ +// Copyright 2017 Google Inc. 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. + +#include "starboard/shared/starboard/player/filter/player_components.h" + +#include "starboard/audio_sink.h" +#include "starboard/shared/ffmpeg/ffmpeg_audio_decoder.h" +#include "starboard/shared/ffmpeg/ffmpeg_video_decoder.h" +#include "starboard/shared/starboard/player/filter/audio_renderer_impl_internal.h" +#include "starboard/shared/starboard/player/filter/audio_renderer_sink_impl.h" +#include "starboard/shared/starboard/player/filter/video_renderer_impl_internal.h" + +namespace starboard { +namespace shared { +namespace starboard { +namespace player { +namespace filter { + +// static +scoped_ptr<PlayerComponents> PlayerComponents::Create( + const AudioParameters& audio_parameters, + const VideoParameters& video_parameters) { + typedef ::starboard::shared::ffmpeg::AudioDecoder AudioDecoderImpl; + typedef ::starboard::shared::ffmpeg::VideoDecoder FfmpegVideoDecoderImpl; + + // TODO: This is not ideal as we should really handle the creation failure of + // audio sink inside the audio renderer to give the renderer a chance to + // resample the decoded audio. + const int audio_channels = audio_parameters.audio_header.number_of_channels; + if (audio_channels > SbAudioSinkGetMaxChannels()) { + return scoped_ptr<PlayerComponents>(NULL); + } + + AudioDecoderImpl* audio_decoder = new AudioDecoderImpl( + audio_parameters.audio_codec, audio_parameters.audio_header); + if (!audio_decoder->is_valid()) { + delete audio_decoder; + return scoped_ptr<PlayerComponents>(NULL); + } + + scoped_ptr<HostedVideoDecoder> video_decoder; + FfmpegVideoDecoderImpl* ffmpeg_video_decoder = new FfmpegVideoDecoderImpl( + video_parameters.video_codec, video_parameters.output_mode, + video_parameters.decode_target_graphics_context_provider); + if (!ffmpeg_video_decoder->is_valid()) { + delete ffmpeg_video_decoder; + return scoped_ptr<PlayerComponents>(NULL); + } + video_decoder.reset(ffmpeg_video_decoder); + + AudioRendererImpl* audio_renderer = new AudioRendererImpl( + make_scoped_ptr<AudioDecoder>(audio_decoder), + make_scoped_ptr<AudioRendererSink>(new AudioRendererSinkImpl), + audio_parameters.audio_header); + + VideoRendererImpl* video_renderer = + new VideoRendererImpl(video_decoder.Pass()); + + return scoped_ptr<PlayerComponents>( + new PlayerComponents(audio_renderer, video_renderer)); +} + +} // namespace filter +} // namespace player +} // namespace starboard +} // namespace shared +} // namespace starboard