Skip to content

Commit

Permalink
Remove Starboard version 13 (#3035)
Browse files Browse the repository at this point in the history
b/293645066

(cherry picked from commit 48f5750)
  • Loading branch information
oxve authored and anonymous1-me committed Jun 27, 2024
1 parent 3094c5f commit d2c565c
Show file tree
Hide file tree
Showing 63 changed files with 61 additions and 523 deletions.
2 changes: 0 additions & 2 deletions cobalt/browser/user_agent_platform_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,7 @@ const DeviceTypeName kDeviceTypeStrings[] = {
{kSbSystemDeviceTypeTV, "TV"},
{kSbSystemDeviceTypeAndroidTV, "ATV"},
{kSbSystemDeviceTypeDesktopPC, "DESKTOP"},
#if SB_API_VERSION >= 14
{kSbSystemDeviceTypeVideoProjector, "PROJECTOR"},
#endif // SB_API_VERSION >= 14
{kSbSystemDeviceTypeUnknown, "UNKNOWN"}};

std::string CreateDeviceTypeString(SbSystemDeviceType device_type) {
Expand Down
4 changes: 0 additions & 4 deletions cobalt/h5vcc/h5vcc_storage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,7 @@ H5vccStorageSetQuotaResponse H5vccStorage::SetQuota(
quota.cache_api() + quota.service_worker_js();

uint32_t max_quota_size = 24 * 1024 * 1024;
#if SB_API_VERSION >= 14
max_quota_size = kSbMaxSystemPathCacheDirectorySize;
#endif
// Assume the non-http-cache memory in kSbSystemPathCacheDirectory
// is less than 1 mb and subtract this from the max_quota_size.
max_quota_size -= (1 << 20);
Expand Down Expand Up @@ -359,9 +357,7 @@ H5vccStorageResourceTypeQuotaBytesDictionary H5vccStorage::GetQuota() {
network::disk_cache::kServiceWorkerScript));

uint32_t max_quota_size = 24 * 1024 * 1024;
#if SB_API_VERSION >= 14
max_quota_size = kSbMaxSystemPathCacheDirectorySize;
#endif
// Assume the non-http-cache memory in kSbSystemPathCacheDirectory
// is less than 1 mb and subtract this from the max_quota_size.
max_quota_size -= (1 << 20);
Expand Down
22 changes: 0 additions & 22 deletions cobalt/h5vcc/h5vcc_system.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,45 +85,23 @@ std::string H5vccSystem::platform() const {
std::string H5vccSystem::advertising_id() const {
std::string result;
char property[kSystemPropertyMaxLength] = {0};
#if SB_API_VERSION >= 14
if (!SbSystemGetProperty(kSbSystemPropertyAdvertisingId, property,
SB_ARRAY_SIZE_INT(property))) {
DLOG(INFO) << "Failed to get kSbSystemPropertyAdvertisingId.";
} else {
result = property;
}
#else
if (ifa_extension_ && ifa_extension_->version >= 1) {
if (!ifa_extension_->GetAdvertisingId(property,
SB_ARRAY_SIZE_INT(property))) {
DLOG(FATAL) << "Failed to get AdvertisingId from IFA extension.";
} else {
result = property;
}
}
#endif
return result;
}
bool H5vccSystem::limit_ad_tracking() const {
bool result = false;
char property[kSystemPropertyMaxLength] = {0};
#if SB_API_VERSION >= 14
if (!SbSystemGetProperty(kSbSystemPropertyLimitAdTracking, property,
SB_ARRAY_SIZE_INT(property))) {
DLOG(INFO) << "Failed to get kSbSystemPropertyAdvertisingId.";
} else {
result = std::atoi(property);
}
#else
if (ifa_extension_ && ifa_extension_->version >= 1) {
if (!ifa_extension_->GetLimitAdTracking(property,
SB_ARRAY_SIZE_INT(property))) {
DLOG(FATAL) << "Failed to get LimitAdTracking from IFA extension.";
} else {
result = std::atoi(property);
}
}
#endif
return result;
}

Expand Down
10 changes: 0 additions & 10 deletions cobalt/media/decoder_buffer_allocator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -129,24 +129,14 @@ int DecoderBufferAllocator::GetAudioBufferBudget() const {

int DecoderBufferAllocator::GetBufferAlignment() const {
#if SB_API_VERSION < 16
#if SB_API_VERSION >= 14
return SbMediaGetBufferAlignment();
#else // SB_API_VERSION >= 14
return std::max(SbMediaGetBufferAlignment(kSbMediaTypeAudio),
SbMediaGetBufferAlignment(kSbMediaTypeVideo));
#endif // SB_API_VERSION >= 14
#else
return sizeof(void*);
#endif // SB_API_VERSION < 16
}

int DecoderBufferAllocator::GetBufferPadding() const {
#if SB_API_VERSION >= 14
return SbMediaGetBufferPadding();
#else // SB_API_VERSION >= 14
return std::max(SbMediaGetBufferPadding(kSbMediaTypeAudio),
SbMediaGetBufferPadding(kSbMediaTypeVideo));
#endif // SB_API_VERSION >= 14
}

base::TimeDelta
Expand Down
5 changes: 1 addition & 4 deletions cobalt/network/url_request_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,7 @@ URLRequestContext::URLRequestContext(
} else {
using_http_cache_ = true;

int max_cache_bytes = 24 * 1024 * 1024;
#if SB_API_VERSION >= 14
max_cache_bytes = kSbMaxSystemPathCacheDirectorySize;
#endif
int max_cache_bytes = kSbMaxSystemPathCacheDirectorySize;
// Assume the non-http-cache memory in kSbSystemPathCacheDirectory
// is less than 1 mb and subtract this from the max_cache_bytes.
max_cache_bytes -= (1 << 20);
Expand Down
4 changes: 0 additions & 4 deletions cobalt/renderer/rasterizer/skia/hardware_resource_provider.cc
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,7 @@ uint32_t DecodeTargetFormatToGLFormat(
}
} break;
case kSbDecodeTargetFormat3Plane10BitYUVI420:
#if SB_API_VERSION >= 14
case kSbDecodeTargetFormat3Plane10BitYUVI420Compact:
#endif // SB_API_VERSION >= 14
case kSbDecodeTargetFormat3PlaneYUVI420: {
DCHECK_LT(plane, 3);
#if defined(GL_RED_EXT)
Expand Down Expand Up @@ -238,11 +236,9 @@ DecodeTargetFormatToRenderTreeMultiPlaneFormat(SbDecodeTargetFormat format) {
case kSbDecodeTargetFormat3Plane10BitYUVI420: {
return render_tree::kMultiPlaneImageFormatYUV3Plane10BitBT2020;
} break;
#if SB_API_VERSION >= 14
case kSbDecodeTargetFormat3Plane10BitYUVI420Compact: {
return render_tree::kMultiPlaneImageFormatYUV3Plane10BitCompactedBT2020;
}
#endif // SB_API_VERSION >= 14
default: {
NOTREACHED();
}
Expand Down
9 changes: 0 additions & 9 deletions cobalt/updater/updater_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,12 @@ ComponentStateToCobaltExtensionUpdaterNotificationState(
return kCobaltExtensionUpdaterNotificationStateDownloaded;
case ComponentState::kUpdating:
return kCobaltExtensionUpdaterNotificationStateInstalling;
#if SB_API_VERSION > 13
case ComponentState::kUpdated:
return kCobaltExtensionUpdaterNotificationStateUpdated;
case ComponentState::kUpToDate:
return kCobaltExtensionUpdaterNotificationStateUpToDate;
case ComponentState::kUpdateError:
return kCobaltExtensionUpdaterNotificationStateUpdateFailed;
#else
case ComponentState::kUpdated:
return kCobaltExtensionUpdaterNotificationStatekUpdated;
case ComponentState::kUpToDate:
return kCobaltExtensionUpdaterNotificationStatekUpToDate;
case ComponentState::kUpdateError:
return kCobaltExtensionUpdaterNotificationStatekUpdateFailed;
#endif
default:
return kCobaltExtensionUpdaterNotificationStateNone;
}
Expand Down
10 changes: 0 additions & 10 deletions media/base/starboard_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,12 @@ SbMediaAudioCodec MediaAudioCodecToSbMediaAudioCodec(AudioCodec codec) {
return kSbMediaAudioCodecVorbis;
case AudioCodec::kOpus:
return kSbMediaAudioCodecOpus;
#if SB_API_VERSION >= 14
case AudioCodec::kMP3:
return kSbMediaAudioCodecMp3;
case AudioCodec::kFLAC:
return kSbMediaAudioCodecFlac;
case AudioCodec::kPCM:
return kSbMediaAudioCodecPcm;
#endif // SB_API_VERSION >= 14
#if SB_API_VERSION >= 15
case AudioCodec::kIAMF:
return kSbMediaAudioCodecIamf;
Expand Down Expand Up @@ -308,9 +306,7 @@ ENUM_EQ(kSbMediaMatrixIdBt2020ConstantLuminance,
VideoColorSpace::MatrixID::BT2020_CL);
ENUM_EQ(kSbMediaMatrixIdYDzDx, VideoColorSpace::MatrixID::YDZDX);

#if SB_API_VERSION >= 14
ENUM_EQ(kSbMediaMatrixIdInvalid, VideoColorSpace::MatrixID::INVALID);
#endif // SB_API_VERSION >= 14

// Ensure RangeId enums convert correctly.
ENUM_EQ(kSbMediaRangeIdUnspecified, gfx::ColorSpace::RangeID::INVALID);
Expand Down Expand Up @@ -381,12 +377,6 @@ SbMediaColorMetadata MediaToSbMediaColorMetadata(
sb_media_color_metadata.matrix =
static_cast<SbMediaMatrixId>(color_space.matrix);

#if SB_API_VERSION < 14
if (color_space.matrix == VideoColorSpace::MatrixID::INVALID) {
sb_media_color_metadata.matrix = kSbMediaMatrixIdUnknown;
}
#endif // SB_API_VERSION < 14

sb_media_color_metadata.range =
static_cast<SbMediaRangeId>(color_space.range);
// TODO(b/230915942): Revisit to see if we have to support custom primary id.
Expand Down
1 change: 0 additions & 1 deletion starboard/android/shared/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,6 @@ static_library("starboard_platform") {
"speech_synthesis_internal.cc",
"speech_synthesis_is_supported.cc",
"speech_synthesis_speak.cc",
"system_get_connection_type.cc",
"system_get_device_type.cc",
"system_get_extensions.cc",
"system_get_locale_id.cc",
Expand Down
2 changes: 0 additions & 2 deletions starboard/android/shared/configuration_constants.cc
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,8 @@ const int kSbPreferredRgbaByteOrder = SB_PREFERRED_RGBA_BYTE_ORDER_RGBA;
const uint32_t kSbUserMaxSignedIn = 1;
#endif // SB_API_VERSION < 16

#if SB_API_VERSION >= 14
// The maximum size the cache directory is allowed to use in bytes.
const uint32_t kSbMaxSystemPathCacheDirectorySize = 24 << 20; // 24MiB
#endif

#if SB_API_VERSION >= 16
// Whether this platform can map executable memory. This is required for
Expand Down
36 changes: 0 additions & 36 deletions starboard/android/shared/system_get_connection_type.cc

This file was deleted.

7 changes: 0 additions & 7 deletions starboard/android/shared/system_get_path.cc
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,6 @@ bool SbSystemGetPath(SbSystemPathId path_id, char* out_path, int path_size) {
break;
}

#if SB_API_VERSION < 14
case kSbSystemPathTestOutputDirectory: {
return SbSystemGetPath(kSbSystemPathDebugOutputDirectory, out_path,
path_size);
}
#endif

// We return the library directory as the "executable" since:
// a) Unlike the .so itself, it has a valid timestamp of the app install.
// b) Its parent directory is still a directory within our app package.
Expand Down
2 changes: 0 additions & 2 deletions starboard/android/shared/system_get_property.cc
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ bool SbSystemGetProperty(SbSystemPropertyId property_id,
CopyStringAndTestIfSuccess(out_value, value_length, utf_str.c_str());
return success;
}
#if SB_API_VERSION >= 14
case kSbSystemPropertyAdvertisingId: {
JniEnvExt* env = JniEnvExt::Get();
ScopedLocalJavaRef<jstring> id_string(
Expand All @@ -162,7 +161,6 @@ bool SbSystemGetProperty(SbSystemPropertyId property_id,
return CopyStringAndTestIfSuccess(out_value, value_length,
limit_ad_tracking_enabled ? "1" : "0");
}
#endif
#if SB_API_VERSION >= 15
case kSbSystemPropertyDeviceType:
return CopyStringAndTestIfSuccess(out_value, value_length,
Expand Down
7 changes: 0 additions & 7 deletions starboard/common/media.cc
Original file line number Diff line number Diff line change
Expand Up @@ -605,14 +605,12 @@ const char* GetMediaAudioCodecName(SbMediaAudioCodec codec) {
return "opus";
case kSbMediaAudioCodecVorbis:
return "vorbis";
#if SB_API_VERSION >= 14
case kSbMediaAudioCodecMp3:
return "mp3";
case kSbMediaAudioCodecFlac:
return "flac";
case kSbMediaAudioCodecPcm:
return "pcm";
#endif // SB_API_VERSION >= 14
#if SB_API_VERSION >= 15
case kSbMediaAudioCodecIamf:
return "iamf";
Expand Down Expand Up @@ -804,13 +802,8 @@ const char* GetMediaMatrixIdName(SbMediaMatrixId matrix_id) {
return "Bt2020ConstantLuminance";
case kSbMediaMatrixIdYDzDx:
return "YDzDx";
#if SB_API_VERSION >= 14
case kSbMediaMatrixIdInvalid:
return "Invalid";
#else // SB_API_VERSION >= 14
case kSbMediaMatrixIdUnknown:
return "Unknown";
#endif // SB_API_VERSION >= 14
}
SB_NOTREACHED();
return "Invalid";
Expand Down
2 changes: 1 addition & 1 deletion starboard/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

// The minimum API version allowed by this version of the Starboard headers,
// inclusive.
#define SB_MINIMUM_API_VERSION 13
#define SB_MINIMUM_API_VERSION 14

// The maximum API version allowed by this version of the Starboard headers,
// inclusive. The API version is not stable and is open for changes.
Expand Down
2 changes: 0 additions & 2 deletions starboard/configuration_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,8 @@ SB_EXPORT extern const char* kSbPathSepString;
SB_EXPORT extern const uint32_t kSbUserMaxSignedIn;
#endif // SB_API_VERSION < 16

#if SB_API_VERSION >= 14
// The maximum size the cache directory is allowed to use in bytes.
SB_EXPORT extern const uint32_t kSbMaxSystemPathCacheDirectorySize;
#endif

#if SB_API_VERSION >= 16
// Whether this platform can map executable memory. This is required for
Expand Down
4 changes: 0 additions & 4 deletions starboard/decode_target.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,10 @@ typedef enum SbDecodeTargetFormat {
// order. Each pixel is stored in 16 bits.
kSbDecodeTargetFormat3Plane10BitYUVI420,

#if SB_API_VERSION >= 14
// A decoder target format consisting of 10bit Y, U, and V planes, in that
// order. The plane data is stored in a compact format. Every three 10-bit
// pixels are packed into 32 bits.
kSbDecodeTargetFormat3Plane10BitYUVI420Compact,
#endif // SB_API_VERSION >= 14

// A decoder target format consisting of a single plane with pixels laid out
// in the format UYVY. Since there are two Y values per sample, but only one
Expand Down Expand Up @@ -285,9 +283,7 @@ static inline int SbDecodeTargetNumberOfPlanesForFormat(
case kSbDecodeTargetFormat2PlaneYUVNV12:
return 2;
case kSbDecodeTargetFormat3Plane10BitYUVI420:
#if SB_API_VERSION >= 14
case kSbDecodeTargetFormat3Plane10BitYUVI420Compact:
#endif // SB_API_VERSION >= 14
case kSbDecodeTargetFormat3PlaneYUVI420:
return 3;
default:
Expand Down
5 changes: 0 additions & 5 deletions starboard/elf_loader/exported_symbols.cc
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,7 @@ ExportedSymbols::ExportedSymbols() {
REGISTER_SYMBOL(kSbHasMediaWebmVp9Support);
REGISTER_SYMBOL(kSbHasThreadPrioritySupport);
REGISTER_SYMBOL(kSbMallocAlignment);
#if SB_API_VERSION >= 14
REGISTER_SYMBOL(kSbMaxSystemPathCacheDirectorySize);
#endif // SB_API_VERSION >= 14
REGISTER_SYMBOL(kSbMaxThreadLocalKeys);
REGISTER_SYMBOL(kSbMaxThreadNameLength);
REGISTER_SYMBOL(kSbMaxThreads);
Expand Down Expand Up @@ -357,9 +355,6 @@ ExportedSymbols::ExportedSymbols() {
#endif // SB_API_VERSION < 16
REGISTER_SYMBOL(SbSystemBreakIntoDebugger);
REGISTER_SYMBOL(SbSystemClearLastError);
#if SB_API_VERSION < 14
REGISTER_SYMBOL(SbSystemGetConnectionType);
#endif
#if SB_API_VERSION < 15
REGISTER_SYMBOL(SbSystemGetDeviceType);
#endif
Expand Down
7 changes: 1 addition & 6 deletions starboard/extension/updater_notification.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,10 @@ typedef enum CobaltExtensionUpdaterNotificationState {
kCobaltExtensionUpdaterNotificationStateDownloading = 3,
kCobaltExtensionUpdaterNotificationStateDownloaded = 4,
kCobaltExtensionUpdaterNotificationStateInstalling = 5,
#if SB_API_VERSION > 13
kCobaltExtensionUpdaterNotificationStateUpdated = 6,
kCobaltExtensionUpdaterNotificationStateUpToDate = 7,
kCobaltExtensionUpdaterNotificationStateUpdateFailed = 8,
#else
kCobaltExtensionUpdaterNotificationStatekUpdated = 6,
kCobaltExtensionUpdaterNotificationStatekUpToDate = 7,
kCobaltExtensionUpdaterNotificationStatekUpdateFailed = 8,
#endif

} CobaltExtensionUpdaterNotificationState;

typedef struct CobaltExtensionUpdaterNotificationApi {
Expand Down
1 change: 0 additions & 1 deletion starboard/linux/shared/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ static_library("starboard_platform_sources") {
"//starboard/linux/shared/routes.h",
"//starboard/linux/shared/soft_mic_platform_service.cc",
"//starboard/linux/shared/soft_mic_platform_service.h",
"//starboard/linux/shared/system_get_connection_type.cc",
"//starboard/linux/shared/system_get_device_type.cc",
"//starboard/linux/shared/system_get_extensions.cc",
"//starboard/linux/shared/system_get_path.cc",
Expand Down
Loading

0 comments on commit d2c565c

Please sign in to comment.