Skip to content

Commit 0646489

Browse files
authored
tvOS: Build own system_get_extensions.cc instead of the stub version (#9219)
This is groundwork for enabling the accessibility extension that will be used with h5vcc_accessibility. For now, just get the file to build while always returning nullptr for any extension: * Remove checks for the configuration extension because the extension is not used anywhere. Remove related files as well, they were not being built anyway. * Disable some extensions like graphics, crash handler and media session. Android also disables the graphics and media session ones, and the crash handler one needs proper support (or just be removed in the future). * Use nullptr instead of NULL everywhere. * Fix some headers. Bug: 478127016 Bug: 447135715
1 parent 1cd3f4f commit 0646489

File tree

4 files changed

+26
-132
lines changed

4 files changed

+26
-132
lines changed

starboard/tvos/shared/BUILD.gn

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ static_library("starboard_platform") {
141141
"storage_internal.mm",
142142
"storage_open_record.mm",
143143
"storage_read_record.mm",
144+
"system_get_extensions.cc",
144145
"system_get_number_of_processors.mm",
145146
"system_get_path.mm",
146147
"system_get_property.mm",
@@ -174,9 +175,6 @@ static_library("starboard_platform") {
174175
"//starboard/shared/stub/drm_is_server_certificate_updatable.cc",
175176
"//starboard/shared/stub/drm_update_server_certificate.cc",
176177
"//starboard/shared/stub/drm_update_session.cc",
177-
178-
# TODO: b/470021310 - get the tvOS version of this file to build.
179-
"//starboard/shared/stub/system_get_extensions.cc",
180178
]
181179

182180
sources -= [

starboard/tvos/shared/configuration.cc

Lines changed: 0 additions & 87 deletions
This file was deleted.

starboard/tvos/shared/configuration.h

Lines changed: 0 additions & 28 deletions
This file was deleted.

starboard/tvos/shared/system_get_extensions.cc

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,49 +12,60 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
#include "starboard/common/log.h"
1516
#include "starboard/common/string.h"
1617
#include "starboard/extension/accessibility.h"
17-
#include "starboard/extension/configuration.h"
1818
#include "starboard/extension/crash_handler.h"
1919
#include "starboard/extension/graphics.h"
2020
#include "starboard/extension/ifa.h"
21-
#include "starboard/extension/media/player_configuration.h"
2221
#include "starboard/extension/media_session.h"
2322
#include "starboard/extension/platform_service.h"
23+
#include "starboard/extension/player_configuration.h"
2424
#include "starboard/system.h"
2525
#include "starboard/tvos/shared/accessibility_extension.h"
26-
#include "starboard/tvos/shared/configuration.h"
2726
#include "starboard/tvos/shared/crash_handler.h"
28-
#include "starboard/tvos/shared/graphics.h"
2927
#include "starboard/tvos/shared/media/player_configuration.h"
3028
#include "starboard/tvos/shared/uikit_media_session_client.h"
3129

3230
const void* SbSystemGetExtension(const char* name) {
3331
if (strcmp(name, kCobaltExtensionGraphicsName) == 0) {
34-
return starboard::shared::uikit::GetGraphicsApi();
35-
}
36-
if (strcmp(name, kCobaltExtensionConfigurationName) == 0) {
37-
return starboard::shared::uikit::GetConfigurationApi();
32+
// Copied from Android's system_get_extensions.cc:
33+
// TODO: b/377052944 - Check if this is needed, likely can be
34+
// deleted.
35+
// return starboard::GetGraphicsApi();
36+
return nullptr;
3837
}
3938
if (strcmp(name, kCobaltExtensionMediaSessionName) == 0) {
40-
return starboard::shared::uikit::GetMediaSessionApi();
39+
// Copied from Android's system_get_extensions.cc:
40+
// TODO: b/377019873 - Re-enable
41+
// return starboard::GetMediaSessionApi();
42+
return nullptr;
4143
}
4244
if (strcmp(name, kCobaltExtensionCrashHandlerName) == 0) {
43-
return starboard::shared::uikit::GetCrashHandlerApi();
45+
// TODO: b/477518757 - Re-enable once Crashpad support is in and if it
46+
// needs to be exposed as an extension.
47+
// return starboard::GetCrashHandlerApi();
48+
return nullptr;
4449
}
4550
if (strcmp(name, kCobaltExtensionPlatformServiceName) == 0) {
4651
SB_LOG(INFO) << "The platform service extension is not supported on tvOS";
4752
return nullptr;
4853
}
4954
if (strcmp(name, kStarboardExtensionIfaName) == 0) {
5055
SB_LOG(INFO) << "IFA is not supported via Starboard.";
51-
return NULL;
56+
return nullptr;
5257
}
5358
if (strcmp(name, kStarboardExtensionPlayerConfigurationName) == 0) {
54-
return starboard::shared::uikit::GetPlayerConfigurationApi();
59+
// TODO: b/447334535 - This depends on decode to texture mode being
60+
// implemented.
61+
// return starboard::GetPlayerConfigurationApi();
62+
return nullptr;
5563
}
5664
if (strcmp(name, kStarboardExtensionAccessibilityName) == 0) {
57-
return starboard::shared::uikit::GetAccessibilityApi();
65+
// TODO: b/478127016 - This will be enabled separately with the rest of
66+
// VoiceOver support code.
67+
// return starboard::GetAccessibilityApi();
68+
return nullptr;
5869
}
59-
return NULL;
70+
return nullptr;
6071
}

0 commit comments

Comments
 (0)