diff --git a/base/strings/string_util_starboard.h b/base/strings/string_util_starboard.h index 90da5a8ce1ec..857cd6576207 100644 --- a/base/strings/string_util_starboard.h +++ b/base/strings/string_util_starboard.h @@ -16,9 +16,7 @@ #define BASE_STRING_UTIL_STARBOARD_H_ #include -#if SB_API_VERSION >= 16 #include -#endif #include "base/basictypes.h" #include "base/logging.h" diff --git a/base/threading/platform_thread_starboard.cc b/base/threading/platform_thread_starboard.cc index 3a7513fdf8a0..0b540daf4b57 100644 --- a/base/threading/platform_thread_starboard.cc +++ b/base/threading/platform_thread_starboard.cc @@ -39,11 +39,9 @@ void* ThreadFunc(void* params) { ThreadParams* thread_params = static_cast(params); PlatformThread::Delegate* delegate = thread_params->delegate; -#if SB_API_VERSION >= 16 if (kSbHasThreadPrioritySupport) { SbThreadSetPriority(thread_params->thread_priority); } -#endif // SB_API_VERSION >= 16 pthread_setname_np(pthread_self(), thread_params->thread_name.c_str()); absl::optional disallow_singleton; @@ -66,7 +64,6 @@ void* ThreadFunc(void* params) { return NULL; } -#if SB_API_VERSION >= 16 bool CreateThread(size_t stack_size, SbThreadPriority priority, bool joinable, @@ -106,30 +103,7 @@ bool CreateThread(size_t stack_size, return false; } -#else -bool CreateThread(size_t stack_size, - SbThreadPriority priority, - bool joinable, - const char* name, - PlatformThread::Delegate* delegate, - PlatformThreadHandle* thread_handle) { - ThreadParams* params = new ThreadParams; - params->delegate = delegate; - params->joinable = joinable; - SbThread thread = SbThreadCreate(stack_size, priority, kSbThreadNoAffinity, joinable, - name, ThreadFunc, params); - if (SbThreadIsValid(thread)) { - if (thread_handle) { - *thread_handle = PlatformThreadHandle(thread); - } - - return true; - } - - return false; -} -#endif // SB_API_VERSION >= 16 inline SbThreadPriority toSbPriority(ThreadType priority) { switch (priority) { diff --git a/cobalt/audio/audio_helpers.h b/cobalt/audio/audio_helpers.h index 8580b75ebcdf..0264933957c0 100644 --- a/cobalt/audio/audio_helpers.h +++ b/cobalt/audio/audio_helpers.h @@ -68,19 +68,8 @@ inline size_t GetSampleTypeSize(SampleType sample_type) { // an internal SampleType. If we are not running on starboard or using the // starboard media pipeline, then the preferred sample type is always float32. inline SampleType GetPreferredOutputSampleType() { -#if SB_API_VERSION >= 16 DCHECK(SbAudioSinkIsAudioSampleTypeSupported(kSbMediaAudioSampleTypeFloat32)); return kSampleTypeFloat32; -#else // SB_API_VERSION >= 16 - if (SbAudioSinkIsAudioSampleTypeSupported(kSbMediaAudioSampleTypeFloat32)) { - return kSampleTypeFloat32; - } - DCHECK(SbAudioSinkIsAudioSampleTypeSupported( - kSbMediaAudioSampleTypeInt16Deprecated)) - << "At least one starboard audio sample type must be supported if using " - "starboard media pipeline."; - return kSampleTypeInt16; -#endif // SB_API_VERSION >= 16 } #if defined(STARBOARD) diff --git a/cobalt/base/wrap_main_starboard.h b/cobalt/base/wrap_main_starboard.h index 7a85063edda6..25abdee3cc30 100644 --- a/cobalt/base/wrap_main_starboard.h +++ b/cobalt/base/wrap_main_starboard.h @@ -130,11 +130,7 @@ void BaseEventHandler(const SbEvent* event) { case kSbEventTypeOsNetworkDisconnected: case kSbEventTypeOsNetworkConnected: case kSbEventDateTimeConfigurationChanged: -#if SB_API_VERSION >= 16 case kSbEventTypeReserved1: -#else - case kSbEventTypeOnScreenKeyboardSuggestionsUpdated: -#endif // SB_API_VERSION >= 16 event_function(event); break; } diff --git a/cobalt/browser/application.cc b/cobalt/browser/application.cc index f708ebcacc33..d10cb82ab9cb 100644 --- a/cobalt/browser/application.cc +++ b/cobalt/browser/application.cc @@ -127,17 +127,10 @@ std::string GetDevServersListenIp() { // Default to INADDR_ANY std::string listen_ip(ip_v6 ? "::" : "0.0.0.0"); -#if SB_API_VERSION < 15 - // Desktop PCs default to loopback. - if (SbSystemGetDeviceType() == kSbSystemDeviceTypeDesktopPC) { - listen_ip = ip_v6 ? "::1" : "127.0.0.1"; - } -#else if (starboard::GetSystemPropertyString(kSbSystemPropertyDeviceType) == starboard::kSystemDeviceTypeDesktopPC) { listen_ip = ip_v6 ? "::1" : "127.0.0.1"; } -#endif #if defined(ENABLE_DEBUG_COMMAND_LINE_SWITCHES) base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); @@ -1176,11 +1169,7 @@ void Application::HandleStarboardEvent(const SbEvent* starboard_event) { case kSbEventTypeStop: case kSbEventTypeUser: case kSbEventTypeVerticalSync: -#if SB_API_VERSION >= 16 case kSbEventTypeReserved1: -#else - case kSbEventTypeOnScreenKeyboardSuggestionsUpdated: -#endif // SB_API_VERSION >= 16 DLOG(WARNING) << "Unhandled Starboard event of type: " << starboard_event->type; } @@ -1267,11 +1256,7 @@ void Application::OnApplicationEvent(SbEventType event_type, case kSbEventTypeOsNetworkDisconnected: case kSbEventTypeOsNetworkConnected: case kSbEventDateTimeConfigurationChanged: -#if SB_API_VERSION >= 16 case kSbEventTypeReserved1: -#else - case kSbEventTypeOnScreenKeyboardSuggestionsUpdated: -#endif // SB_API_VERSION >= 16 NOTREACHED() << "Unexpected event type: " << event_type; return; } diff --git a/cobalt/browser/user_agent_platform_info.cc b/cobalt/browser/user_agent_platform_info.cc index 5c0d65895531..a6563bf9b43d 100644 --- a/cobalt/browser/user_agent_platform_info.cc +++ b/cobalt/browser/user_agent_platform_info.cc @@ -110,47 +110,6 @@ void GetUserAgentInputMap( namespace { -#if SB_API_VERSION < 15 - -struct DeviceTypeName { - SbSystemDeviceType device_type; - char device_type_string[10]; -}; - -const DeviceTypeName kDeviceTypeStrings[] = { - {kSbSystemDeviceTypeBlueRayDiskPlayer, "BDP"}, - {kSbSystemDeviceTypeGameConsole, "GAME"}, - {kSbSystemDeviceTypeOverTheTopBox, "OTT"}, - {kSbSystemDeviceTypeSetTopBox, "STB"}, - {kSbSystemDeviceTypeTV, "TV"}, - {kSbSystemDeviceTypeAndroidTV, "ATV"}, - {kSbSystemDeviceTypeDesktopPC, "DESKTOP"}, - {kSbSystemDeviceTypeVideoProjector, "PROJECTOR"}, - {kSbSystemDeviceTypeUnknown, "UNKNOWN"}}; - -std::string CreateDeviceTypeString(SbSystemDeviceType device_type) { - for (auto& map : kDeviceTypeStrings) { - if (map.device_type == device_type) { - return std::string(map.device_type_string); - } - } - NOTREACHED(); - return "UNKNOWN"; -} - -#if !defined(COBALT_BUILD_TYPE_GOLD) -SbSystemDeviceType GetDeviceType(std::string device_type_string) { - for (auto& map : kDeviceTypeStrings) { - if (!SbStringCompareNoCase(map.device_type_string, - device_type_string.c_str())) { - return map.device_type; - } - } - return kSbSystemDeviceTypeUnknown; -} -#endif -#endif // SB_API_VERSION < 15 - static bool isAsciiAlphaDigit(int c) { return base::IsAsciiAlpha(c) || base::IsAsciiDigit(c); } @@ -320,15 +279,10 @@ void InitializeUserAgentPlatformInfoFields(UserAgentPlatformInfo& info) { info.set_aux_field(value); } -#if SB_API_VERSION >= 15 result = SbSystemGetProperty(kSbSystemPropertyDeviceType, value, kSystemPropertyMaxLength); SB_DCHECK(result); info.set_device_type(value); -#else - // Fill platform info if it is a hardware TV device. - info.set_device_type(SbSystemGetDeviceType()); -#endif // Chipset model number result = SbSystemGetProperty(kSbSystemPropertyChipsetModelNumber, value, @@ -395,11 +349,7 @@ void InitializeUserAgentPlatformInfoFields(UserAgentPlatformInfo& info) { info.set_original_design_manufacturer(input.second); LOG(INFO) << "Set original design manufacturer to " << input.second; } else if (!input.first.compare("device_type")) { -#if SB_API_VERSION < 15 - info.set_device_type(GetDeviceType(input.second)); -#else info.set_device_type(input.second); -#endif LOG(INFO) << "Set device type to " << input.second; } else if (!input.first.compare("chipset_model_number")) { info.set_chipset_model_number(input.second); @@ -485,12 +435,6 @@ void UserAgentPlatformInfo::set_original_design_manufacturer( } } -#if SB_API_VERSION < 15 -void UserAgentPlatformInfo::set_device_type(SbSystemDeviceType device_type) { - device_type_ = device_type; - device_type_string_ = CreateDeviceTypeString(device_type_); -} -#endif void UserAgentPlatformInfo::set_device_type(const std::string& device_type) { device_type_string_ = device_type; } diff --git a/cobalt/browser/user_agent_platform_info.h b/cobalt/browser/user_agent_platform_info.h index 193b7691bee9..d0a5cd1f5e23 100644 --- a/cobalt/browser/user_agent_platform_info.h +++ b/cobalt/browser/user_agent_platform_info.h @@ -97,9 +97,6 @@ class UserAgentPlatformInfo : public web::UserAgentPlatformInfo { void set_os_name_and_version(const std::string& os_name_and_version); void set_original_design_manufacturer( base::Optional original_design_manufacturer); -#if SB_API_VERSION < 15 - void set_device_type(SbSystemDeviceType device_type); -#endif void set_device_type(const std::string& device_type); void set_chipset_model_number( base::Optional chipset_model_number); diff --git a/cobalt/dom/captions/system_caption_settings.cc b/cobalt/dom/captions/system_caption_settings.cc index b0f978f631ff..185502ecb4df 100644 --- a/cobalt/dom/captions/system_caption_settings.cc +++ b/cobalt/dom/captions/system_caption_settings.cc @@ -473,7 +473,6 @@ bool SystemCaptionSettings::is_enabled() { void SystemCaptionSettings::set_is_enabled(bool active) { DCHECK(supports_set_enabled()); -#if SB_API_VERSION >= 16 auto accessibility_api = static_cast( SbSystemGetExtension(kStarboardExtensionAccessibilityName)); @@ -483,9 +482,6 @@ void SystemCaptionSettings::set_is_enabled(bool active) { accessibility_api->version >= 1) { accessibility_api->SetCaptionsEnabled(active); } -#else // SB_API_VERSION >= 16 - SbAccessibilitySetCaptionsEnabled(active); -#endif // SB_API_VERSION >= 16 } bool SystemCaptionSettings::supports_is_enabled() { @@ -643,7 +639,6 @@ const char* SystemCaptionSettings::CaptionOpacityPercentageToString( bool SystemCaptionSettings::GetCaptionSettings( SbAccessibilityCaptionSettings* caption_settings) { -#if SB_API_VERSION >= 16 auto accessibility_api = static_cast( SbSystemGetExtension(kStarboardExtensionAccessibilityName)); @@ -655,9 +650,6 @@ bool SystemCaptionSettings::GetCaptionSettings( } else { return false; } -#else // SB_API_VERSION >= 16 - return SbAccessibilityGetCaptionSettings(caption_settings); -#endif // SB_API_VERSION >= 16 } } // namespace captions diff --git a/cobalt/dom/html_media_element.cc b/cobalt/dom/html_media_element.cc index 2be5f86f59ba..e1629285e7ba 100644 --- a/cobalt/dom/html_media_element.cc +++ b/cobalt/dom/html_media_element.cc @@ -708,16 +708,12 @@ void HTMLMediaElement::ScheduleEvent(const scoped_refptr& event) { } std::string HTMLMediaElement::h5vcc_audio_connectors() const { -#if SB_API_VERSION >= 15 if (!player_) { return ""; } std::vector configs = player_->GetAudioConnectors(); return base::JoinString(configs, ";"); -#else // SB_API_VERSION >= 15 - return ""; -#endif // SB_API_VERSION >= 15 } void HTMLMediaElement::CreateMediaPlayer() { diff --git a/cobalt/dom/keyboard_event.cc b/cobalt/dom/keyboard_event.cc index ad854118b1db..37cda49e9a7d 100644 --- a/cobalt/dom/keyboard_event.cc +++ b/cobalt/dom/keyboard_event.cc @@ -337,10 +337,8 @@ std::string KeyboardEvent::NonPrintableKey(int32_t key_code) const { return "MediaStop"; case keycode::kMediaPlayPause: return "MediaPlayPause"; -#if SB_API_VERSION >= 15 case keycode::kMediaRecord: return "MediaRecord"; -#endif case keycode::kMediaLaunchMail: return "LaunchMail"; case keycode::kMediaLaunchMediaSelect: diff --git a/cobalt/dom/keyboard_event_test.cc b/cobalt/dom/keyboard_event_test.cc index 0f9843e72881..c189ccc1ddc4 100644 --- a/cobalt/dom/keyboard_event_test.cc +++ b/cobalt/dom/keyboard_event_test.cc @@ -135,14 +135,12 @@ TEST_F(KeyboardEventTest, CanGetKeyIdentifierAndKeyAndCode) { EXPECT_EQ(keyboard_event_space->key(), " "); EXPECT_EQ(keyboard_event_space->code(), "Space"); -#if SB_API_VERSION >= 15 init.set_key_code(keycode::kMediaRecord); scoped_refptr keyboard_event_record = new KeyboardEvent("keydown", init); EXPECT_EQ(keyboard_event_record->key_identifier(), "MediaRecord"); EXPECT_EQ(keyboard_event_record->key(), "MediaRecord"); EXPECT_EQ(keyboard_event_record->code(), "MediaRecord"); -#endif } TEST_F(KeyboardEventTest, CanGetAltKey) { diff --git a/cobalt/dom/keycode.h b/cobalt/dom/keycode.h index afda18fa6df4..5623e52f745b 100644 --- a/cobalt/dom/keycode.h +++ b/cobalt/dom/keycode.h @@ -200,9 +200,7 @@ enum { // Not present in Windows virtual key codes, but would be used by the client. kMediaRewind = 0xE3, kMediaFastForward = 0xE4, -#if SB_API_VERSION >= 15 kMediaRecord = 0x1A0, -#endif }; } // namespace keycode diff --git a/cobalt/h5vcc/h5vcc_accessibility.cc b/cobalt/h5vcc/h5vcc_accessibility.cc index 70b09024293d..0e5861c0ef5f 100644 --- a/cobalt/h5vcc/h5vcc_accessibility.cc +++ b/cobalt/h5vcc/h5vcc_accessibility.cc @@ -74,7 +74,6 @@ void H5vccAccessibility::set_built_in_screen_reader(bool value) { bool H5vccAccessibility::high_contrast_text() const { SbAccessibilityDisplaySettings settings; memset(&settings, 0, sizeof(settings)); -#if SB_API_VERSION >= 16 auto accessibility_api = static_cast( SbSystemGetExtension(kStarboardExtensionAccessibilityName)); @@ -88,11 +87,6 @@ bool H5vccAccessibility::high_contrast_text() const { } else { return false; } -#else // SB_API_VERSION >= 16 - if (!SbAccessibilityGetDisplaySettings(&settings)) { - return false; - } -#endif // SB_API_VERSION >= 16 return settings.is_high_contrast_text_enabled; } @@ -103,7 +97,6 @@ bool H5vccAccessibility::text_to_speech() const { } SbAccessibilityTextToSpeechSettings settings; memset(&settings, 0, sizeof(settings)); -#if SB_API_VERSION >= 16 auto accessibility_api = static_cast( SbSystemGetExtension(kStarboardExtensionAccessibilityName)); @@ -117,11 +110,6 @@ bool H5vccAccessibility::text_to_speech() const { } else { return false; } -#else // SB_API_VERSION >= 16 - if (!SbAccessibilityGetTextToSpeechSettings(&settings)) { - return false; - } -#endif // SB_API_VERSION >= 16 return settings.has_text_to_speech_setting && settings.is_text_to_speech_enabled; } diff --git a/cobalt/ui_navigation/interface.cc b/cobalt/ui_navigation/interface.cc index e4ae99fcff26..50a78c71bad1 100644 --- a/cobalt/ui_navigation/interface.cc +++ b/cobalt/ui_navigation/interface.cc @@ -14,12 +14,10 @@ #include "cobalt/ui_navigation/interface.h" -#include "starboard/common/spin_lock.h" -#if SB_API_VERSION >= 16 #include +#include "starboard/common/spin_lock.h" #include "starboard/system.h" -#endif // SB_API_VERSION namespace cobalt { namespace ui_navigation { diff --git a/cobalt/web/testing/mock_user_agent_platform_info.h b/cobalt/web/testing/mock_user_agent_platform_info.h index c8eeb2295448..16b37927a247 100644 --- a/cobalt/web/testing/mock_user_agent_platform_info.h +++ b/cobalt/web/testing/mock_user_agent_platform_info.h @@ -40,11 +40,6 @@ class MockUserAgentPlatformInfo : public web::UserAgentPlatformInfo { base::Optional original_design_manufacturer() const override { return optional_empty_string_; } -#if SB_API_VERSION < 15 - SbSystemDeviceType device_type() const override { - return kSbSystemDeviceTypeUnknown; - } -#endif const std::string& device_type_string() const override { return empty_string_; } diff --git a/cobalt/web/user_agent_platform_info.h b/cobalt/web/user_agent_platform_info.h index f523addd888d..e75faa902fa6 100644 --- a/cobalt/web/user_agent_platform_info.h +++ b/cobalt/web/user_agent_platform_info.h @@ -32,9 +32,6 @@ class UserAgentPlatformInfo { virtual const std::string& starboard_version() const = 0; virtual const std::string& os_name_and_version() const = 0; virtual base::Optional original_design_manufacturer() const = 0; -#if SB_API_VERSION < 15 - virtual SbSystemDeviceType device_type() const = 0; -#endif virtual const std::string& device_type_string() const = 0; virtual base::Optional chipset_model_number() const = 0; virtual base::Optional model_year() const = 0; diff --git a/starboard/android/shared/android_main.cc b/starboard/android/shared/android_main.cc index 011611739aaa..9be94de99c46 100644 --- a/starboard/android/shared/android_main.cc +++ b/starboard/android/shared/android_main.cc @@ -238,36 +238,8 @@ void* ThreadEntryPoint(void* context) { pthread_setname_np(pthread_self(), "StarboardMain"); g_app_created_semaphore = static_cast(context); -#if SB_API_VERSION >= 15 int unused_value = -1; int error_level = SbRunStarboardMain(unused_value, nullptr, SbEventHandle); -#else - ALooper* looper = ALooper_prepare(ALOOPER_PREPARE_ALLOW_NON_CALLBACKS); - ApplicationAndroid app(looper); - - CommandLine command_line(GetArgs()); - LogInit(command_line); - -#if SB_IS(EVERGREEN_COMPATIBLE) - InstallCrashpadHandler(command_line); -#endif // SB_IS(EVERGREEN_COMPATIBLE) - - // Mark the app running before signaling app created so there's no race to - // allow sending the first AndroidCommand after onCreate() returns. - g_app_running.store(true); - - // Signal GameActivity_onCreate() that it may proceed. - g_app_created_semaphore->Put(); - - // Enter the Starboard run loop until stopped. - int error_level = - app.Run(std::move(command_line), GetStartDeepLink().c_str()); - - // Mark the app not running before informing StarboardBridge that the app is - // stopped so that we won't send any more AndroidCommands as a result of - // shutting down the Activity. - g_app_running.store(false); -#endif // SB_API_VERSION >= 15 // Our launcher.py looks for this to know when the app (test) is done. SB_LOG(INFO) << "***Application Stopped*** " << error_level; @@ -415,7 +387,6 @@ Java_dev_cobalt_coat_VolumeStateReceiver_nativeMuteChanged(JNIEnv* env, } // namespace -#if SB_API_VERSION >= 15 extern "C" int SbRunStarboardMain(int argc, char** argv, SbEventHandleCallback callback) { @@ -447,7 +418,6 @@ extern "C" int SbRunStarboardMain(int argc, return error_level; } -#endif // SB_API_VERSION >= 15 } // namespace shared } // namespace android diff --git a/starboard/android/shared/application_android.cc b/starboard/android/shared/application_android.cc index 820b339d6f45..d040ca4cdb0e 100644 --- a/starboard/android/shared/application_android.cc +++ b/starboard/android/shared/application_android.cc @@ -98,13 +98,9 @@ int64_t GetAppStartTimestamp() { // "using" doesn't work with class members, so make a local convenience type. typedef ::starboard::shared::starboard::Application::Event Event; -#if SB_API_VERSION >= 15 ApplicationAndroid::ApplicationAndroid( ALooper* looper, SbEventHandleCallback sb_event_handle_callback) -#else -ApplicationAndroid::ApplicationAndroid(ALooper* looper) -#endif // SB_API_VERSION >= 15 : looper_(looper), native_window_(NULL), android_command_readfd_(-1), @@ -114,9 +110,7 @@ ApplicationAndroid::ApplicationAndroid(ALooper* looper) android_command_condition_(android_command_mutex_), activity_state_(AndroidCommand::kUndefined), window_(kSbWindowInvalid), -#if SB_API_VERSION >= 15 QueueApplication(sb_event_handle_callback), -#endif // SB_API_VERSION >= 15 last_is_accessibility_high_contrast_text_enabled_(false) { handle_system_events_.store(true); // Initialize Time Zone early so that local time works correctly. diff --git a/starboard/android/shared/application_android.h b/starboard/android/shared/application_android.h index d53b3ef91e67..8772c439cfab 100644 --- a/starboard/android/shared/application_android.h +++ b/starboard/android/shared/application_android.h @@ -61,12 +61,8 @@ class ApplicationAndroid void* data = nullptr; }; -#if SB_API_VERSION >= 15 ApplicationAndroid(ALooper* looper, SbEventHandleCallback sb_event_handle_callback); -#else - explicit ApplicationAndroid(ALooper* looper); -#endif // SB_API_VERSION >= 15 ~ApplicationAndroid() override; static ApplicationAndroid* Get() { diff --git a/starboard/android/shared/audio_track_audio_sink_type.cc b/starboard/android/shared/audio_track_audio_sink_type.cc index 3a92470983b8..4af3a1751f18 100644 --- a/starboard/android/shared/audio_track_audio_sink_type.cc +++ b/starboard/android/shared/audio_track_audio_sink_type.cc @@ -74,7 +74,6 @@ int GetMaxFramesPerRequestForTunnelMode(int sampling_frequency_hz) { } bool HasRemoteAudioOutput() { -#if SB_API_VERSION >= 15 // SbPlayerBridge::GetAudioConfigurations() reads up to 32 configurations. The // limit here is to avoid infinite loop and also match // SbPlayerBridge::GetAudioConfigurations(). @@ -101,8 +100,6 @@ bool HasRemoteAudioOutput() { index++; } return false; -#endif // SB_API_VERSION >= 15 - return false; } } // namespace diff --git a/starboard/android/shared/configuration_constants.cc b/starboard/android/shared/configuration_constants.cc index f777f984b2bf..9cb35deaab63 100644 --- a/starboard/android/shared/configuration_constants.cc +++ b/starboard/android/shared/configuration_constants.cc @@ -126,11 +126,9 @@ const int kSbPreferredRgbaByteOrder = SB_PREFERRED_RGBA_BYTE_ORDER_RGBA; // The maximum size the cache directory is allowed to use in bytes. const uint32_t kSbMaxSystemPathCacheDirectorySize = 24 << 20; // 24MiB -#if SB_API_VERSION >= 16 // Whether this platform can map executable memory. This is required for // platforms that want to JIT. SB_EXPORT extern const bool kSbCanMapExecutableMemory = true; // Platform can support partial audio frames SB_EXPORT extern const bool kHasPartialAudioFramesSupport = true; -#endif diff --git a/starboard/android/shared/input_events_generator.cc b/starboard/android/shared/input_events_generator.cc index aed501be42c6..be0ec9334262 100644 --- a/starboard/android/shared/input_events_generator.cc +++ b/starboard/android/shared/input_events_generator.cc @@ -232,10 +232,8 @@ SbKey AInputEventToSbKey(GameActivityKeyEvent* event) { return kSbKeyMediaRewind; case AKEYCODE_MEDIA_FAST_FORWARD: return kSbKeyMediaFastForward; -#if SB_API_VERSION >= 15 case AKEYCODE_MEDIA_RECORD: return kSbKeyRecord; -#endif // TV Remote specific case AKEYCODE_CHANNEL_UP: diff --git a/starboard/android/shared/media_capabilities_cache.cc b/starboard/android/shared/media_capabilities_cache.cc index 19d5c71d7111..10e2d1998d84 100644 --- a/starboard/android/shared/media_capabilities_cache.cc +++ b/starboard/android/shared/media_capabilities_cache.cc @@ -74,7 +74,6 @@ constexpr int TYPE_USB_HEADSET = 22; constexpr int TYPE_WIRED_HEADPHONES = 4; constexpr int TYPE_WIRED_HEADSET = 3; -#if SB_API_VERSION >= 15 SbMediaAudioConnector GetConnectorFromAndroidOutputType( int android_output_device_type) { switch (android_output_device_type) { @@ -146,7 +145,6 @@ SbMediaAudioConnector GetConnectorFromAndroidOutputType( << android_output_device_type; return kSbMediaAudioConnectorUnknown; } -#endif // SB_API_VERSION >= 15 bool EndsWith(const std::string& str, const std::string& suffix) { if (str.size() < suffix.size()) { @@ -269,12 +267,8 @@ bool GetAudioConfiguration(int index, return env->CallIntMethodOrAbort(j_output_device_info.Get(), name, "()I"); }; -#if SB_API_VERSION >= 15 configuration->connector = GetConnectorFromAndroidOutputType(call_int_method("getType")); -#else // SB_API_VERSION >= 15 - configuration->connector = kSbMediaAudioConnectorHdmi; -#endif // SB_API_VERSION >= 15 configuration->latency = 0; configuration->coding_type = kSbMediaAudioCodingTypePcm; configuration->number_of_channels = call_int_method("getChannels"); diff --git a/starboard/android/shared/player_create.cc b/starboard/android/shared/player_create.cc index 78b4ba46f252..bcd827a675dd 100644 --- a/starboard/android/shared/player_create.cc +++ b/starboard/android/shared/player_create.cc @@ -53,17 +53,10 @@ SbPlayer SbPlayerCreate(SbWindow window, return kSbPlayerInvalid; } -#if SB_API_VERSION >= 15 const SbMediaAudioStreamInfo& audio_stream_info = creation_param->audio_stream_info; const SbMediaVideoStreamInfo& video_stream_info = creation_param->video_stream_info; -#else // SB_API_VERSION >= 15 - const SbMediaAudioSampleInfo& audio_stream_info = - creation_param->audio_sample_info; - const SbMediaVideoSampleInfo& video_stream_info = - creation_param->video_sample_info; -#endif // SB_API_VERSION >= 15 bool has_audio = audio_stream_info.codec != kSbMediaAudioCodecNone; bool has_video = video_stream_info.codec != kSbMediaVideoCodecNone; diff --git a/starboard/android/shared/player_get_preferred_output_mode.cc b/starboard/android/shared/player_get_preferred_output_mode.cc index 185f8e1bd3dd..f32d63712881 100644 --- a/starboard/android/shared/player_get_preferred_output_mode.cc +++ b/starboard/android/shared/player_get_preferred_output_mode.cc @@ -30,17 +30,10 @@ SbPlayerOutputMode SbPlayerGetPreferredOutputMode( return kSbPlayerOutputModeInvalid; } -#if SB_API_VERSION >= 15 const SbMediaAudioStreamInfo& audio_stream_info = creation_param->audio_stream_info; const SbMediaVideoStreamInfo& video_stream_info = creation_param->video_stream_info; -#else // SB_API_VERSION >= 15 - const SbMediaAudioSampleInfo& audio_stream_info = - creation_param->audio_sample_info; - const SbMediaVideoSampleInfo& video_stream_info = - creation_param->video_sample_info; -#endif // SB_API_VERSION >= 15 if (audio_stream_info.codec != kSbMediaAudioCodecNone && !audio_stream_info.mime) { diff --git a/starboard/android/shared/system_get_property.cc b/starboard/android/shared/system_get_property.cc index 3f14106b8362..8cf1ccd57df0 100644 --- a/starboard/android/shared/system_get_property.cc +++ b/starboard/android/shared/system_get_property.cc @@ -161,11 +161,9 @@ bool SbSystemGetProperty(SbSystemPropertyId property_id, return CopyStringAndTestIfSuccess(out_value, value_length, limit_ad_tracking_enabled ? "1" : "0"); } -#if SB_API_VERSION >= 15 case kSbSystemPropertyDeviceType: return CopyStringAndTestIfSuccess(out_value, value_length, starboard::kSystemDeviceTypeAndroidTV); -#endif default: SB_DLOG(WARNING) << __FUNCTION__ << ": Unrecognized property: " << property_id; diff --git a/starboard/common/media.cc b/starboard/common/media.cc index a7ee8d724c38..d1a7294634f1 100644 --- a/starboard/common/media.cc +++ b/starboard/common/media.cc @@ -597,10 +597,8 @@ const char* GetMediaAudioCodecName(SbMediaAudioCodec codec) { return "flac"; case kSbMediaAudioCodecPcm: return "pcm"; -#if SB_API_VERSION >= 15 case kSbMediaAudioCodecIamf: return "iamf"; -#endif // SB_API_VERSION >= 15 } SB_NOTREACHED(); return "invalid"; @@ -633,34 +631,22 @@ const char* GetMediaVideoCodecName(SbMediaVideoCodec codec) { const char* GetMediaAudioConnectorName(SbMediaAudioConnector connector) { switch (connector) { -#if SB_API_VERSION >= 15 case kSbMediaAudioConnectorUnknown: return "unknown"; -#else // SB_API_VERSION >= 15 - case kSbMediaAudioConnectorNone: - return "none"; -#endif // SB_API_VERSION >= 15 case kSbMediaAudioConnectorAnalog: return "analog"; case kSbMediaAudioConnectorBluetooth: return "bluetooth"; -#if SB_API_VERSION >= 15 case kSbMediaAudioConnectorBuiltIn: return "builtin"; -#endif // SB_API_VERSION >= 15 case kSbMediaAudioConnectorHdmi: return "hdmi"; -#if SB_API_VERSION >= 15 case kSbMediaAudioConnectorRemoteWired: return "remote-wired"; case kSbMediaAudioConnectorRemoteWireless: return "remote-wireless"; case kSbMediaAudioConnectorRemoteOther: return "remote-other"; -#else // SB_API_VERSION >= 15 - case kSbMediaAudioConnectorNetwork: - return "network"; -#endif // SB_API_VERSION >= 15 case kSbMediaAudioConnectorSpdif: return "spdif"; case kSbMediaAudioConnectorUsb: @@ -935,11 +921,7 @@ std::ostream& operator<<(std::ostream& os, const SbMediaVideoSampleInfo& sample_info) { using starboard::GetMediaVideoCodecName; -#if SB_API_VERSION >= 15 const SbMediaVideoStreamInfo& stream_info = sample_info.stream_info; -#else // SB_API_VERSION >= 15 - const SbMediaVideoSampleInfo& stream_info = sample_info; -#endif // SB_API_VERSION >= 15 if (stream_info.codec == kSbMediaVideoCodecNone) { return os; @@ -967,11 +949,7 @@ std::ostream& operator<<(std::ostream& os, using starboard::GetMediaAudioCodecName; using starboard::HexEncode; -#if SB_API_VERSION >= 15 const SbMediaAudioStreamInfo& stream_info = sample_info.stream_info; -#else // SB_API_VERSION >= 15 - const SbMediaAudioSampleInfo& stream_info = sample_info; -#endif // SB_API_VERSION >= 15 if (stream_info.codec == kSbMediaAudioCodecNone) { return os; @@ -993,7 +971,6 @@ std::ostream& operator<<(std::ostream& os, return os; } -#if SB_API_VERSION >= 15 std::ostream& operator<<(std::ostream& os, const SbMediaVideoStreamInfo& stream_info) { using starboard::GetMediaVideoCodecName; @@ -1039,5 +1016,3 @@ std::ostream& operator<<(std::ostream& os, return os; } - -#endif // SB_API_VERSION >= 15 diff --git a/starboard/common/media.h b/starboard/common/media.h index 25fa8283eda3..f86ae2ba311d 100644 --- a/starboard/common/media.h +++ b/starboard/common/media.h @@ -64,12 +64,9 @@ std::ostream& operator<<(std::ostream& os, const SbMediaVideoSampleInfo& sample_info); std::ostream& operator<<(std::ostream& os, const SbMediaAudioSampleInfo& sample_info); - -#if SB_API_VERSION >= 15 std::ostream& operator<<(std::ostream& os, const SbMediaVideoStreamInfo& stream_info); std::ostream& operator<<(std::ostream& os, const SbMediaAudioStreamInfo& stream_info); -#endif // SB_API_VERSION >= 15 #endif // STARBOARD_COMMON_MEDIA_H_ diff --git a/starboard/common/string.h b/starboard/common/string.h index 49e6a1bbe7f5..a4b0bcb66cd8 100644 --- a/starboard/common/string.h +++ b/starboard/common/string.h @@ -20,9 +20,7 @@ #define STARBOARD_COMMON_STRING_H_ #include -#if SB_API_VERSION >= 16 #include -#endif #include #include #include diff --git a/starboard/common/time.cc b/starboard/common/time.cc index c90a89a6ec30..7e4b7925c05f 100644 --- a/starboard/common/time.cc +++ b/starboard/common/time.cc @@ -14,23 +14,14 @@ #include "starboard/common/time.h" -#if SB_API_VERSION >= 16 - #include #include #include "starboard/common/log.h" -#else // SB_API_VERSION >= 16 - -#include "starboard/time.h" - -#endif // SB_API_VERSION >= 16 - namespace starboard { int64_t CurrentMonotonicTime() { -#if SB_API_VERSION >= 16 struct timespec ts; if (clock_gettime(CLOCK_MONOTONIC, &ts) != 0) { SB_NOTREACHED() << "clock_gettime(CLOCK_MONOTONIC) failed."; @@ -38,13 +29,9 @@ int64_t CurrentMonotonicTime() { } return (static_cast(ts.tv_sec) * 1000000) + (static_cast(ts.tv_nsec) / 1000); -#else // SB_API_VERSION >= 16 - return SbTimeGetMonotonicNow(); -#endif // SB_API_VERSION >= 16 } int64_t CurrentMonotonicThreadTime() { -#if SB_API_VERSION >= 16 struct timespec ts; if (clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts) != 0) { // This is expected to happen on some systems, like Windows. @@ -52,22 +39,15 @@ int64_t CurrentMonotonicThreadTime() { } return (static_cast(ts.tv_sec) * 1000000) + (static_cast(ts.tv_nsec) / 1000); -#else // SB_API_VERSION >= 16 - return SbTimeGetMonotonicThreadNow(); -#endif // SB_API_VERSION >= 16 } int64_t CurrentPosixTime() { -#if SB_API_VERSION >= 16 struct timeval tv; if (gettimeofday(&tv, NULL) != 0) { SB_NOTREACHED() << "Could not determine time of day."; return 0; } return (static_cast(tv.tv_sec) * 1000000) + tv.tv_usec; -#else // SB_API_VERSION >= 16 - return SbTimeToPosix(SbTimeGetNow()); -#endif // SB_API_VERSION >= 16 } } // namespace starboard diff --git a/starboard/configuration.h b/starboard/configuration.h index 4c667619ea3e..a296f087f75f 100644 --- a/starboard/configuration.h +++ b/starboard/configuration.h @@ -345,11 +345,9 @@ struct CompileAssert {}; #define SB_C_INLINE inline #endif -#if SB_API_VERSION >= 16 #if defined(SB_HAS_QUIRK_SUPPORT_INT16_AUDIO_SAMPLES) #error "SB_HAS_QUIRK_SUPPORT_INT16_AUDIO_SAMPLES is deprecated in SB16 or later" #endif // defined(SB_HAS_QUIRK_SUPPORT_INT16_AUDIO_SAMPLES) -#endif // SB_API_VERSION >= 16 // SB_EXPORT_PLATFORM annotates symbols as exported from shared libraries. // // SB_API_VERSION >= 16 diff --git a/starboard/configuration_constants.h b/starboard/configuration_constants.h index 65823b954ad2..3846715d6267 100644 --- a/starboard/configuration_constants.h +++ b/starboard/configuration_constants.h @@ -141,13 +141,11 @@ SB_EXPORT extern const char* kSbPathSepString; // The maximum size the cache directory is allowed to use in bytes. SB_EXPORT extern const uint32_t kSbMaxSystemPathCacheDirectorySize; -#if SB_API_VERSION >= 16 // Whether this platform can map executable memory. This is required for // platforms that want to JIT. SB_EXPORT extern const bool kSbCanMapExecutableMemory; // Platform can support partial audio frames SB_EXPORT extern const bool kHasPartialAudioFramesSupport; -#endif #endif // STARBOARD_CONFIGURATION_CONSTANTS_H_ diff --git a/starboard/elf_loader/elf_loader_impl.cc b/starboard/elf_loader/elf_loader_impl.cc index 2875e49c2b8e..9574a3fc5be7 100644 --- a/starboard/elf_loader/elf_loader_impl.cc +++ b/starboard/elf_loader/elf_loader_impl.cc @@ -43,15 +43,8 @@ bool EndsWith(const std::string& s, const std::string& suffix) { } // namespace ElfLoaderImpl::ElfLoaderImpl() { -#if SB_API_VERSION >= 16 SB_CHECK(kSbCanMapExecutableMemory) << "Elf_loader requires executable memory support!"; -#else -#if !SB_CAN(MAP_EXECUTABLE_MEMORY) - SB_CHECK(false) << "The elf_loader requires " - "executable memory map support!"; -#endif -#endif } bool ElfLoaderImpl::Load(const char* name, diff --git a/starboard/elf_loader/exported_symbols.cc b/starboard/elf_loader/exported_symbols.cc index 0d85b766298c..57b4d84e3fe8 100644 --- a/starboard/elf_loader/exported_symbols.cc +++ b/starboard/elf_loader/exported_symbols.cc @@ -43,7 +43,6 @@ #include "starboard/microphone.h" #include "starboard/mutex.h" #include "starboard/player.h" -#if SB_API_VERSION >= 16 #include "starboard/shared/modular/starboard_layer_posix_directory_abi_wrappers.h" #include "starboard/shared/modular/starboard_layer_posix_errno_abi_wrappers.h" #include "starboard/shared/modular/starboard_layer_posix_mmap_abi_wrappers.h" @@ -52,7 +51,6 @@ #include "starboard/shared/modular/starboard_layer_posix_stat_abi_wrappers.h" #include "starboard/shared/modular/starboard_layer_posix_time_abi_wrappers.h" #include "starboard/shared/modular/starboard_layer_posix_unistd_abi_wrappers.h" -#endif // SB_API_VERSION >= 16 #include "starboard/socket.h" #include "starboard/socket_waiter.h" #include "starboard/speech_synthesis.h" @@ -96,10 +94,8 @@ ExportedSymbols::ExportedSymbols() { REGISTER_SYMBOL(kSbPathSepChar); REGISTER_SYMBOL(kSbPathSepString); REGISTER_SYMBOL(kSbPreferredRgbaByteOrder); -#if SB_API_VERSION >= 16 REGISTER_SYMBOL(kSbCanMapExecutableMemory); REGISTER_SYMBOL(kHasPartialAudioFramesSupport); -#endif // SB_API_VERSION >= 16 REGISTER_SYMBOL(SbAudioSinkCreate); REGISTER_SYMBOL(SbAudioSinkDestroy); REGISTER_SYMBOL(SbAudioSinkGetMaxChannels); @@ -153,31 +149,17 @@ ExportedSymbols::ExportedSymbols() { REGISTER_SYMBOL(SbMicrophoneRead); REGISTER_SYMBOL(SbPlayerCreate); REGISTER_SYMBOL(SbPlayerDestroy); -#if SB_API_VERSION >= 15 REGISTER_SYMBOL(SbPlayerGetAudioConfiguration); -#endif // SB_API_VERSION >= 15 REGISTER_SYMBOL(SbPlayerGetCurrentFrame); -#if SB_API_VERSION >= 15 REGISTER_SYMBOL(SbPlayerGetInfo); -#else // SB_API_VERSION >= 15 - REGISTER_SYMBOL(SbPlayerGetInfo2); -#endif // SB_API_VERSION >= 15 REGISTER_SYMBOL(SbPlayerGetMaximumNumberOfSamplesPerWrite); REGISTER_SYMBOL(SbPlayerGetPreferredOutputMode); -#if SB_API_VERSION >= 15 REGISTER_SYMBOL(SbPlayerSeek); -#else // SB_API_VERSION >= 15 - REGISTER_SYMBOL(SbPlayerSeek2); -#endif // SB_API_VERSION >= 15 REGISTER_SYMBOL(SbPlayerSetBounds); REGISTER_SYMBOL(SbPlayerSetPlaybackRate); REGISTER_SYMBOL(SbPlayerSetVolume); REGISTER_SYMBOL(SbPlayerWriteEndOfStream); -#if SB_API_VERSION >= 15 REGISTER_SYMBOL(SbPlayerWriteSamples); -#else // SB_API_VERSION >= 15 - REGISTER_SYMBOL(SbPlayerWriteSample2); -#endif // SB_API_VERSION >= 15 REGISTER_SYMBOL(SbSocketAccept); REGISTER_SYMBOL(SbSocketBind); REGISTER_SYMBOL(SbSocketClearLastError); @@ -210,10 +192,8 @@ ExportedSymbols::ExportedSymbols() { REGISTER_SYMBOL(SbSocketWaiterWait); REGISTER_SYMBOL(SbSocketWaiterWaitTimed); REGISTER_SYMBOL(SbSocketWaiterWakeUp); -#if SB_API_VERSION >= 16 REGISTER_SYMBOL(SbPosixSocketWaiterAdd); REGISTER_SYMBOL(SbPosixSocketWaiterRemove); -#endif // SB_API_VERSION >= 16 REGISTER_SYMBOL(SbSpeechSynthesisCancel); REGISTER_SYMBOL(SbSpeechSynthesisIsSupported); REGISTER_SYMBOL(SbSpeechSynthesisSpeak); @@ -225,9 +205,6 @@ ExportedSymbols::ExportedSymbols() { REGISTER_SYMBOL(SbStorageWriteRecord); REGISTER_SYMBOL(SbSystemBreakIntoDebugger); REGISTER_SYMBOL(SbSystemClearLastError); -#if SB_API_VERSION < 15 - REGISTER_SYMBOL(SbSystemGetDeviceType); -#endif REGISTER_SYMBOL(SbSystemGetErrorString); REGISTER_SYMBOL(SbSystemGetExtension); REGISTER_SYMBOL(SbSystemGetLastError); @@ -258,18 +235,13 @@ ExportedSymbols::ExportedSymbols() { REGISTER_SYMBOL(SbSystemSymbolize); REGISTER_SYMBOL(SbThreadContextGetPointer); REGISTER_SYMBOL(SbThreadGetId); -#if SB_API_VERSION >= 16 REGISTER_SYMBOL(SbThreadGetPriority); -#endif // SB_API_VERSION >= 16 - REGISTER_SYMBOL(SbThreadSamplerCreate); REGISTER_SYMBOL(SbThreadSamplerDestroy); REGISTER_SYMBOL(SbThreadSamplerFreeze); REGISTER_SYMBOL(SbThreadSamplerIsSupported); REGISTER_SYMBOL(SbThreadSamplerThaw); -#if SB_API_VERSION >= 16 REGISTER_SYMBOL(SbThreadSetPriority); -#endif // SB_API_VERSION >= 16 REGISTER_SYMBOL(SbTimeZoneGetCurrent); REGISTER_SYMBOL(SbTimeZoneGetName); REGISTER_SYMBOL(SbWindowCreate); @@ -279,7 +251,6 @@ ExportedSymbols::ExportedSymbols() { REGISTER_SYMBOL(SbWindowGetSize); REGISTER_SYMBOL(SbWindowSetDefaultOptions); -#if SB_API_VERSION >= 16 // POSIX APIs REGISTER_SYMBOL(accept); REGISTER_SYMBOL(bind); @@ -437,8 +408,6 @@ ExportedSymbols::ExportedSymbols() { REGISTER_SYMBOL(vswprintf); #endif // defined(_MSC_VER) -#endif // SB_API_VERSION >= 16 - } // NOLINT const void* ExportedSymbols::Lookup(const char* name) { diff --git a/starboard/elf_loader/program_table.cc b/starboard/elf_loader/program_table.cc index 3dcb3e26a7de..6ef94b4fe4bc 100644 --- a/starboard/elf_loader/program_table.cc +++ b/starboard/elf_loader/program_table.cc @@ -43,15 +43,8 @@ ProgramTable::ProgramTable( load_size_(0), base_memory_address_(0), memory_mapped_file_extension_(memory_mapped_file_extension) { -#if SB_API_VERSION >= 16 SB_CHECK(kSbCanMapExecutableMemory) << "This module requires executable memory support!"; -#else -#if !SB_CAN(MAP_EXECUTABLE_MEMORY) - SB_CHECK(false) << "This module requires " - "executable memory map support!"; -#endif -#endif } bool ProgramTable::LoadProgramHeader(const Ehdr* elf_header, File* elf_file) { diff --git a/starboard/event.h b/starboard/event.h index 2f885d59df02..f4c12be89340 100644 --- a/starboard/event.h +++ b/starboard/event.h @@ -333,14 +333,12 @@ static SB_C_FORCE_INLINE bool SbEventIsIdValid(SbEventId handle) { return handle != kSbEventIdInvalid; } -#if SB_API_VERSION >= 15 typedef void (*SbEventHandleCallback)(const SbEvent* event); // Serves as the entry point in the Starboard library for running the Starboard // event loop with the application event handler. SB_EXPORT int SbRunStarboardMain(int argc, char** argv, SbEventHandleCallback callback); -#endif // SB_API_VERSION >= 15 // The entry point that Starboard applications MUST implement. Any memory // pointed at by |event| or the |data| field inside |event| is owned by the // system, and that memory is reclaimed after this function returns, so the @@ -352,11 +350,7 @@ SB_EXPORT int SbRunStarboardMain(int argc, // specification about what other work might happen on this thread, so the // application should generally do as little work as possible on this thread, // and just dispatch it over to another thread. -#if SB_API_VERSION >= 15 SB_EXPORT_PLATFORM void SbEventHandle(const SbEvent* event); -#else -SB_IMPORT void SbEventHandle(const SbEvent* event); -#endif // SB_API_VERSION >= 15 // Schedules an event |callback| into the main Starboard event loop. // This function may be called from any thread, but |callback| is always diff --git a/starboard/extension/enhanced_audio_test.cc b/starboard/extension/enhanced_audio_test.cc index c11598ba7c33..c2c7563aac78 100644 --- a/starboard/extension/enhanced_audio_test.cc +++ b/starboard/extension/enhanced_audio_test.cc @@ -24,8 +24,6 @@ namespace starboard { namespace extension { -#if SB_API_VERSION >= 15 - TEST(EnhancedAudioTest, VerifyBinaryLayouts) { // Sanity check that the layouts of the extension specific types are the same // as corresponding SbMedia and SbPlayer types. @@ -110,7 +108,5 @@ TEST(EnhancedAudioTest, VerifyBinaryLayouts) { offsetof(SbPlayerSampleInfo, drm_info)); } -#endif // SB_API_VERSION >= 15 - } // namespace extension } // namespace starboard diff --git a/starboard/extension/on_screen_keyboard.h b/starboard/extension/on_screen_keyboard.h index c49f22e59631..5c7a23706996 100644 --- a/starboard/extension/on_screen_keyboard.h +++ b/starboard/extension/on_screen_keyboard.h @@ -25,8 +25,6 @@ extern "C" { #define kCobaltExtensionOnScreenKeyboardName \ "dev.cobalt.extension.OnScreenKeyboard" -#if SB_API_VERSION >= 16 - // System-triggered OnScreenKeyboard events have ticket value // kSbEventOnScreenKeyboardInvalidTicket. #define kSbEventOnScreenKeyboardInvalidTicket (-1) @@ -40,8 +38,6 @@ typedef struct SbWindowRect { float height; } SbWindowRect; -#endif // #if SB_API_VERSION >= 16 - typedef struct CobaltExtensionOnScreenKeyboardApi { // Name should be the string // |kCobaltExtensionOnScreenKeyboardName|. This helps to validate that diff --git a/starboard/key.h b/starboard/key.h index a0762f416bba..d71ec2f06e04 100644 --- a/starboard/key.h +++ b/starboard/key.h @@ -215,9 +215,7 @@ typedef enum SbKey { kSbKeyYellow = 0x195, kSbKeyBlue = 0x196, -#if SB_API_VERSION >= 15 kSbKeyRecord = 0x1A0, -#endif kSbKeyChannelUp = 0x1AB, kSbKeyChannelDown = 0x1AC, kSbKeySubtitle = 0x1CC, diff --git a/starboard/linux/shared/configuration_constants.cc b/starboard/linux/shared/configuration_constants.cc index 03688816a91a..48ac1e2e9554 100644 --- a/starboard/linux/shared/configuration_constants.cc +++ b/starboard/linux/shared/configuration_constants.cc @@ -125,9 +125,7 @@ const int kSbPreferredRgbaByteOrder = SB_PREFERRED_RGBA_BYTE_ORDER_RGBA; // The maximum size the cache directory is allowed to use in bytes. const uint32_t kSbMaxSystemPathCacheDirectorySize = 24 << 20; // 24MiB -#if SB_API_VERSION >= 16 SB_EXPORT extern const bool kSbCanMapExecutableMemory = true; // Platform can support partial audio frames SB_EXPORT extern const bool kHasPartialAudioFramesSupport = true; -#endif diff --git a/starboard/linux/shared/system_get_extensions.cc b/starboard/linux/shared/system_get_extensions.cc index 454bf3abe3f8..70f80c2db680 100644 --- a/starboard/linux/shared/system_get_extensions.cc +++ b/starboard/linux/shared/system_get_extensions.cc @@ -71,11 +71,6 @@ const void* SbSystemGetExtension(const char* name) { if (strcmp(name, kCobaltExtensionFreeSpaceName) == 0) { return starboard::shared::posix::GetFreeSpaceApi(); } -#if SB_API_VERSION < 15 - if (strcmp(name, kCobaltExtensionEnhancedAudioName) == 0) { - return starboard::shared::enhanced_audio::GetEnhancedAudioApi(); - } -#endif // SB_API_VERSION < 15 if (strcmp(name, kCobaltExtensionDemuxerApi) == 0) { auto command_line = starboard::shared::starboard::Application::Get()->GetCommandLine(); diff --git a/starboard/linux/x64x11/main.cc b/starboard/linux/x64x11/main.cc index 58137c4e2778..a70a3adb44cd 100644 --- a/starboard/linux/x64x11/main.cc +++ b/starboard/linux/x64x11/main.cc @@ -62,16 +62,8 @@ extern "C" SB_EXPORT_PLATFORM int main(int argc, char** argv) { SbLogRawDumpStack(3); #endif -#if SB_API_VERSION >= 15 int result = SbRunStarboardMain(argc, argv, SbEventHandle); -#else - starboard::shared::x11::ApplicationX11 application; - int result = 0; - { - starboard::shared::starboard::LinkReceiver receiver(&application); - result = application.Run(argc, argv); - } -#endif // SB_API_VERSION >= 15 + starboard::shared::signal::UninstallSuspendSignalHandlers(); starboard::shared::signal::UninstallDebugSignalHandlers(); starboard::shared::signal::UninstallCrashSignalHandlers(); diff --git a/starboard/linux/x64x11/run_starboard_main.cc b/starboard/linux/x64x11/run_starboard_main.cc index 813e1df5716e..96b605f96a68 100644 --- a/starboard/linux/x64x11/run_starboard_main.cc +++ b/starboard/linux/x64x11/run_starboard_main.cc @@ -17,7 +17,6 @@ #include "starboard/shared/starboard/link_receiver.h" #include "starboard/shared/x11/application_x11.h" -#if SB_API_VERSION >= 15 int SbRunStarboardMain(int argc, char** argv, SbEventHandleCallback callback) { starboard::shared::x11::ApplicationX11 application(callback); int result = 0; @@ -27,4 +26,3 @@ int SbRunStarboardMain(int argc, char** argv, SbEventHandleCallback callback) { } return result; } -#endif // SB_API_VERSION >= 15 diff --git a/starboard/linux/x64x11/system_get_property_impl.cc b/starboard/linux/x64x11/system_get_property_impl.cc index aaa660f57251..727a9b3fc1e8 100644 --- a/starboard/linux/x64x11/system_get_property_impl.cc +++ b/starboard/linux/x64x11/system_get_property_impl.cc @@ -117,11 +117,9 @@ bool GetSystemProperty(SbSystemPropertyId property_id, return CopyStringAndTestIfSuccess( out_value, value_length, GetEnvironment("COBALT_LIMIT_AD_TRACKING").c_str()); -#if SB_API_VERSION >= 15 case kSbSystemPropertyDeviceType: return CopyStringAndTestIfSuccess(out_value, value_length, kSystemDeviceTypeDesktopPC); -#endif default: SB_DLOG(WARNING) << __FUNCTION__ << ": Unrecognized property: " << property_id; diff --git a/starboard/media.h b/starboard/media.h index 2227ad7de07c..6bddea5a0c3d 100644 --- a/starboard/media.h +++ b/starboard/media.h @@ -65,9 +65,7 @@ typedef enum SbMediaAudioCodec { kSbMediaAudioCodecMp3, kSbMediaAudioCodecFlac, kSbMediaAudioCodecPcm, -#if SB_API_VERSION >= 15 kSbMediaAudioCodecIamf, -#endif // SB_API_VERSION >= 15 } SbMediaAudioCodec; // Indicates how confident the device is that it can play media resources of the @@ -87,28 +85,17 @@ typedef enum SbMediaSupportType { // Possible audio connector types. typedef enum SbMediaAudioConnector { -#if SB_API_VERSION >= 15 kSbMediaAudioConnectorUnknown, -#else // SB_API_VERSION >= 15 - kSbMediaAudioConnectorNone, -#endif // SB_API_VERSION >= 15 - kSbMediaAudioConnectorAnalog, kSbMediaAudioConnectorBluetooth, -#if SB_API_VERSION >= 15 kSbMediaAudioConnectorBuiltIn, -#endif // SB_API_VERSION >= 15 kSbMediaAudioConnectorHdmi, -#if SB_API_VERSION >= 15 // A wired remote audio output, like a remote speaker via Ethernet. kSbMediaAudioConnectorRemoteWired, // A wireless remote audio output, like a remote speaker via Wi-Fi. kSbMediaAudioConnectorRemoteWireless, // A remote audio output cannot be classified into other existing types. kSbMediaAudioConnectorRemoteOther, -#else // SB_API_VERSION >= 15 - kSbMediaAudioConnectorNetwork, -#endif // SB_API_VERSION >= 15 kSbMediaAudioConnectorSpdif, kSbMediaAudioConnectorUsb, } SbMediaAudioConnector; @@ -384,8 +371,6 @@ typedef struct SbMediaColorMetadata { float custom_primary_matrix[12]; } SbMediaColorMetadata; -#if SB_API_VERSION >= 15 - // The set of information required by the decoder or player for each video // stream. typedef struct SbMediaVideoStreamInfo { @@ -441,68 +426,11 @@ typedef struct SbMediaVideoSampleInfo { bool is_key_frame; } SbMediaVideoSampleInfo; -#else // SB_API_VERSION >= 15 - -// The set of information required by the decoder or player for each video -// sample. -typedef struct SbMediaVideoSampleInfo { - // The video codec of this sample. - SbMediaVideoCodec codec; - - // The mime of the video stream when |codec| isn't kSbMediaVideoCodecNone. It - // may point to an empty string if the mime is not available, and it can only - // be set to NULL when |codec| is kSbMediaVideoCodecNone. - const char* mime; - - // Indicates the max video capabilities required. The web app will not provide - // a video stream exceeding the maximums described by this parameter. Allows - // the platform to optimize playback pipeline for low quality video streams if - // it knows that it will never adapt to higher quality streams. The string - // uses the same format as the string passed in to - // SbMediaCanPlayMimeAndKeySystem(), for example, when it is set to - // "width=1920; height=1080; framerate=15;", the video will never adapt to - // resolution higher than 1920x1080 or frame per second higher than 15 fps. - // When the maximums are unknown, this will be set to an empty string. It can - // only be set to NULL when |codec| is kSbMediaVideoCodecNone. - const char* max_video_capabilities; - - // Indicates whether the associated sample is a key frame (I-frame). Video key - // frames must always start with SPS and PPS NAL units. - bool is_key_frame; - - // The frame width of this sample, in pixels. Also could be parsed from the - // Sequence Parameter Set (SPS) NAL Unit. Frame dimensions must only change on - // key frames, but may change on any key frame. - int frame_width; - - // The frame height of this sample, in pixels. Also could be parsed from the - // Sequence Parameter Set (SPS) NAL Unit. Frame dimensions must only change on - // key frames, but may change on any key frame. - int frame_height; - - // HDR metadata common for HDR10 and WebM/VP9-based HDR formats as - // well as the Color Space, and Color elements: MatrixCoefficients, - // BitsPerChannel, ChromaSubsamplingHorz, ChromaSubsamplingVert, - // CbSubsamplingHorz, CbSubsamplingVert, ChromaSitingHorz, - // ChromaSitingVert, Range, TransferCharacteristics, and Primaries - // described here: https://matroska.org/technical/specs/index.html . - // This will only be specified on frames where the HDR metadata and - // color / color space might have changed (e.g. keyframes). - SbMediaColorMetadata color_metadata; -} SbMediaVideoSampleInfo, SbMediaVideoStreamInfo; - -#endif // SB_API_VERSION >= 15 - // A structure describing the audio configuration parameters of a single audio // output. typedef struct SbMediaAudioConfiguration { -#if SB_API_VERSION >= 15 // The type of audio connector. Will be |kSbMediaAudioConnectorUnknown| if // this device cannot provide this information. -#else // SB_API_VERSION >= 15 - // The type of audio connector. Will be the empty |kSbMediaAudioConnectorNone| - // if this device cannot provide this information. -#endif // SB_API_VERSION >= 15 SbMediaAudioConnector connector; // The expected latency of audio over this output, in microseconds, or |0| if @@ -518,8 +446,6 @@ typedef struct SbMediaAudioConfiguration { int number_of_channels; } SbMediaAudioConfiguration; -#if SB_API_VERSION >= 15 - // The set of information required by the decoder or player for each audio // stream. typedef struct SbMediaAudioStreamInfo { @@ -556,51 +482,6 @@ typedef struct SbMediaAudioSampleInfo { int64_t discarded_duration_from_back; // in microseconds. } SbMediaAudioSampleInfo; -#else // SB_API_VERSION >= 15 - -// An audio sample info, which is a description of a given audio sample. This -// acts as a set of instructions to the audio decoder. -// -// The audio sample info consists of information found in the |WAVEFORMATEX| -// structure, as well as other information for the audio decoder, including the -// Audio-specific configuration field. The |WAVEFORMATEX| structure is -// specified at http://msdn.microsoft.com/en-us/library/dd390970(v=vs.85).aspx . -typedef struct SbMediaAudioSampleInfo { - // The audio codec of this sample. - SbMediaAudioCodec codec; - - // The mime of the audio stream when |codec| isn't kSbMediaAudioCodecNone. It - // may point to an empty string if the mime is not available, and it can only - // be set to NULL when |codec| is kSbMediaAudioCodecNone. - const char* mime; - - // The waveform-audio format type code. - uint16_t format_tag; - - // The number of audio channels in this format. |1| for mono, |2| for stereo. - uint16_t number_of_channels; - - // The sampling rate. - uint32_t samples_per_second; - - // The number of bytes per second expected with this format. - uint32_t average_bytes_per_second; - - // Byte block alignment, e.g., 4. - uint16_t block_alignment; - - // The bit depth for the stream this represents, e.g. |8| or |16|. - uint16_t bits_per_sample; - - // The size, in bytes, of the audio_specific_config. - uint16_t audio_specific_config_size; - - // The AudioSpecificConfig, as specified in ISO/IEC-14496-3, section 1.6.2.1. - const void* audio_specific_config; -} SbMediaAudioSampleInfo, SbMediaAudioStreamInfo; - -#endif // SB_API_VERSION >= 15 - // --- Functions ------------------------------------------------------------- // Returns information about whether the playback of the specific media diff --git a/starboard/nplb/audio_sink_is_audio_sample_type_supported_test.cc b/starboard/nplb/audio_sink_is_audio_sample_type_supported_test.cc index 73cbab0bdd96..c5ee2ad2569c 100644 --- a/starboard/nplb/audio_sink_is_audio_sample_type_supported_test.cc +++ b/starboard/nplb/audio_sink_is_audio_sample_type_supported_test.cc @@ -18,8 +18,6 @@ namespace starboard { namespace nplb { -#if SB_API_VERSION >= 16 - TEST(SbAudioSinkIsAudioSampleTypeSupportedTest, SunnyDay) { bool float32_supported = SbAudioSinkIsAudioSampleTypeSupported(kSbMediaAudioSampleTypeFloat32); @@ -31,18 +29,5 @@ TEST(SbAudioSinkIsAudioSampleTypeSupportedTest, SunnyDay) { SbAudioSinkIsAudioSampleTypeSupported(kSbMediaAudioSampleTypeInt16Deprecated); } -#else // SB_API_VERSION >= 16 - -TEST(SbAudioSinkIsAudioSampleTypeSupportedTest, SunnyDay) { - bool int16_supported = SbAudioSinkIsAudioSampleTypeSupported( - kSbMediaAudioSampleTypeInt16Deprecated); - bool float32_supported = - SbAudioSinkIsAudioSampleTypeSupported(kSbMediaAudioSampleTypeFloat32); - // A platform must support at least one of the sample types. - EXPECT_TRUE(int16_supported || float32_supported); -} - -#endif // SB_API_VERSION >= 16 - } // namespace nplb } // namespace starboard diff --git a/starboard/nplb/media_buffer_test.cc b/starboard/nplb/media_buffer_test.cc index 875042817fb9..32203009bfa1 100644 --- a/starboard/nplb/media_buffer_test.cc +++ b/starboard/nplb/media_buffer_test.cc @@ -166,7 +166,6 @@ TEST(SbMediaBufferTest, Alignment) { // the test logic in one place. int alignment = SbMediaGetBufferAlignment(); -#if SB_API_VERSION >= 16 // SbMediaGetBufferAlignment() was deprecated in Starboard 16, its return // value is no longer used when allocating media buffers. This is verified // explicitly here by ensuring its return value is sizeof(void*). @@ -175,11 +174,6 @@ TEST(SbMediaBufferTest, Alignment) { // An implementation that has specific alignment requirement should check // the alignment of the incoming buffer, and make a copy when necessary. EXPECT_EQ(alignment, sizeof(void*)); -#else // SB_API_VERSION >= 16 - EXPECT_GE(alignment, 1); - EXPECT_EQ(alignment & (alignment - 1), 0) - << "Alignment must always be a power of 2"; -#endif // SB_API_VERSION >= 16 } } @@ -238,17 +232,12 @@ TEST(SbMediaBufferTest, MaxCapacity) { } TEST(SbMediaBufferTest, Padding) { -#if SB_API_VERSION >= 16 // SbMediaGetBufferPadding() was deprecated in Starboard 16, its return value // is no longer used when allocating media buffers. This is verified // explicitly here by ensuring its return value is 0. // An implementation that has specific padding requirement should make a // copy of the incoming buffer when necessary. EXPECT_EQ(SbMediaGetBufferPadding(), 0); - -#else // SB_API_VERSION >= 16 - EXPECT_GE(SbMediaGetBufferPadding(), 0); -#endif // SB_API_VERSION >= 16 } TEST(SbMediaBufferTest, PoolAllocateOnDemand) { diff --git a/starboard/nplb/media_can_play_mime_and_key_system_test.cc b/starboard/nplb/media_can_play_mime_and_key_system_test.cc index 6c2619942b4e..e2d08a9e31e1 100644 --- a/starboard/nplb/media_can_play_mime_and_key_system_test.cc +++ b/starboard/nplb/media_can_play_mime_and_key_system_test.cc @@ -793,11 +793,7 @@ TEST(SbMediaCanPlayMimeAndKeySystem, ValidateQueriesUnderPeakCapability) { } TEST(SbMediaCanPlayMimeAndKeySystem, VerifyMaxBitrate) { -#if SB_API_VERSION >= 15 constexpr int kAv14kBitrate = 40000000; -#else - constexpr int kAv14kBitrate = 42000000; -#endif // SB_API_VERSION >= 15 const std::pair kCodecSupportQueries[] = { {// AV1 1080P SDR diff --git a/starboard/nplb/media_set_audio_write_duration_test.cc b/starboard/nplb/media_set_audio_write_duration_test.cc index 5c9d67ecc1fb..45b14758ea70 100644 --- a/starboard/nplb/media_set_audio_write_duration_test.cc +++ b/starboard/nplb/media_set_audio_write_duration_test.cc @@ -59,13 +59,8 @@ class SbMediaSetAudioWriteDurationTest } // Check if we're about to input too far beyond the current playback time. -#if SB_API_VERSION >= 15 SbPlayerInfo info; SbPlayerGetInfo(pending_decoder_status_->player, &info); -#else // SB_API_VERSION >= 15 - SbPlayerInfo2 info; - SbPlayerGetInfo2(pending_decoder_status_->player, &info); -#endif // SB_API_VERSION >= 15 if ((last_input_timestamp_ - info.current_media_timestamp) > kDuration) { // Postpone writing samples. return; @@ -190,30 +185,18 @@ TEST_P(SbMediaSetAudioWriteDurationTest, WriteLimitedInput) { WaitForPlayerState(kSbPlayerStateInitialized); // Seek to preroll. -#if SB_API_VERSION >= 15 SbPlayerSeek(player, first_input_timestamp_, /* ticket */ 1); -#else // SB_API_VERSION >= 15 - SbPlayerSeek2(player, first_input_timestamp_, /* ticket */ 1); -#endif // SB_API_VERSION >= 15 WaitForPlayerState(kSbPlayerStatePresenting); // Wait until the playback time is > 0. const int64_t kMaxWaitTime = 5'000'000; // 5 seconds int64_t start_of_wait = CurrentMonotonicTime(); -#if SB_API_VERSION >= 15 SbPlayerInfo info = {}; -#else // SB_API_VERSION >= 15 - SbPlayerInfo2 info = {}; -#endif // SB_API_VERSION >= 15 while (CurrentMonotonicTime() - start_of_wait < kMaxWaitTime && info.current_media_timestamp == 0) { usleep(500'000); -#if SB_API_VERSION >= 15 SbPlayerGetInfo(player, &info); -#else // SB_API_VERSION >= 15 - SbPlayerGetInfo2(player, &info); -#endif // SB_API_VERSION >= 15 } EXPECT_GT(info.current_media_timestamp, 0); @@ -232,11 +215,7 @@ TEST_P(SbMediaSetAudioWriteDurationTest, WriteContinuedLimitedInput) { WaitForPlayerState(kSbPlayerStateInitialized); // Seek to preroll. -#if SB_API_VERSION >= 15 SbPlayerSeek(player, first_input_timestamp_, /* ticket */ 1); -#else // SB_API_VERSION >= 15 - SbPlayerSeek2(player, first_input_timestamp_, /* ticket */ 1); -#endif // SB_API_VERSION >= 15 WaitForPlayerState(kSbPlayerStatePresenting); // Wait for the player to play far enough. It may not play all the way to @@ -244,20 +223,11 @@ TEST_P(SbMediaSetAudioWriteDurationTest, WriteContinuedLimitedInput) { int64_t min_ending_playback_time = total_duration_ - kDuration; int64_t start_of_wait = CurrentMonotonicTime(); const int64_t kMaxWaitTime = total_duration_ + 5'000'000LL; -#if SB_API_VERSION >= 15 SbPlayerInfo info; SbPlayerGetInfo(player, &info); -#else // SB_API_VERSION >= 15 - SbPlayerInfo2 info; - SbPlayerGetInfo2(player, &info); -#endif // SB_API_VERSION >= 15 while (info.current_media_timestamp < min_ending_playback_time && (CurrentMonotonicTime() - start_of_wait) < kMaxWaitTime) { -#if SB_API_VERSION >= 15 SbPlayerGetInfo(player, &info); -#else // SB_API_VERSION >= 15 - SbPlayerGetInfo2(player, &info); -#endif // SB_API_VERSION >= 15 usleep(kSmallWaitInterval); TryToWritePendingSample(); } diff --git a/starboard/nplb/nplb_evergreen_compat_tests/executable_memory_test.cc b/starboard/nplb/nplb_evergreen_compat_tests/executable_memory_test.cc index 5ad1d19d2434..b79d355e2b1e 100644 --- a/starboard/nplb/nplb_evergreen_compat_tests/executable_memory_test.cc +++ b/starboard/nplb/nplb_evergreen_compat_tests/executable_memory_test.cc @@ -31,10 +31,8 @@ const size_t kSmallerSize = 15 * 1024 * 1024; class ExecutableMemoryTest : public ::testing::Test { protected: ExecutableMemoryTest() { -#if SB_API_VERSION >= 16 SB_DCHECK(kSbCanMapExecutableMemory) << "Evergreen requires executable memory support!"; -#endif } ~ExecutableMemoryTest() {} }; diff --git a/starboard/nplb/player_create_test.cc b/starboard/nplb/player_create_test.cc index 5dd8c2567f74..20d0d6a6b52e 100644 --- a/starboard/nplb/player_create_test.cc +++ b/starboard/nplb/player_create_test.cc @@ -334,9 +334,7 @@ TEST_F(SbPlayerTest, MultiPlayer) { kSbMediaAudioCodecMp3, kSbMediaAudioCodecFlac, kSbMediaAudioCodecPcm, -#if SB_API_VERSION >= 15 kSbMediaAudioCodecIamf, -#endif // SB_API_VERSION >= 15 }; // clang-format on @@ -355,9 +353,7 @@ TEST_F(SbPlayerTest, MultiPlayer) { case kAudioCodecs[6]: case kAudioCodecs[7]: case kAudioCodecs[8]: -#if SB_API_VERSION >= 15 case kAudioCodecs[9]: -#endif // SB_API_VERSION >= 15 break; } diff --git a/starboard/nplb/player_creation_param_helpers.cc b/starboard/nplb/player_creation_param_helpers.cc index a9dfc3c58aba..fc41c27c443a 100644 --- a/starboard/nplb/player_creation_param_helpers.cc +++ b/starboard/nplb/player_creation_param_helpers.cc @@ -92,14 +92,12 @@ AudioStreamInfo CreateAudioStreamInfo(SbMediaAudioCodec codec) { audio_stream_info.bits_per_sample = 32; break; } -#if SB_API_VERSION >= 15 case kSbMediaAudioCodecIamf: { audio_stream_info.number_of_channels = 2; audio_stream_info.samples_per_second = 48000; audio_stream_info.bits_per_sample = 32; break; } -#endif // SB_API_VERSION >= 15 } return audio_stream_info; } diff --git a/starboard/nplb/player_creation_param_helpers.h b/starboard/nplb/player_creation_param_helpers.h index 3c607dcdbe99..a068dbfda3fc 100644 --- a/starboard/nplb/player_creation_param_helpers.h +++ b/starboard/nplb/player_creation_param_helpers.h @@ -50,13 +50,8 @@ struct PlayerCreationParam { creation_param->drm_system = drm_system; -#if SB_API_VERSION >= 15 audio_stream_info.ConvertTo(&creation_param->audio_stream_info); video_stream_info.ConvertTo(&creation_param->video_stream_info); -#else // SB_API_VERSION >= 15 - audio_stream_info.ConvertTo(&creation_param->audio_sample_info); - video_stream_info.ConvertTo(&creation_param->video_sample_info); -#endif // SB_API_VERSION >= 15 creation_param->output_mode = output_mode; } diff --git a/starboard/nplb/player_get_audio_configuration_test.cc b/starboard/nplb/player_get_audio_configuration_test.cc index 7cd5a7e5a8bc..8a2bb8818d48 100644 --- a/starboard/nplb/player_get_audio_configuration_test.cc +++ b/starboard/nplb/player_get_audio_configuration_test.cc @@ -19,8 +19,6 @@ #include "starboard/testing/fake_graphics_context_provider.h" #include "testing/gtest/include/gtest/gtest.h" -#if SB_API_VERSION >= 15 - bool operator==(const SbMediaAudioConfiguration& left, const SbMediaAudioConfiguration& right) { return memcmp(&left, &right, sizeof(SbMediaAudioConfiguration)) == 0; @@ -275,5 +273,3 @@ INSTANTIATE_TEST_CASE_P(SbPlayerGetAudioConfigurationTests, } // namespace } // namespace nplb } // namespace starboard - -#endif // SB_API_VERSION >= 15 diff --git a/starboard/nplb/player_get_preferred_output_mode_test.cc b/starboard/nplb/player_get_preferred_output_mode_test.cc index 69e5be37b511..d38502a68e23 100644 --- a/starboard/nplb/player_get_preferred_output_mode_test.cc +++ b/starboard/nplb/player_get_preferred_output_mode_test.cc @@ -56,9 +56,7 @@ TEST(SbPlayerGetPreferredOutputModeTest, AllCodecs) { kSbMediaAudioCodecMp3, kSbMediaAudioCodecFlac, kSbMediaAudioCodecPcm, -#if SB_API_VERSION >= 15 kSbMediaAudioCodecIamf, -#endif // SB_API_VERSION >= 15 }; const SbMediaVideoCodec kVideoCodecs[] = { kSbMediaVideoCodecNone, diff --git a/starboard/nplb/player_test_fixture.cc b/starboard/nplb/player_test_fixture.cc index 6aaf93a8b958..30700e23cf45 100644 --- a/starboard/nplb/player_test_fixture.cc +++ b/starboard/nplb/player_test_fixture.cc @@ -250,11 +250,7 @@ void SbPlayerTestFixture::Seek(const int64_t time) { audio_end_of_stream_written_ = false; video_end_of_stream_written_ = false; -#if SB_API_VERSION >= 15 SbPlayerSeek(player_, time, ++ticket_); -#else // SB_API_VERSION >= 15 - SbPlayerSeek2(player_, time, ++ticket_); -#endif // SB_API_VERSION >= 15 } void SbPlayerTestFixture::Write(const GroupedSamples& grouped_samples) { @@ -349,13 +345,8 @@ void SbPlayerTestFixture::WaitForPlayerEndOfStream() { } int64_t SbPlayerTestFixture::GetCurrentMediaTime() const { -#if SB_API_VERSION >= 15 SbPlayerInfo info = {}; SbPlayerGetInfo(player_, &info); -#else // SB_API_VERSION >= 15 - SbPlayerInfo2 info = {}; - SbPlayerGetInfo2(player_, &info); -#endif // SB_API_VERSION >= 15 return info.current_media_timestamp; } diff --git a/starboard/nplb/player_test_util.cc b/starboard/nplb/player_test_util.cc index ea288faa4b2b..2b8f202717af 100644 --- a/starboard/nplb/player_test_util.cc +++ b/starboard/nplb/player_test_util.cc @@ -56,10 +56,8 @@ const char* kAudioOnlyTestFiles[] = { "beneath_the_canopy_opus_5_1.dmp", "beneath_the_canopy_opus_mono.dmp", "heaac.dmp", -#if SB_API_VERSION >= 15 "iamf_base_profile_stereo_ambisonics.dmp", "iamf_simple_profile_5_1.dmp", -#endif // SB_API_VERSION >= 15 "sintel_5s_pcm_s16le.dmp", "sintel_5s_flac.dmp", #if defined(ENABLE_CAST_CODEC_TESTS) @@ -297,9 +295,7 @@ void CallSbPlayerWriteSamples( static auto const* enhanced_audio_extension = static_cast( SbSystemGetExtension(kCobaltExtensionEnhancedAudioName)); -#if SB_API_VERSION >= 15 ASSERT_FALSE(enhanced_audio_extension); -#endif // SB_API_VERSION >= 15 if (enhanced_audio_extension) { ASSERT_STREQ(enhanced_audio_extension->name, @@ -355,7 +351,6 @@ void CallSbPlayerWriteSamples( sample_infos.push_back( dmp_reader->GetPlayerSampleInfo(sample_type, start_index++)); sample_infos.back().timestamp += timestamp_offset; -#if SB_API_VERSION >= 15 if (!discarded_durations_from_front.empty()) { sample_infos.back().audio_sample_info.discarded_duration_from_front = discarded_durations_from_front[i]; @@ -364,15 +359,9 @@ void CallSbPlayerWriteSamples( sample_infos.back().audio_sample_info.discarded_duration_from_back = discarded_durations_from_back[i]; } -#endif // SB_API_VERSION >= 15 } -#if SB_API_VERSION >= 15 SbPlayerWriteSamples(player, sample_type, sample_infos.data(), number_of_samples_to_write); -#else // SB_API_VERSION >= 15 - SbPlayerWriteSample2(player, sample_type, sample_infos.data(), - number_of_samples_to_write); -#endif // SB_API_VERSION >= 15 } bool IsOutputModeSupported(SbPlayerOutputMode output_mode, @@ -407,15 +396,7 @@ bool IsOutputModeSupported(SbPlayerOutputMode output_mode, } bool IsPartialAudioSupported() { -#if SB_API_VERSION >= 15 -#if SB_API_VERSION >= 16 return kHasPartialAudioFramesSupport; -#else - return true; -#endif -#else // SB_API_VERSION >= 15 - return SbSystemGetExtension(kCobaltExtensionEnhancedAudioName) != nullptr; -#endif // SB_API_VERSION >= 15 } bool IsAudioPassthroughUsed(const SbPlayerTestConfig& config) { diff --git a/starboard/nplb/posix_compliance/posix_condition_variable_wait_timed_test.cc b/starboard/nplb/posix_compliance/posix_condition_variable_wait_timed_test.cc index 811a6d470b99..7550f0f78f43 100644 --- a/starboard/nplb/posix_compliance/posix_condition_variable_wait_timed_test.cc +++ b/starboard/nplb/posix_compliance/posix_condition_variable_wait_timed_test.cc @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if SB_API_VERSION >= 16 - #include #include @@ -218,5 +216,3 @@ TEST(PosixConditionVariableWaitTimedTest, FLAKY_SunnyDayNearMaxTime) { } // namespace } // namespace nplb } // namespace starboard - -#endif // SB_API_VERSION >= 16 diff --git a/starboard/nplb/posix_compliance/posix_file_mode_string_to_flags_test.cc b/starboard/nplb/posix_compliance/posix_file_mode_string_to_flags_test.cc index 66349e21c7bd..2e87b61fb20a 100644 --- a/starboard/nplb/posix_compliance/posix_file_mode_string_to_flags_test.cc +++ b/starboard/nplb/posix_compliance/posix_file_mode_string_to_flags_test.cc @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if SB_API_VERSION >= 16 - #include #include @@ -54,5 +52,3 @@ TEST(PosixFileModeStringToFlagsTest, AppendMode) { } // namespace } // namespace nplb } // namespace starboard - -#endif // SB_API_VERSION >= 16 diff --git a/starboard/nplb/posix_compliance/posix_file_open_test.cc b/starboard/nplb/posix_compliance/posix_file_open_test.cc index 5b329da2a392..478ad9e252a5 100644 --- a/starboard/nplb/posix_compliance/posix_file_open_test.cc +++ b/starboard/nplb/posix_compliance/posix_file_open_test.cc @@ -104,15 +104,11 @@ TEST(PosixFileOpenTest, OpenAlwaysCreatesNonExistingFile) { BasicTest(false, O_CREAT | O_WRONLY, true, __LINE__); } -#if SB_API_VERSION >= 16 - TEST(PosixFileOpenTest, OpenAlwaysWithLinuxSpecificMode) { BasicTest(false, O_CREAT | O_TRUNC | O_WRONLY, true, __LINE__, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); } -#endif // SB_API_VERSION >= 16 - TEST(PosixFileOpenTest, CreateAlwaysTruncatesExistingFile) { BasicTest(true, O_CREAT | O_TRUNC | O_WRONLY, true, __LINE__); } diff --git a/starboard/nplb/system_get_property_test.cc b/starboard/nplb/system_get_property_test.cc index a50f0821f7a4..e938899db7b1 100644 --- a/starboard/nplb/system_get_property_test.cc +++ b/starboard/nplb/system_get_property_test.cc @@ -28,22 +28,6 @@ namespace { // Size of appropriate value buffer. const size_t kValueSize = 1024; -#if SB_API_VERSION < 15 -bool IsCEDevice(SbSystemDeviceType device_type) { - switch (device_type) { - case kSbSystemDeviceTypeBlueRayDiskPlayer: - case kSbSystemDeviceTypeGameConsole: - case kSbSystemDeviceTypeOverTheTopBox: - case kSbSystemDeviceTypeSetTopBox: - case kSbSystemDeviceTypeTV: - return true; - case kSbSystemDeviceTypeDesktopPC: - case kSbSystemDeviceTypeUnknown: - default: - return false; - } -} -#endif bool IsCEDevice(std::string device_type) { if (device_type == kSystemDeviceTypeBlueRayDiskPlayer || device_type == kSystemDeviceTypeGameConsole || @@ -97,17 +81,6 @@ TEST(SbSystemGetPropertyTest, ReturnsRequired) { BasicTest(kSbSystemPropertyFirmwareVersion, false, true, __LINE__); BasicTest(kSbSystemPropertySystemIntegratorName, false, true, __LINE__); BasicTest(kSbSystemPropertySpeechApiKey, false, true, __LINE__); -#if SB_API_VERSION < 15 - if (IsCEDevice(SbSystemGetDeviceType())) { - BasicTest(kSbSystemPropertyBrandName, true, true, __LINE__); - BasicTest(kSbSystemPropertyModelName, true, true, __LINE__); - BasicTest(kSbSystemPropertyModelYear, false, true, __LINE__); - } else { - BasicTest(kSbSystemPropertyBrandName, false, true, __LINE__); - BasicTest(kSbSystemPropertyModelName, false, true, __LINE__); - BasicTest(kSbSystemPropertyModelYear, false, true, __LINE__); - } -#else const size_t kSystemPropertyMaxLength = 1024; char value[kSystemPropertyMaxLength]; bool result; @@ -122,7 +95,6 @@ TEST(SbSystemGetPropertyTest, ReturnsRequired) { BasicTest(kSbSystemPropertyModelName, false, true, __LINE__); BasicTest(kSbSystemPropertyModelYear, false, true, __LINE__); } -#endif } TEST(SbSystemGetPropertyTest, FailsGracefullyZeroBufferLength) { @@ -188,7 +160,6 @@ TEST(SbSystemGetPropertyTest, SpeechApiKeyNotLeaked) { } } -#if SB_API_VERSION >= 15 TEST(SbSystemGetPropertyTest, DeviceTypeAllowed) { std::string device_type = GetSystemPropertyString(kSbSystemPropertyDeviceType); @@ -219,7 +190,6 @@ TEST(SbSystemGetPropertyTest, DeviceTypeAllowed) { } ASSERT_TRUE(result); } -#endif } // namespace } // namespace nplb diff --git a/starboard/nplb/thread_priority_test.cc b/starboard/nplb/thread_priority_test.cc index 0375fb480f54..ff5ee3de782f 100644 --- a/starboard/nplb/thread_priority_test.cc +++ b/starboard/nplb/thread_priority_test.cc @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if SB_API_VERSION >= 16 #include "starboard/thread.h" #include "testing/gtest/include/gtest/gtest.h" @@ -43,5 +42,3 @@ TEST(SbThreadPriorityTest, SunnyDay) { } // namespace } // namespace nplb } // namespace starboard - -#endif // SB_API_VERSION >= 16 diff --git a/starboard/player.h b/starboard/player.h index 340a89bca86e..b1afa9d5710e 100644 --- a/starboard/player.h +++ b/starboard/player.h @@ -105,7 +105,6 @@ typedef struct SbPlayerCreationParam { // encrypted portions. SbDrmSystem drm_system; -#if SB_API_VERSION >= 15 // Contains a populated SbMediaAudioStreamInfo if |audio_stream_info.codec| // isn't |kSbMediaAudioCodecNone|. When |audio_stream_info.codec| is // |kSbMediaAudioCodecNone|, the video doesn't have an audio track. @@ -114,16 +113,6 @@ typedef struct SbPlayerCreationParam { // isn't |kSbMediaVideoCodecNone|. When |video_stream_info.codec| is // |kSbMediaVideoCodecNone|, the video is audio only. SbMediaVideoStreamInfo video_stream_info; -#else // SB_API_VERSION >= 15 - // Contains a populated SbMediaAudioSampleInfo if |audio_sample_info.codec| - // isn't |kSbMediaAudioCodecNone|. When |audio_sample_info.codec| is - // |kSbMediaAudioCodecNone|, the video doesn't have an audio track. - SbMediaAudioSampleInfo audio_sample_info; - // Contains a populated SbMediaVideoSampleInfo if |video_sample_info.codec| - // isn't |kSbMediaVideoCodecNone|. When |video_sample_info.codec| is - // |kSbMediaVideoCodecNone|, the video is audio only. - SbMediaVideoSampleInfo video_sample_info; -#endif // SB_API_VERSION >= 15 // Selects how the decoded video frames will be output. For example, // |kSbPlayerOutputModePunchOut| indicates that the decoded video frames will @@ -188,11 +177,7 @@ typedef struct SbPlayerSampleInfo { } SbPlayerSampleInfo; // Information about the current media playback state. -#if SB_API_VERSION >= 15 typedef struct SbPlayerInfo { -#else // SB_API_VERSION >= 15 -typedef struct SbPlayerInfo2 { -#endif // SB_API_VERSION >= 15 // The position of the playback head, as precisely as possible, in // microseconds. int64_t current_media_timestamp; @@ -237,11 +222,7 @@ typedef struct SbPlayerInfo2 { // is played in a slower than normal speed. Negative speeds are not // supported. double playback_rate; -#if SB_API_VERSION >= 15 } SbPlayerInfo; -#else // SB_API_VERSION >= 15 -} SbPlayerInfo2; -#endif // SB_API_VERSION >= 15 // An opaque handle to an implementation-private structure representing a // player. @@ -306,8 +287,6 @@ typedef void (*SbPlayerDeallocateSampleFunc)(SbPlayer player, // Well-defined value for an invalid player. #define kSbPlayerInvalid ((SbPlayer)NULL) -#if SB_API_VERSION >= 15 - // The audio write duration when all the audio connectors are local. #define kSbPlayerWriteDurationLocal (1000000 / 2) // 0.5 seconds @@ -315,8 +294,6 @@ typedef void (*SbPlayerDeallocateSampleFunc)(SbPlayer player, // remote. #define kSbPlayerWriteDurationRemote (1000000 * 10) // 10 seconds -#endif // SB_API_VERSION >= 15 - // Returns whether the given player handle is valid. static inline bool SbPlayerIsValid(SbPlayer player) { return player != kSbPlayerInvalid; @@ -489,15 +466,9 @@ SB_EXPORT void SbPlayerDestroy(SbPlayer player); // when SbPlayerSeek was called. To be very specific, once SbPlayerSeek has // been called with ticket X, a client should ignore all // |SbPlayerDecoderStatusFunc| calls that do not pass in ticket X. -#if SB_API_VERSION >= 15 SB_EXPORT void SbPlayerSeek(SbPlayer player, int64_t seek_to_timestamp, int ticket); -#else // SB_API_VERSION >= 15 -SB_EXPORT void SbPlayerSeek2(SbPlayer player, - int64_t seek_to_timestamp, - int ticket); -#endif // SB_API_VERSION >= 15 // Writes samples of the given media type to |player|'s input stream. The // lifetime of |sample_infos|, and the members of its elements like |buffer|, @@ -525,11 +496,7 @@ SB_EXPORT void SbPlayerSeek2(SbPlayer player, // |number_of_sample_infos|: Specify the number of samples contained inside // |sample_infos|. It has to be at least one, and at most the return value // of SbPlayerGetMaximumNumberOfSamplesPerWrite(). -#if SB_API_VERSION >= 15 SB_EXPORT void SbPlayerWriteSamples(SbPlayer player, -#else // SB_API_VERSION >= 15 -SB_EXPORT void SbPlayerWriteSample2(SbPlayer player, -#endif // SB_API_VERSION >= 15 SbMediaType sample_type, const SbPlayerSampleInfo* sample_infos, int number_of_sample_infos); @@ -625,12 +592,7 @@ SB_EXPORT void SbPlayerSetVolume(SbPlayer player, double volume); // |kSbPlayerInvalid|. // // |out_player_info|: The information retrieved for the player. -#if SB_API_VERSION >= 15 SB_EXPORT void SbPlayerGetInfo(SbPlayer player, SbPlayerInfo* out_player_info); -#else // SB_API_VERSION >= 15 -SB_EXPORT void SbPlayerGetInfo2(SbPlayer player, - SbPlayerInfo2* out_player_info2); -#endif // SB_API_VERSION >= 15 // Given a player created with the kSbPlayerOutputModeDecodeToTexture // output mode, it will return a SbDecodeTarget representing the current frame @@ -696,12 +658,10 @@ SB_EXPORT SbDecodeTarget SbPlayerGetCurrentFrame(SbPlayer player); // // |out_audio_configuration|: The information about the audio output, refer to // |SbMediaAudioConfiguration| for more details. Must not be NULL. -#if SB_API_VERSION >= 15 SB_EXPORT bool SbPlayerGetAudioConfiguration( SbPlayer player, int index, SbMediaAudioConfiguration* out_audio_configuration); -#endif // SB_API_VERSION >= 15 #ifdef __cplusplus } // extern "C" diff --git a/starboard/stub/application_stub.cc b/starboard/stub/application_stub.cc index 7aeb224b092c..5d48238a38b7 100644 --- a/starboard/stub/application_stub.cc +++ b/starboard/stub/application_stub.cc @@ -20,12 +20,8 @@ namespace starboard { namespace stub { -#if SB_API_VERSION >= 15 ApplicationStub::ApplicationStub(SbEventHandleCallback sb_event_handle_callback) : QueueApplication(sb_event_handle_callback) {} -#else -ApplicationStub::ApplicationStub() {} -#endif // SB_API_VERSION >= 15 ApplicationStub::~ApplicationStub() {} diff --git a/starboard/stub/application_stub.h b/starboard/stub/application_stub.h index 72a8cd2ade70..b2aeb84d23e4 100644 --- a/starboard/stub/application_stub.h +++ b/starboard/stub/application_stub.h @@ -27,11 +27,7 @@ namespace stub { // Stub application engine using the generic queue and a stub implementation. class ApplicationStub : public shared::starboard::QueueApplication { public: -#if SB_API_VERSION >= 15 explicit ApplicationStub(SbEventHandleCallback sb_event_handle_callback); -#else - ApplicationStub(); -#endif // SB_API_VERSION >= 15 ~ApplicationStub() override; diff --git a/starboard/stub/configuration_constants.cc b/starboard/stub/configuration_constants.cc index 1f70040994ef..f3315f36c896 100644 --- a/starboard/stub/configuration_constants.cc +++ b/starboard/stub/configuration_constants.cc @@ -124,11 +124,9 @@ const int kSbPreferredRgbaByteOrder = SB_PREFERRED_RGBA_BYTE_ORDER_RGBA; // The maximum size the cache directory is allowed to use in bytes. const uint32_t kSbMaxSystemPathCacheDirectorySize = 24 << 20; // 24MiB -#if SB_API_VERSION >= 16 // Whether this platform can map executable memory. This is required for // platforms that want to JIT. SB_EXPORT extern const bool kSbCanMapExecutableMemory = false; // Platform can support partial audio frames SB_EXPORT extern const bool kHasPartialAudioFramesSupport = false; -#endif diff --git a/starboard/stub/main.cc b/starboard/stub/main.cc index 48d568d4c318..8bcb60f82171 100644 --- a/starboard/stub/main.cc +++ b/starboard/stub/main.cc @@ -16,17 +16,10 @@ #include "starboard/stub/application_stub.h" int main(int argc, char** argv) { -#if SB_API_VERSION >= 15 return SbRunStarboardMain(argc, argv, SbEventHandle); -#else - starboard::stub::ApplicationStub application; - return application.Run(argc, argv); -#endif // SB_API_VERSION >= 15 } -#if SB_API_VERSION >= 15 int SbRunStarboardMain(int argc, char** argv, SbEventHandleCallback callback) { starboard::stub::ApplicationStub application(callback); return application.Run(argc, argv); } -#endif // SB_API_VERSION >= 15 diff --git a/starboard/system.h b/starboard/system.h index ba1bfb38759f..2d65829c5cb1 100644 --- a/starboard/system.h +++ b/starboard/system.h @@ -125,14 +125,11 @@ typedef enum SbSystemPropertyId { // a true value. Corresponds to 'lmt' field. kSbSystemPropertyLimitAdTracking, -#if SB_API_VERSION >= 15 // Type of the device, e.g. such as "TV", "STB", "OTT" // Please see Youtube Technical requirements for a full list of allowed values kSbSystemPropertyDeviceType, -#endif } SbSystemPropertyId; -#if SB_API_VERSION < 15 // Enumeration of device types. typedef enum SbSystemDeviceType { // Blue-ray Disc Player (BDP). @@ -165,7 +162,6 @@ typedef enum SbSystemDeviceType { // Unknown device. kSbSystemDeviceTypeUnknown, } SbSystemDeviceType; -#endif // SB_API_VERSION < 15 // Runtime capabilities are boolean properties of a platform that can't be // determined at compile-time. They may vary from device to device, but they @@ -284,11 +280,6 @@ SB_EXPORT int64_t SbSystemGetTotalGPUMemory(); // SbSystemHasCapability(kSbSystemCapabilityCanQueryGPUMemoryStats) is |true|. SB_EXPORT int64_t SbSystemGetUsedGPUMemory(); -#if SB_API_VERSION < 15 -// Returns the type of the device. -SB_EXPORT SbSystemDeviceType SbSystemGetDeviceType(); -#endif - // Returns if the device is disconnected from network. "Disconnected" is chosen // over connected because disconnection can be determined with more certainty // than connection usually. diff --git a/starboard/thread.h b/starboard/thread.h index f706f9912a0d..95b4bb085fc6 100644 --- a/starboard/thread.h +++ b/starboard/thread.h @@ -95,13 +95,11 @@ static inline bool SbThreadIsValidPriority(SbThreadPriority priority) { // Returns the Thread ID of the currently executing thread. SB_EXPORT SbThreadId SbThreadGetId(); -#if SB_API_VERSION >= 16 // Set the thread priority of the current thread. SB_EXPORT bool SbThreadSetPriority(SbThreadPriority priority); // Get the thread priority of the current thread. SB_EXPORT bool SbThreadGetPriority(SbThreadPriority* priority); -#endif // Private structure representing the context of a frozen thread. typedef struct SbThreadContextPrivate SbThreadContextPrivate;