From f8e4ec7be7daa28e5b0d3a8fb5f5f906f15d56f3 Mon Sep 17 00:00:00 2001 From: Madhura Jayaraman Date: Thu, 8 Aug 2024 10:09:14 -0700 Subject: [PATCH] Remove SB14 references (#3897) b/355449840 --- cobalt/media/base/sbplayer_pipeline.cc | 6 - media/base/starboard_utils.cc | 14 --- starboard/android/shared/BUILD.gn | 2 - .../android/shared/configuration_constants.cc | 5 - starboard/common/media.cc | 14 --- starboard/configuration_constants.h | 5 - starboard/elf_loader/exported_symbols.cc | 21 ---- starboard/linux/shared/BUILD.gn | 2 - .../linux/shared/configuration_constants.cc | 5 - .../linux/shared/media_is_audio_supported.cc | 5 - starboard/media.h | 13 -- starboard/memory.h | 10 -- starboard/memory_reporter.h | 113 ------------------ starboard/nplb/extern_c_test.cc | 1 - starboard/nplb/include_all.c | 1 - .../media_set_audio_write_duration_test.cc | 8 -- starboard/raspi/shared/BUILD.gn | 2 - .../raspi/shared/configuration_constants.cc | 5 - .../ffmpeg/ffmpeg_audio_decoder_impl.cc | 6 - .../shared/linux/memory_get_stack_bounds.cc | 37 ------ .../shared/starboard/media/codec_util.cc | 4 - .../shared/starboard/media/codec_util_test.cc | 4 - .../starboard/media/parsed_mime_info_test.cc | 4 - starboard/shared/starboard/memory.cc | 11 -- .../filter/testing/audio_decoder_test.cc | 6 - .../stub/media_set_audio_write_duration.cc | 28 ----- .../shared/stub/memory_get_stack_bounds.cc | 19 --- starboard/stub/BUILD.gn | 2 - starboard/stub/configuration_constants.cc | 5 - starboard/win/shared/BUILD.gn | 1 - .../win/shared/configuration_constants.cc | 5 - starboard/xb1/BUILD.gn | 1 - .../xb1/shared/configuration_constants.cc | 5 - 33 files changed, 370 deletions(-) delete mode 100644 starboard/memory_reporter.h delete mode 100644 starboard/shared/linux/memory_get_stack_bounds.cc delete mode 100644 starboard/shared/stub/media_set_audio_write_duration.cc delete mode 100644 starboard/shared/stub/memory_get_stack_bounds.cc diff --git a/cobalt/media/base/sbplayer_pipeline.cc b/cobalt/media/base/sbplayer_pipeline.cc index a0da033c494d..7b69fd52fde3 100644 --- a/cobalt/media/base/sbplayer_pipeline.cc +++ b/cobalt/media/base/sbplayer_pipeline.cc @@ -192,12 +192,6 @@ SbPlayerPipeline::SbPlayerPipeline( if (force_punch_out_by_default) { default_output_mode_ = kSbPlayerOutputModePunchOut; } -#if SB_API_VERSION < 15 - SbMediaSetAudioWriteDuration(audio_write_duration_.InMicroseconds()); - LOG(INFO) << "Setting audio write duration to " << audio_write_duration_ - << ", the duration during preroll is " - << audio_write_duration_for_preroll_; -#endif // SB_API_VERSION < 15 } SbPlayerPipeline::~SbPlayerPipeline() { DCHECK(!player_bridge_); } diff --git a/media/base/starboard_utils.cc b/media/base/starboard_utils.cc index 4df62cc2924f..efa5411d9b10 100644 --- a/media/base/starboard_utils.cc +++ b/media/base/starboard_utils.cc @@ -62,22 +62,8 @@ SbMediaAudioCodec MediaAudioCodecToSbMediaAudioCodec(AudioCodec codec) { case AudioCodec::kAAC: return kSbMediaAudioCodecAac; case AudioCodec::kAC3: -#if SB_API_VERSION < 15 - if (!kSbHasAc3Audio) { - DLOG(ERROR) << "Audio codec AC3 not enabled on this platform. To " - << "enable it, set kSbHasAc3Audio to |true|."; - return kSbMediaAudioCodecNone; - } -#endif // SB_API_VERSION < 15 return kSbMediaAudioCodecAc3; case AudioCodec::kEAC3: -#if SB_API_VERSION < 15 - if (!kSbHasAc3Audio) { - DLOG(ERROR) << "Audio codec AC3 not enabled on this platform. To " - << "enable it, set kSbHasAc3Audio to |true|."; - return kSbMediaAudioCodecNone; - } -#endif // SB_API_VERSION < 15 return kSbMediaAudioCodecEac3; case AudioCodec::kVorbis: return kSbMediaAudioCodecVorbis; diff --git a/starboard/android/shared/BUILD.gn b/starboard/android/shared/BUILD.gn index 9ad0f528ea76..d7343f02bb34 100644 --- a/starboard/android/shared/BUILD.gn +++ b/starboard/android/shared/BUILD.gn @@ -77,7 +77,6 @@ static_library("starboard_platform") { "//starboard/shared/libevent/socket_waiter_wake_up.cc", "//starboard/shared/linux/byte_swap.cc", "//starboard/shared/linux/cpu_features_get.cc", - "//starboard/shared/linux/memory_get_stack_bounds.cc", "//starboard/shared/linux/system_get_random_data.cc", "//starboard/shared/linux/system_get_total_cpu_memory.cc", "//starboard/shared/linux/system_get_used_cpu_memory.cc", @@ -253,7 +252,6 @@ static_library("starboard_platform") { "//starboard/shared/starboard/window_set_default_options.cc", "//starboard/shared/stub/image_decode.cc", "//starboard/shared/stub/image_is_decode_supported.cc", - "//starboard/shared/stub/media_set_audio_write_duration.cc", "//starboard/shared/stub/system_get_total_gpu_memory.cc", "//starboard/shared/stub/system_get_used_gpu_memory.cc", "//starboard/shared/stub/system_hide_splash_screen.cc", diff --git a/starboard/android/shared/configuration_constants.cc b/starboard/android/shared/configuration_constants.cc index 4e5d36e34063..6fbbdaf8afe5 100644 --- a/starboard/android/shared/configuration_constants.cc +++ b/starboard/android/shared/configuration_constants.cc @@ -49,11 +49,6 @@ const char kSbFileSepChar = '/'; // The string form of SB_FILE_SEP_CHAR. const char* kSbFileSepString = "/"; -#if SB_API_VERSION < 15 -// Allow ac3 and ec3 support -const bool kSbHasAc3Audio = true; -#endif - // Specifies whether this platform has webm/vp9 support. This should be set to // non-zero on platforms with webm/vp9 support. const bool kSbHasMediaWebmVp9Support = true; diff --git a/starboard/common/media.cc b/starboard/common/media.cc index 916e3a859ec7..d1a7294634f1 100644 --- a/starboard/common/media.cc +++ b/starboard/common/media.cc @@ -584,22 +584,8 @@ const char* GetMediaAudioCodecName(SbMediaAudioCodec codec) { case kSbMediaAudioCodecAac: return "aac"; case kSbMediaAudioCodecAc3: -#if SB_API_VERSION < 15 - if (!kSbHasAc3Audio) { - SB_NOTREACHED() << "AC3 audio is not enabled on this platform. To " - << "enable it, set kSbHasAc3Audio to |true|."; - return "invalid"; - } -#endif // SB_API_VERSION < 15 return "ac3"; case kSbMediaAudioCodecEac3: -#if SB_API_VERSION < 15 - if (!kSbHasAc3Audio) { - SB_NOTREACHED() << "AC3 audio is not enabled on this platform. To " - << "enable it, set kSbHasAc3Audio to |true|."; - return "invalid"; - } -#endif // SB_API_VERSION < 15 return "ec3"; case kSbMediaAudioCodecOpus: return "opus"; diff --git a/starboard/configuration_constants.h b/starboard/configuration_constants.h index 8e0fa9922d3f..b0830b6ddc28 100644 --- a/starboard/configuration_constants.h +++ b/starboard/configuration_constants.h @@ -57,11 +57,6 @@ SB_EXPORT extern const char kSbFileSepChar; // The string form of SB_FILE_SEP_CHAR. SB_EXPORT extern const char* kSbFileSepString; -#if SB_API_VERSION < 15 -// Allow ac3 and ec3 support -SB_EXPORT extern const bool kSbHasAc3Audio; -#endif - // Specifies whether this platform has webm/vp9 support. This should be set to // non-zero on platforms with webm/vp9 support. SB_EXPORT extern const bool kSbHasMediaWebmVp9Support; diff --git a/starboard/elf_loader/exported_symbols.cc b/starboard/elf_loader/exported_symbols.cc index 3a0f3f4d8e40..270edb1999d2 100644 --- a/starboard/elf_loader/exported_symbols.cc +++ b/starboard/elf_loader/exported_symbols.cc @@ -50,7 +50,6 @@ #endif // SB_API_VERSION < 16 #include "starboard/log.h" #include "starboard/memory.h" -#include "starboard/memory_reporter.h" #include "starboard/microphone.h" #include "starboard/mutex.h" #include "starboard/player.h" @@ -97,9 +96,6 @@ ExportedSymbols::ExportedSymbols() { REGISTER_SYMBOL(kSbFileMaxPath); REGISTER_SYMBOL(kSbFileSepChar); REGISTER_SYMBOL(kSbFileSepString); -#if SB_API_VERSION < 15 - REGISTER_SYMBOL(kSbHasAc3Audio); -#endif // SB_API_VERSION < 15 REGISTER_SYMBOL(kSbHasMediaWebmVp9Support); REGISTER_SYMBOL(kSbHasThreadPrioritySupport); REGISTER_SYMBOL(kSbMallocAlignment); @@ -227,9 +223,6 @@ ExportedSymbols::ExportedSymbols() { REGISTER_SYMBOL(SbMediaGetVideoBufferBudget); REGISTER_SYMBOL(SbMediaIsBufferPoolAllocateOnDemand); REGISTER_SYMBOL(SbMediaIsBufferUsingMemoryPool); -#if SB_API_VERSION < 15 - REGISTER_SYMBOL(SbMediaSetAudioWriteDuration); -#endif // SB_API_VERSION < 15 #if SB_API_VERSION < 16 REGISTER_SYMBOL(SbMemoryAllocate); REGISTER_SYMBOL(SbMemoryAllocateAligned); @@ -244,24 +237,10 @@ ExportedSymbols::ExportedSymbols() { #endif // SB_CAN(MAP_EXECUTABLE_MEMORY) REGISTER_SYMBOL(SbMemoryFree); REGISTER_SYMBOL(SbMemoryFreeAligned); -#endif // SB_API_VERSION < 16 - -#if SB_API_VERSION < 15 - REGISTER_SYMBOL(SbMemoryGetStackBounds); -#endif - -#if SB_API_VERSION < 16 REGISTER_SYMBOL(SbMemoryMap); REGISTER_SYMBOL(SbMemoryProtect); REGISTER_SYMBOL(SbMemoryReallocate); REGISTER_SYMBOL(SbMemoryReallocateUnchecked); -#endif // SB_API_VERSION < 16 - -#if SB_API_VERSION < 15 - REGISTER_SYMBOL(SbMemorySetReporter); -#endif - -#if SB_API_VERSION < 16 REGISTER_SYMBOL(SbMemoryUnmap); #endif // SB_API_VERSION < 16 diff --git a/starboard/linux/shared/BUILD.gn b/starboard/linux/shared/BUILD.gn index 23bfa1e68e7f..ab821f26960c 100644 --- a/starboard/linux/shared/BUILD.gn +++ b/starboard/linux/shared/BUILD.gn @@ -132,7 +132,6 @@ static_library("starboard_platform_sources") { "//starboard/shared/linux/dev_input/dev_input.cc", "//starboard/shared/linux/dev_input/dev_input.h", "//starboard/shared/linux/get_home_directory.cc", - "//starboard/shared/linux/memory_get_stack_bounds.cc", "//starboard/shared/linux/socket_get_interface_address.cc", "//starboard/shared/linux/system_get_random_data.cc", "//starboard/shared/linux/system_get_stack.cc", @@ -336,7 +335,6 @@ static_library("starboard_platform_sources") { "//starboard/shared/stub/accessibility_get_display_settings.cc", "//starboard/shared/stub/accessibility_get_text_to_speech_settings.cc", "//starboard/shared/stub/accessibility_set_captions_enabled.cc", - "//starboard/shared/stub/media_set_audio_write_duration.cc", "//starboard/shared/stub/microphone_close.cc", "//starboard/shared/stub/microphone_create.cc", "//starboard/shared/stub/microphone_destroy.cc", diff --git a/starboard/linux/shared/configuration_constants.cc b/starboard/linux/shared/configuration_constants.cc index cb9375421f31..c5c5fb9725ea 100644 --- a/starboard/linux/shared/configuration_constants.cc +++ b/starboard/linux/shared/configuration_constants.cc @@ -49,11 +49,6 @@ const char kSbFileSepChar = '/'; // The string form of SB_FILE_SEP_CHAR. const char* kSbFileSepString = "/"; -#if SB_API_VERSION < 15 -// Allow ac3 and ec3 support -const bool kSbHasAc3Audio = true; -#endif - // Specifies whether this platform has webm/vp9 support. This should be set to // non-zero on platforms with webm/vp9 support. const bool kSbHasMediaWebmVp9Support = false; diff --git a/starboard/linux/shared/media_is_audio_supported.cc b/starboard/linux/shared/media_is_audio_supported.cc index c1b03d18d851..ce2fbdff69a1 100644 --- a/starboard/linux/shared/media_is_audio_supported.cc +++ b/starboard/linux/shared/media_is_audio_supported.cc @@ -34,11 +34,6 @@ bool SbMediaIsAudioSupported(SbMediaAudioCodec audio_codec, if (audio_codec == kSbMediaAudioCodecAc3 || audio_codec == kSbMediaAudioCodecEac3) { -#if SB_API_VERSION < 15 - if (!kSbHasAc3Audio) { - return false; - } -#endif // SB_API_VERSION < 15 return bitrate <= kSbMediaMaxAudioBitrateInBitsPerSecond; } diff --git a/starboard/media.h b/starboard/media.h index 70b5a1b7e308..c067426e9247 100644 --- a/starboard/media.h +++ b/starboard/media.h @@ -725,19 +725,6 @@ SB_EXPORT int SbMediaGetVideoBufferBudget(SbMediaVideoCodec codec, int resolution_height, int bits_per_pixel); -// Communicate to the platform how far past |current_playback_position| the app -// will write audio samples. The app will write all samples between -// |current_playback_position| and |current_playback_position| + |duration|, as -// soon as they are available (during is in microseconds). The app may sometimes -// write more samples than that, but the app only guarantees to write |duration| -// past |current_playback_position| in general. The platform is responsible for -// guaranteeing that when only |duration| audio samples are written at a time, -// no playback issues occur (such as transient or indefinite hanging). The -// platform may assume |duration| >= 0.5 seconds. -#if SB_API_VERSION < 15 -SB_EXPORT void SbMediaSetAudioWriteDuration(int64_t duration); -#endif // SB_API_VERSION < 15 - #ifdef __cplusplus } // extern "C" #endif diff --git a/starboard/memory.h b/starboard/memory.h index faa3be5b07c7..cb8a1950f0b1 100644 --- a/starboard/memory.h +++ b/starboard/memory.h @@ -220,16 +220,6 @@ SB_EXPORT void SbMemoryFlush(void* virtual_address, int64_t size_bytes); #endif #endif // SB_API_VERSION < 16 -#if SB_API_VERSION < 15 - -// Gets the stack bounds for the current thread. -// -// |out_high|: The highest addressable byte + 1 for the current thread. -// |out_low|: The lowest addressable byte for the current thread. -SB_EXPORT void SbMemoryGetStackBounds(void** out_high, void** out_low); - -#endif // SB_API_VERSION < 15 - #if SB_API_VERSION < 16 // A wrapper that implements a drop-in replacement for |calloc|, which is used // in some packages. diff --git a/starboard/memory_reporter.h b/starboard/memory_reporter.h deleted file mode 100644 index fe282b0d0f31..000000000000 --- a/starboard/memory_reporter.h +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright 2016 The Cobalt Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Module Overview: Memory Reporting API. -// -// DEPRECATED: Provides an interface for memory reporting. - -#ifndef STARBOARD_MEMORY_REPORTER_H_ -#define STARBOARD_MEMORY_REPORTER_H_ - -#if SB_API_VERSION < 15 - -#include "starboard/configuration.h" -#include "starboard/export.h" -#include "starboard/types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/////////////////////////////////////////////////////////////////////////////// -// These are callbacks used by SbMemoryReporter to report memory -// allocation and deallocation. -/////////////////////////////////////////////////////////////////////////////// - -// A function to report a memory allocation from SbMemoryAllocate(). Note that -// operator new calls SbMemoryAllocate which will delegate to this callback. -typedef void (*SbMemoryReporterOnAlloc)(void* context, - const void* memory, - size_t size); - -// A function to report a memory deallocation from SbMemoryDeallcoate(). Note -// that operator delete calls SbMemoryDeallocate which will delegate to this -// callback. -typedef void (*SbMemoryReporterOnDealloc)(void* context, const void* memory); - -// A function to report a memory mapping from SbMemoryMap(). -typedef void (*SbMemoryReporterOnMapMemory)(void* context, - const void* memory, - size_t size); - -// A function to report a memory unmapping from SbMemoryUnmap(). -typedef void (*SbMemoryReporterOnUnMapMemory)(void* context, - const void* memory, - size_t size); - -// SbMemoryReporter allows memory reporting via user-supplied functions. -// The void* context is passed to every call back. -// It's strongly recommended that C-Style struct initialization is used -// so that the arguments can be typed check by the compiler. -// For example, -// SbMemoryReporter mem_reporter = { MallocCallback, .... context }; -struct SbMemoryReporter { - // Callback to report allocations. - SbMemoryReporterOnAlloc on_alloc_cb; - - // Callback to report deallocations. - SbMemoryReporterOnDealloc on_dealloc_cb; - - // Callback to report memory map. - SbMemoryReporterOnMapMemory on_mapmem_cb; - - // Callback to report memory unmap. - SbMemoryReporterOnUnMapMemory on_unmapmem_cb; - - // Optional, is passed to callbacks as first argument. - void* context; -}; - -// Sets the MemoryReporter. Any previous memory reporter is unset. No lifetime -// management is done internally on input pointer. -// -// NOTE: This module is unused starting with Starboard 15 and will be removed -// in the future. -// -// Returns true if the memory reporter was set with no errors. If an error -// was reported then check the log for why it failed. -// -// Note that other than a thread-barrier-write of the input pointer, there is -// no thread safety guarantees with this function due to performance -// considerations. It's recommended that this be called once during the -// lifetime of the program, or not at all. Do not delete the supplied pointer, -// ever. -// Example (Good): -// SbMemoryReporter* mem_reporter = new ...; -// SbMemorySetReporter(&mem_reporter); -// ... -// SbMemorySetReporter(NULL); // allow value to leak. -// Example (Bad): -// SbMemoryReporter* mem_reporter = new ...; -// SbMemorySetReporter(&mem_reporter); -// ... -// SbMemorySetReporter(NULL); -// delete mem_reporter; // May crash. -SB_EXPORT bool SbMemorySetReporter(struct SbMemoryReporter* tracker); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // SB_API_VERSION < 15 -#endif // STARBOARD_MEMORY_REPORTER_H_ diff --git a/starboard/nplb/extern_c_test.cc b/starboard/nplb/extern_c_test.cc index 12300bd0658b..1c42ce015eb0 100644 --- a/starboard/nplb/extern_c_test.cc +++ b/starboard/nplb/extern_c_test.cc @@ -42,7 +42,6 @@ extern "C" { #include "starboard/log.h" #include "starboard/media.h" #include "starboard/memory.h" -#include "starboard/memory_reporter.h" #include "starboard/microphone.h" #include "starboard/mutex.h" #include "starboard/player.h" diff --git a/starboard/nplb/include_all.c b/starboard/nplb/include_all.c index 8a5041bc7133..241c1f385139 100644 --- a/starboard/nplb/include_all.c +++ b/starboard/nplb/include_all.c @@ -41,7 +41,6 @@ #include "starboard/log.h" #include "starboard/media.h" #include "starboard/memory.h" -#include "starboard/memory_reporter.h" #include "starboard/microphone.h" #include "starboard/mutex.h" #include "starboard/player.h" diff --git a/starboard/nplb/media_set_audio_write_duration_test.cc b/starboard/nplb/media_set_audio_write_duration_test.cc index 004f3df61ad6..5c9d67ecc1fb 100644 --- a/starboard/nplb/media_set_audio_write_duration_test.cc +++ b/starboard/nplb/media_set_audio_write_duration_test.cc @@ -186,10 +186,6 @@ TEST_P(SbMediaSetAudioWriteDurationTest, WriteLimitedInput) { ASSERT_NE(dmp_reader_.audio_codec(), kSbMediaAudioCodecNone); ASSERT_GT(dmp_reader_.number_of_audio_buffers(), 0); -#if SB_API_VERSION < 15 - SbMediaSetAudioWriteDuration(kDuration); -#endif // SB_API_VERSION < 15 - SbPlayer player = CreatePlayer(); WaitForPlayerState(kSbPlayerStateInitialized); @@ -229,10 +225,6 @@ TEST_P(SbMediaSetAudioWriteDurationTest, WriteContinuedLimitedInput) { ASSERT_NE(dmp_reader_.audio_codec(), kSbMediaAudioCodecNone); ASSERT_GT(dmp_reader_.number_of_audio_buffers(), 0); -#if SB_API_VERSION < 15 - SbMediaSetAudioWriteDuration(kDuration); -#endif // SB_API_VERSION < 15 - // This directly impacts the runtime of the test. total_duration_ = 15'000'000LL; // 15 seconds diff --git a/starboard/raspi/shared/BUILD.gn b/starboard/raspi/shared/BUILD.gn index 806e81b6642e..fcfc835ded38 100644 --- a/starboard/raspi/shared/BUILD.gn +++ b/starboard/raspi/shared/BUILD.gn @@ -101,7 +101,6 @@ static_library("starboard_platform_sources") { "//starboard/shared/linux/cpu_features_get.cc", "//starboard/shared/linux/dev_input/dev_input.cc", "//starboard/shared/linux/get_home_directory.cc", - "//starboard/shared/linux/memory_get_stack_bounds.cc", "//starboard/shared/linux/socket_get_interface_address.cc", "//starboard/shared/linux/system_get_random_data.cc", "//starboard/shared/linux/system_get_stack.cc", @@ -302,7 +301,6 @@ static_library("starboard_platform_sources") { "//starboard/shared/stub/drm_update_server_certificate.cc", "//starboard/shared/stub/drm_update_session.cc", "//starboard/shared/stub/media_is_supported.cc", - "//starboard/shared/stub/media_set_audio_write_duration.cc", "//starboard/shared/stub/microphone_close.cc", "//starboard/shared/stub/microphone_create.cc", "//starboard/shared/stub/microphone_destroy.cc", diff --git a/starboard/raspi/shared/configuration_constants.cc b/starboard/raspi/shared/configuration_constants.cc index 2be1f49ec158..2908227f899b 100644 --- a/starboard/raspi/shared/configuration_constants.cc +++ b/starboard/raspi/shared/configuration_constants.cc @@ -49,11 +49,6 @@ const char kSbFileSepChar = '/'; // The string form of SB_FILE_SEP_CHAR. const char* kSbFileSepString = "/"; -#if SB_API_VERSION < 15 -// Allow ac3 and ec3 support -const bool kSbHasAc3Audio = true; -#endif - // Specifies whether this platform has webm/vp9 support. This should be set to // non-zero on platforms with webm/vp9 support. const bool kSbHasMediaWebmVp9Support = false; diff --git a/starboard/shared/ffmpeg/ffmpeg_audio_decoder_impl.cc b/starboard/shared/ffmpeg/ffmpeg_audio_decoder_impl.cc index 6a6e27dbdcfc..c2655f611d8c 100644 --- a/starboard/shared/ffmpeg/ffmpeg_audio_decoder_impl.cc +++ b/starboard/shared/ffmpeg/ffmpeg_audio_decoder_impl.cc @@ -47,14 +47,8 @@ AVCodecID GetFfmpegCodecIdByMediaCodec( case kSbMediaAudioCodecAac: return AV_CODEC_ID_AAC; case kSbMediaAudioCodecAc3: -#if SB_API_VERSION < 15 - return kSbHasAc3Audio ? AV_CODEC_ID_AC3 : AV_CODEC_ID_NONE; -#endif // SB_API_VERSION < 15 return AV_CODEC_ID_AC3; case kSbMediaAudioCodecEac3: -#if SB_API_VERSION < 15 - return kSbHasAc3Audio ? AV_CODEC_ID_EAC3 : AV_CODEC_ID_NONE; -#endif // SB_API_VERSION < 15 return AV_CODEC_ID_EAC3; case kSbMediaAudioCodecOpus: return AV_CODEC_ID_OPUS; diff --git a/starboard/shared/linux/memory_get_stack_bounds.cc b/starboard/shared/linux/memory_get_stack_bounds.cc deleted file mode 100644 index 5d41242a9d87..000000000000 --- a/starboard/shared/linux/memory_get_stack_bounds.cc +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2016 The Cobalt Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "starboard/memory.h" - -#include - -#include "starboard/common/log.h" - -#if SB_API_VERSION < 15 -void SbMemoryGetStackBounds(void** out_high, void** out_low) { - void* stackBase = 0; - size_t stackSize = 0; - - pthread_t thread = pthread_self(); - pthread_attr_t sattr; - pthread_attr_init(&sattr); - pthread_getattr_np(thread, &sattr); - int rc = pthread_attr_getstack(&sattr, &stackBase, &stackSize); - SB_DCHECK(rc == 0); - SB_DCHECK(stackBase); - pthread_attr_destroy(&sattr); - *out_high = static_cast(stackBase) + stackSize; - *out_low = stackBase; -} -#endif diff --git a/starboard/shared/starboard/media/codec_util.cc b/starboard/shared/starboard/media/codec_util.cc index c34a1084d262..f930682f76b0 100644 --- a/starboard/shared/starboard/media/codec_util.cc +++ b/starboard/shared/starboard/media/codec_util.cc @@ -74,11 +74,7 @@ bool VideoConfig::operator!=(const VideoConfig& that) const { SbMediaAudioCodec GetAudioCodecFromString(const char* codec, const char* subtype) { -#if SB_API_VERSION < 15 - const bool kCheckAc3Audio = kSbHasAc3Audio; -#else const bool kCheckAc3Audio = true; -#endif // SB_API_VERSION < 15 if (strncmp(codec, "mp4a.40.", 8) == 0) { return kSbMediaAudioCodecAac; } diff --git a/starboard/shared/starboard/media/codec_util_test.cc b/starboard/shared/starboard/media/codec_util_test.cc index 0bdc602e18a9..16faa5aeb51f 100644 --- a/starboard/shared/starboard/media/codec_util_test.cc +++ b/starboard/shared/starboard/media/codec_util_test.cc @@ -220,11 +220,7 @@ TEST(CodecUtilTest, ParsesAacCodecs) { EXPECT_EQ(GetAudioCodecFromString("mp4a.40.5", ""), kSbMediaAudioCodecAac); } -#if SB_API_VERSION < 15 -const bool kCheckAc3Audio = kSbHasAc3Audio; -#else const bool kCheckAc3Audio = true; -#endif // SB_API_VERSION < 15 TEST(CodecUtilTest, ParsesAc3CodecIfEnabled) { EXPECT_EQ(GetAudioCodecFromString("ac-3", ""), diff --git a/starboard/shared/starboard/media/parsed_mime_info_test.cc b/starboard/shared/starboard/media/parsed_mime_info_test.cc index 4951fc299d5e..815214f2ae6a 100644 --- a/starboard/shared/starboard/media/parsed_mime_info_test.cc +++ b/starboard/shared/starboard/media/parsed_mime_info_test.cc @@ -23,11 +23,7 @@ namespace starboard { namespace media { namespace { -#if SB_API_VERSION < 15 -const bool kCheckAc3Audio = kSbHasAc3Audio; -#else const bool kCheckAc3Audio = true; -#endif // SB_API_VERSION < 15 TEST(ParsedMimeInfoTest, ParsesAacLowComplexityCodec) { ParsedMimeInfo mime_info("audio/mp4; codecs=\"mp4a.40.2\""); diff --git a/starboard/shared/starboard/memory.cc b/starboard/shared/starboard/memory.cc index 455201edbe7a..ccd1d97a80a9 100644 --- a/starboard/shared/starboard/memory.cc +++ b/starboard/shared/starboard/memory.cc @@ -18,10 +18,6 @@ #include "starboard/atomic.h" #include "starboard/common/log.h" -#if SB_API_VERSION < 15 -#include "starboard/memory_reporter.h" -#endif - namespace { inline void* SbMemoryAllocateImpl(size_t size); @@ -30,13 +26,6 @@ inline void* SbMemoryReallocateImpl(void* memory, size_t size); } // namespace -#if SB_API_VERSION < 15 -bool SbMemorySetReporter(SbMemoryReporter* _unused) { - // Memory reporting is removed - return false; -} -#endif - void* SbMemoryAllocate(size_t size) { void* memory = SbMemoryAllocateImpl(size); return memory; diff --git a/starboard/shared/starboard/player/filter/testing/audio_decoder_test.cc b/starboard/shared/starboard/player/filter/testing/audio_decoder_test.cc index 77daf30c795e..456ca9bea7a1 100644 --- a/starboard/shared/starboard/player/filter/testing/audio_decoder_test.cc +++ b/starboard/shared/starboard/player/filter/testing/audio_decoder_test.cc @@ -705,9 +705,6 @@ TEST_P(AudioDecoderTest, MultipleInputs) { TEST_P(AudioDecoderTest, LimitedInput) { int64_t duration = 500'000; // 0.5 seconds -#if SB_API_VERSION < 15 - SbMediaSetAudioWriteDuration(duration); -#endif // SB_API_VERSION < 15 ASSERT_TRUE(decoded_audios_.empty()); int start_index = 0; @@ -724,9 +721,6 @@ TEST_P(AudioDecoderTest, LimitedInput) { TEST_P(AudioDecoderTest, ContinuedLimitedInput) { constexpr int kMaxAccessUnitsToDecode = 256; int64_t duration = 500'000; // 0.5 seconds -#if SB_API_VERSION < 15 - SbMediaSetAudioWriteDuration(duration); -#endif // SB_API_VERSION < 15 int64_t start = CurrentMonotonicTime(); int start_index = 0; diff --git a/starboard/shared/stub/media_set_audio_write_duration.cc b/starboard/shared/stub/media_set_audio_write_duration.cc deleted file mode 100644 index 67898e1da052..000000000000 --- a/starboard/shared/stub/media_set_audio_write_duration.cc +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2019 The Cobalt Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "starboard/media.h" - -#include "starboard/common/log.h" - -#if SB_API_VERSION < 15 - -void SbMediaSetAudioWriteDuration(int64_t duration) { - // The stub implementation assumes no further action is needed from the - // platform to be compatible with limits >= 0.5 second. - SB_DCHECK(duration >= 500'000) - << "Limiting audio to less than 0.5 seconds is unexpected."; -} - -#endif // SB_API_VERSION < 15 diff --git a/starboard/shared/stub/memory_get_stack_bounds.cc b/starboard/shared/stub/memory_get_stack_bounds.cc deleted file mode 100644 index 91b257810086..000000000000 --- a/starboard/shared/stub/memory_get_stack_bounds.cc +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2016 The Cobalt Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "starboard/memory.h" - -#if SB_API_VERSION < 15 -void SbMemoryGetStackBounds(void** out_high, void** out_low) {} -#endif diff --git a/starboard/stub/BUILD.gn b/starboard/stub/BUILD.gn index 7f053ab5b2f3..181951e2346b 100644 --- a/starboard/stub/BUILD.gn +++ b/starboard/stub/BUILD.gn @@ -113,13 +113,11 @@ static_library("stub_sources") { "//starboard/shared/stub/media_is_buffer_using_memory_pool.cc", "//starboard/shared/stub/media_is_supported.cc", "//starboard/shared/stub/media_is_video_supported.cc", - "//starboard/shared/stub/media_set_audio_write_duration.cc", "//starboard/shared/stub/memory_allocate_aligned_unchecked.cc", "//starboard/shared/stub/memory_allocate_unchecked.cc", "//starboard/shared/stub/memory_flush.cc", "//starboard/shared/stub/memory_free.cc", "//starboard/shared/stub/memory_free_aligned.cc", - "//starboard/shared/stub/memory_get_stack_bounds.cc", "//starboard/shared/stub/memory_map.cc", "//starboard/shared/stub/memory_protect.cc", "//starboard/shared/stub/memory_reallocate_unchecked.cc", diff --git a/starboard/stub/configuration_constants.cc b/starboard/stub/configuration_constants.cc index 5b7d7991350b..db2439f62ba7 100644 --- a/starboard/stub/configuration_constants.cc +++ b/starboard/stub/configuration_constants.cc @@ -49,11 +49,6 @@ const char kSbFileSepChar = '/'; // The string form of SB_FILE_SEP_CHAR. const char* kSbFileSepString = "/"; -#if SB_API_VERSION < 15 -// Allow ac3 and ec3 support -const bool kSbHasAc3Audio = true; -#endif - // Specifies whether this platform has webm/vp9 support. This should be set to // non-zero on platforms with webm/vp9 support. const bool kSbHasMediaWebmVp9Support = false; diff --git a/starboard/win/shared/BUILD.gn b/starboard/win/shared/BUILD.gn index fda479ae46c2..7421262998f7 100644 --- a/starboard/win/shared/BUILD.gn +++ b/starboard/win/shared/BUILD.gn @@ -111,7 +111,6 @@ static_library("starboard_platform") { "//starboard/shared/stub/cpu_features_get.cc", "//starboard/shared/stub/image_decode.cc", "//starboard/shared/stub/image_is_decode_supported.cc", - "//starboard/shared/stub/media_set_audio_write_duration.cc", "//starboard/shared/stub/speech_synthesis_cancel.cc", "//starboard/shared/stub/speech_synthesis_is_supported.cc", "//starboard/shared/stub/speech_synthesis_speak.cc", diff --git a/starboard/win/shared/configuration_constants.cc b/starboard/win/shared/configuration_constants.cc index 4cb3f8f235fc..2b849fc8fab7 100644 --- a/starboard/win/shared/configuration_constants.cc +++ b/starboard/win/shared/configuration_constants.cc @@ -52,11 +52,6 @@ const char kSbFileSepChar = '\\'; // The string form of SB_FILE_SEP_CHAR. const char* kSbFileSepString = "\\"; -#if SB_API_VERSION < 15 -// Allow ac3 and ec3 support -const bool kSbHasAc3Audio = true; -#endif - // Specifies whether this platform has webm/vp9 support. This should be set to // non-zero on platforms with webm/vp9 support. const bool kSbHasMediaWebmVp9Support = true; diff --git a/starboard/xb1/BUILD.gn b/starboard/xb1/BUILD.gn index e4137bc401b4..80402c9c3a5b 100644 --- a/starboard/xb1/BUILD.gn +++ b/starboard/xb1/BUILD.gn @@ -95,7 +95,6 @@ static_library("starboard_platform") { "//starboard/shared/starboard/system_request_reveal.cc", "//starboard/shared/starboard/system_request_stop.cc", "//starboard/shared/starboard/system_supports_resume.cc", - "//starboard/shared/stub/media_set_audio_write_duration.cc", "//starboard/shared/stub/system_symbolize.cc", "//starboard/shared/uwp/analog_thumbstick_input.cc", "//starboard/shared/uwp/analog_thumbstick_input.h", diff --git a/starboard/xb1/shared/configuration_constants.cc b/starboard/xb1/shared/configuration_constants.cc index 6294dca654b4..52ee88b84d4f 100644 --- a/starboard/xb1/shared/configuration_constants.cc +++ b/starboard/xb1/shared/configuration_constants.cc @@ -49,11 +49,6 @@ const char kSbFileSepChar = '\\'; // The string form of SB_FILE_SEP_CHAR. const char* kSbFileSepString = "\\"; -#if SB_API_VERSION < 15 -// Allow ac3 and ec3 support -const bool kSbHasAc3Audio = true; -#endif - // Specifies whether this platform has webm/vp9 support. This should be set to // non-zero on platforms with webm/vp9 support. const bool kSbHasMediaWebmVp9Support = true;