From 2b99b157371b1c6623441555a029651b876efd4b Mon Sep 17 00:00:00 2001 From: Madhura Jayaraman Date: Thu, 8 Aug 2024 10:09:25 -0700 Subject: [PATCH] Remove refs to SbPlayerSeek2, SbPlayerGetInfo2, SbPlayerWriteSample2 (#3899) b/355449840 --- cobalt/media/base/sbplayer_bridge.cc | 16 ----- cobalt/media/base/sbplayer_interface.cc | 14 ----- cobalt/media/base/sbplayer_interface.h | 8 --- starboard/elf_loader/exported_symbols.cc | 14 ----- starboard/linux/shared/BUILD.gn | 1 - .../linux/shared/system_get_extensions.cc | 6 -- .../media_set_audio_write_duration_test.cc | 31 +--------- starboard/nplb/player_test_fixture.cc | 9 --- starboard/nplb/player_test_util.cc | 5 -- starboard/player.h | 23 -------- .../shared/enhanced_audio/enhanced_audio.cc | 46 --------------- .../shared/enhanced_audio/enhanced_audio.gni | 21 ------- .../shared/enhanced_audio/enhanced_audio.h | 28 --------- .../enhanced_audio_player_write_samples.cc | 59 ------------------- .../enhanced_audio_player_write_samples.h | 41 ------------- .../player_write_samples_checked.cc | 31 ---------- .../starboard/player/player_get_info.cc | 4 -- .../starboard/player/player_internal.cc | 4 -- .../shared/starboard/player/player_internal.h | 4 -- .../shared/starboard/player/player_seek.cc | 4 -- .../starboard/player/player_write_samples.cc | 4 -- starboard/shared/stub/player_get_info.cc | 4 -- starboard/shared/stub/player_seek.cc | 4 -- starboard/shared/stub/player_write_samples.cc | 7 +-- 24 files changed, 2 insertions(+), 386 deletions(-) delete mode 100644 starboard/shared/enhanced_audio/enhanced_audio.cc delete mode 100644 starboard/shared/enhanced_audio/enhanced_audio.gni delete mode 100644 starboard/shared/enhanced_audio/enhanced_audio.h delete mode 100644 starboard/shared/enhanced_audio/enhanced_audio_player_write_samples.cc delete mode 100644 starboard/shared/enhanced_audio/enhanced_audio_player_write_samples.h delete mode 100644 starboard/shared/enhanced_audio/player_write_samples_checked.cc diff --git a/cobalt/media/base/sbplayer_bridge.cc b/cobalt/media/base/sbplayer_bridge.cc index 4c6831837fb75..b806e21541b17 100644 --- a/cobalt/media/base/sbplayer_bridge.cc +++ b/cobalt/media/base/sbplayer_bridge.cc @@ -526,11 +526,7 @@ void SbPlayerBridge::GetVideoResolution(int* frame_width, int* frame_height) { DCHECK(SbPlayerIsValid(player_)); -#if SB_API_VERSION >= 15 SbPlayerInfo out_player_info; -#else // SB_API_VERSION >= 15 - SbPlayerInfo2 out_player_info; -#endif // SB_API_VERSION >= 15 sbplayer_interface_->GetInfo(player_, &out_player_info); video_stream_info_.frame_width = out_player_info.frame_width; @@ -549,11 +545,7 @@ TimeDelta SbPlayerBridge::GetDuration() { DCHECK(SbPlayerIsValid(player_)); -#if SB_API_VERSION >= 15 SbPlayerInfo info; -#else // SB_API_VERSION >= 15 - SbPlayerInfo2 info; -#endif // SB_API_VERSION >= 15 sbplayer_interface_->GetInfo(player_, &info); if (info.duration == SB_PLAYER_NO_DURATION) { // URL-based player may not have loaded asset yet, so map no duration to 0. @@ -571,11 +563,7 @@ TimeDelta SbPlayerBridge::GetStartDate() { DCHECK(SbPlayerIsValid(player_)); -#if SB_API_VERSION >= 15 SbPlayerInfo info; -#else // SB_API_VERSION >= 15 - SbPlayerInfo2 info; -#endif // SB_API_VERSION >= 15 sbplayer_interface_->GetInfo(player_, &info); return TimeDelta::FromMicroseconds(info.start_date); } @@ -989,11 +977,7 @@ void SbPlayerBridge::GetInfo_Locked(uint32* video_frames_decoded, DCHECK(SbPlayerIsValid(player_)); -#if SB_API_VERSION >= 15 SbPlayerInfo info; -#else // SB_API_VERSION >= 15 - SbPlayerInfo2 info; -#endif // SB_API_VERSION >= 15 sbplayer_interface_->GetInfo(player_, &info); if (media_time) { diff --git a/cobalt/media/base/sbplayer_interface.cc b/cobalt/media/base/sbplayer_interface.cc index 217441f5e5967..3f6059160ba88 100644 --- a/cobalt/media/base/sbplayer_interface.cc +++ b/cobalt/media/base/sbplayer_interface.cc @@ -91,11 +91,7 @@ void DefaultSbPlayerInterface::Destroy(SbPlayer player) { void DefaultSbPlayerInterface::Seek(SbPlayer player, base::TimeDelta seek_to_timestamp, int ticket) { -#if SB_API_VERSION >= 15 SbPlayerSeek(player, seek_to_timestamp.InMicroseconds(), ticket); -#else // SB_API_VERSION >= 15 - SbPlayerSeek2(player, seek_to_timestamp.InMicroseconds(), ticket); -#endif // SB_API_VERSION >= 15 } bool DefaultSbPlayerInterface::IsEnhancedAudioExtensionEnabled() const { @@ -106,13 +102,8 @@ void DefaultSbPlayerInterface::WriteSamples( SbPlayer player, SbMediaType sample_type, const SbPlayerSampleInfo* sample_infos, int number_of_sample_infos) { DCHECK(!IsEnhancedAudioExtensionEnabled()); -#if SB_API_VERSION >= 15 SbPlayerWriteSamples(player, sample_type, sample_infos, number_of_sample_infos); -#else // SB_API_VERSION >= 15 - SbPlayerWriteSample2(player, sample_type, sample_infos, - number_of_sample_infos); -#endif // SB_API_VERSION >= 15 } void DefaultSbPlayerInterface::WriteSamples( @@ -149,13 +140,8 @@ void DefaultSbPlayerInterface::SetVolume(SbPlayer player, double volume) { } void DefaultSbPlayerInterface::GetInfo(SbPlayer player, -#if SB_API_VERSION >= 15 SbPlayerInfo* out_player_info) { SbPlayerGetInfo(player, out_player_info); -#else // SB_API_VERSION >= 15 - SbPlayerInfo2* out_player_info2) { - SbPlayerGetInfo2(player, out_player_info2); -#endif // SB_API_VERSION >= 15 } SbDecodeTarget DefaultSbPlayerInterface::GetCurrentFrame(SbPlayer player) { diff --git a/cobalt/media/base/sbplayer_interface.h b/cobalt/media/base/sbplayer_interface.h index cef271c5c53db..54b3de18d50c6 100644 --- a/cobalt/media/base/sbplayer_interface.h +++ b/cobalt/media/base/sbplayer_interface.h @@ -62,11 +62,7 @@ class SbPlayerInterface { virtual bool SetPlaybackRate(SbPlayer player, double playback_rate) = 0; virtual void SetVolume(SbPlayer player, double volume) = 0; -#if SB_API_VERSION >= 15 virtual void GetInfo(SbPlayer player, SbPlayerInfo* out_player_info) = 0; -#else // SB_API_VERSION >= 15 - virtual void GetInfo(SbPlayer player, SbPlayerInfo2* out_player_info2) = 0; -#endif // SB_API_VERSION >= 15 virtual SbDecodeTarget GetCurrentFrame(SbPlayer player) = 0; #if SB_HAS(PLAYER_WITH_URL) @@ -129,11 +125,7 @@ class DefaultSbPlayerInterface final : public SbPlayerInterface { int height) override; bool SetPlaybackRate(SbPlayer player, double playback_rate) override; void SetVolume(SbPlayer player, double volume) override; -#if SB_API_VERSION >= 15 void GetInfo(SbPlayer player, SbPlayerInfo* out_player_info) override; -#else // SB_API_VERSION >= 15 - void GetInfo(SbPlayer player, SbPlayerInfo2* out_player_info2) override; -#endif // SB_API_VERSION >= 15 SbDecodeTarget GetCurrentFrame(SbPlayer player) override; #if SB_HAS(PLAYER_WITH_URL) diff --git a/starboard/elf_loader/exported_symbols.cc b/starboard/elf_loader/exported_symbols.cc index 270edb1999d23..c4ff766704a22 100644 --- a/starboard/elf_loader/exported_symbols.cc +++ b/starboard/elf_loader/exported_symbols.cc @@ -261,31 +261,17 @@ ExportedSymbols::ExportedSymbols() { #endif // SB_API_VERSION < 16 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); diff --git a/starboard/linux/shared/BUILD.gn b/starboard/linux/shared/BUILD.gn index ab821f26960ce..aa55f946d4493 100644 --- a/starboard/linux/shared/BUILD.gn +++ b/starboard/linux/shared/BUILD.gn @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import("//starboard/shared/enhanced_audio/enhanced_audio.gni") import("//starboard/shared/starboard/media/media_tests.gni") import("//starboard/shared/starboard/player/buildfiles.gni") import("//starboard/shared/starboard/player/player_tests.gni") diff --git a/starboard/linux/shared/system_get_extensions.cc b/starboard/linux/shared/system_get_extensions.cc index 454bf3abe3f83..1dad8044a8e8f 100644 --- a/starboard/linux/shared/system_get_extensions.cc +++ b/starboard/linux/shared/system_get_extensions.cc @@ -34,7 +34,6 @@ #include "starboard/linux/shared/ifa.h" #include "starboard/linux/shared/platform_service.h" #include "starboard/linux/shared/time_zone.h" -#include "starboard/shared/enhanced_audio/enhanced_audio.h" #include "starboard/shared/ffmpeg/ffmpeg_demuxer.h" #include "starboard/shared/posix/free_space.h" #include "starboard/shared/posix/memory_mapped_file.h" @@ -71,11 +70,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/nplb/media_set_audio_write_duration_test.cc b/starboard/nplb/media_set_audio_write_duration_test.cc index 5c9d67ecc1fbe..6674d4c84212e 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,12 @@ 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/player_test_fixture.cc b/starboard/nplb/player_test_fixture.cc index 6aaf93a8b9586..30700e23cf450 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 a1e6e5d65db8c..7fa84d067dca7 100644 --- a/starboard/nplb/player_test_util.cc +++ b/starboard/nplb/player_test_util.cc @@ -356,13 +356,8 @@ void CallSbPlayerWriteSamples( discarded_durations_from_back[i]; } } -#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, diff --git a/starboard/player.h b/starboard/player.h index 835e0580e403d..b1afa9d5710eb 100644 --- a/starboard/player.h +++ b/starboard/player.h @@ -177,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; @@ -226,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. @@ -474,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|, @@ -510,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); @@ -610,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 diff --git a/starboard/shared/enhanced_audio/enhanced_audio.cc b/starboard/shared/enhanced_audio/enhanced_audio.cc deleted file mode 100644 index e121908725837..0000000000000 --- a/starboard/shared/enhanced_audio/enhanced_audio.cc +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2023 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/shared/enhanced_audio/enhanced_audio.h" - -#include "starboard/common/log.h" -#include "starboard/extension/enhanced_audio.h" -#include "starboard/shared/enhanced_audio/enhanced_audio_player_write_samples.h" - -namespace starboard { -namespace shared { -namespace enhanced_audio { - -#if SB_API_VERSION < 15 - -namespace { - -const CobaltExtensionEnhancedAudioApi kEnhancedAudioApi = { - kCobaltExtensionEnhancedAudioName, - 1, - &EnhancedAudioPlayerWriteSamples, -}; - -} // namespace - -const void* GetEnhancedAudioApi() { - SB_LOG(INFO) << "EnhancedAudio extension enabled."; - return &kEnhancedAudioApi; -} - -#endif // SB_API_VERSION < 15 - -} // namespace enhanced_audio -} // namespace shared -} // namespace starboard diff --git a/starboard/shared/enhanced_audio/enhanced_audio.gni b/starboard/shared/enhanced_audio/enhanced_audio.gni deleted file mode 100644 index 03588b8ce57b4..0000000000000 --- a/starboard/shared/enhanced_audio/enhanced_audio.gni +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright 2023 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. - -enhanced_audio_sources = [ - "//starboard/shared/enhanced_audio/enhanced_audio.cc", - "//starboard/shared/enhanced_audio/enhanced_audio.h", - "//starboard/shared/enhanced_audio/enhanced_audio_player_write_samples.cc", - "//starboard/shared/enhanced_audio/enhanced_audio_player_write_samples.h", - "//starboard/shared/enhanced_audio/player_write_samples_checked.cc", -] diff --git a/starboard/shared/enhanced_audio/enhanced_audio.h b/starboard/shared/enhanced_audio/enhanced_audio.h deleted file mode 100644 index 19f0729a3b2f4..0000000000000 --- a/starboard/shared/enhanced_audio/enhanced_audio.h +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2023 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. - -#ifndef STARBOARD_SHARED_ENHANCED_AUDIO_ENHANCED_AUDIO_H_ -#define STARBOARD_SHARED_ENHANCED_AUDIO_ENHANCED_AUDIO_H_ - -namespace starboard { -namespace shared { -namespace enhanced_audio { - -const void* GetEnhancedAudioApi(); - -} // namespace enhanced_audio -} // namespace shared -} // namespace starboard - -#endif // STARBOARD_SHARED_ENHANCED_AUDIO_ENHANCED_AUDIO_H_ diff --git a/starboard/shared/enhanced_audio/enhanced_audio_player_write_samples.cc b/starboard/shared/enhanced_audio/enhanced_audio_player_write_samples.cc deleted file mode 100644 index 351e19e3489e9..0000000000000 --- a/starboard/shared/enhanced_audio/enhanced_audio_player_write_samples.cc +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2023 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/shared/enhanced_audio/enhanced_audio_player_write_samples.h" - -#include "starboard/common/log.h" -#include "starboard/shared/starboard/player/player_internal.h" - -#if SB_API_VERSION < 15 - -namespace starboard { -namespace shared { -namespace enhanced_audio { - -void EnhancedAudioPlayerWriteSamples( - SbPlayer player, - SbMediaType sample_type, - const CobaltExtensionEnhancedAudioPlayerSampleInfo* sample_infos, - int number_of_sample_infos) { - if (!SbPlayerIsValid(player)) { - SB_LOG(WARNING) << "player is invalid."; - return; - } - if (!sample_infos) { - SB_LOG(WARNING) << "sample_infos is null."; - return; - } - if (number_of_sample_infos < 1) { - SB_LOG(WARNING) << "number_of_sample_infos is " << number_of_sample_infos - << ", which should be greater than or equal to 1"; - return; - } - auto max_samples_per_write = - SbPlayerGetMaximumNumberOfSamplesPerWrite(player, sample_type); - if (number_of_sample_infos > max_samples_per_write) { - SB_LOG(WARNING) << "number_of_sample_infos is " << number_of_sample_infos - << ", which should be less than or equal to " - << max_samples_per_write; - } - - player->WriteSamples(sample_infos, number_of_sample_infos); -} - -} // namespace enhanced_audio -} // namespace shared -} // namespace starboard - -#endif // SB_API_VERSION < 15 diff --git a/starboard/shared/enhanced_audio/enhanced_audio_player_write_samples.h b/starboard/shared/enhanced_audio/enhanced_audio_player_write_samples.h deleted file mode 100644 index 2f9e8e324aa2f..0000000000000 --- a/starboard/shared/enhanced_audio/enhanced_audio_player_write_samples.h +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2023 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. - -#ifndef STARBOARD_SHARED_ENHANCED_AUDIO_ENHANCED_AUDIO_PLAYER_WRITE_SAMPLES_H_ -#define STARBOARD_SHARED_ENHANCED_AUDIO_ENHANCED_AUDIO_PLAYER_WRITE_SAMPLES_H_ - -#include "starboard/extension/enhanced_audio.h" - -#include "starboard/media.h" -#include "starboard/player.h" - -#if SB_API_VERSION < 15 - -namespace starboard { -namespace shared { -namespace enhanced_audio { - -void EnhancedAudioPlayerWriteSamples( - SbPlayer player, - SbMediaType sample_type, - const CobaltExtensionEnhancedAudioPlayerSampleInfo* sample_infos, - int number_of_sample_infos); - -} // namespace enhanced_audio -} // namespace shared -} // namespace starboard - -#endif // SB_API_VERSION < 15 - -#endif // STARBOARD_SHARED_ENHANCED_AUDIO_ENHANCED_AUDIO_PLAYER_WRITE_SAMPLES_H_ diff --git a/starboard/shared/enhanced_audio/player_write_samples_checked.cc b/starboard/shared/enhanced_audio/player_write_samples_checked.cc deleted file mode 100644 index 275c0b05ceac2..0000000000000 --- a/starboard/shared/enhanced_audio/player_write_samples_checked.cc +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2023 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/player.h" - -#include "starboard/common/log.h" - -// Special implementation of `SbPlayerWriteSample2()` for EnhancedAudio, where -// all sample writes should use the `PlayerWriteSamples()` function provided by -// the EnhancedAudio extension. -#if SB_API_VERSION < 15 - -void SbPlayerWriteSample2(SbPlayer player, - SbMediaType sample_type, - const SbPlayerSampleInfo* sample_infos, - int number_of_sample_infos) { - SB_NOTREACHED(); -} - -#endif // SB_API_VERSION < 15 diff --git a/starboard/shared/starboard/player/player_get_info.cc b/starboard/shared/starboard/player/player_get_info.cc index 7c1659d97161b..c16baa73ccca4 100644 --- a/starboard/shared/starboard/player/player_get_info.cc +++ b/starboard/shared/starboard/player/player_get_info.cc @@ -17,11 +17,7 @@ #include "starboard/common/log.h" #include "starboard/shared/starboard/player/player_internal.h" -#if SB_API_VERSION >= 15 void SbPlayerGetInfo(SbPlayer player, SbPlayerInfo* out_player_info) { -#else // SB_API_VERSION >= 15 -void SbPlayerGetInfo2(SbPlayer player, SbPlayerInfo2* out_player_info) { -#endif // SB_API_VERSION >= 15 if (!SbPlayerIsValid(player)) { SB_DLOG(WARNING) << "player is invalid."; return; diff --git a/starboard/shared/starboard/player/player_internal.cc b/starboard/shared/starboard/player/player_internal.cc index 225d4a8d96ae4..be054943a3661 100644 --- a/starboard/shared/starboard/player/player_internal.cc +++ b/starboard/shared/starboard/player/player_internal.cc @@ -116,11 +116,7 @@ void SbPlayerPrivate::SetBounds(int z_index, // TODO: Wait until a frame is rendered with the updated bounds. } -#if SB_API_VERSION >= 15 void SbPlayerPrivate::GetInfo(SbPlayerInfo* out_player_info) { -#else // SB_API_VERSION >= 15 -void SbPlayerPrivate::GetInfo(SbPlayerInfo2* out_player_info) { -#endif // SB_API_VERSION >= 15 SB_DCHECK(out_player_info != NULL); starboard::ScopedLock lock(mutex_); diff --git a/starboard/shared/starboard/player/player_internal.h b/starboard/shared/starboard/player/player_internal.h index 05d64a11886ab..1aa6026fd5836 100644 --- a/starboard/shared/starboard/player/player_internal.h +++ b/starboard/shared/starboard/player/player_internal.h @@ -54,11 +54,7 @@ struct SbPlayerPrivate { void WriteEndOfStream(SbMediaType stream_type); void SetBounds(int z_index, int x, int y, int width, int height); -#if SB_API_VERSION >= 15 void GetInfo(SbPlayerInfo* out_player_info); -#else // SB_API_VERSION >= 15 - void GetInfo(SbPlayerInfo2* out_player_info); -#endif // SB_API_VERSION >= 15 void SetPause(bool pause); void SetPlaybackRate(double playback_rate); void SetVolume(double volume); diff --git a/starboard/shared/starboard/player/player_seek.cc b/starboard/shared/starboard/player/player_seek.cc index 9b1281488bbca..694fcd80476dd 100644 --- a/starboard/shared/starboard/player/player_seek.cc +++ b/starboard/shared/starboard/player/player_seek.cc @@ -17,11 +17,7 @@ #include "starboard/common/log.h" #include "starboard/shared/starboard/player/player_internal.h" -#if SB_API_VERSION >= 15 void SbPlayerSeek(SbPlayer player, int64_t seek_to_timestamp, int ticket) { -#else // SB_API_VERSION >= 15 -void SbPlayerSeek2(SbPlayer player, int64_t seek_to_timestamp, int ticket) { -#endif // SB_API_VERSION >= 15 if (!SbPlayerIsValid(player)) { SB_DLOG(WARNING) << "player is invalid."; return; diff --git a/starboard/shared/starboard/player/player_write_samples.cc b/starboard/shared/starboard/player/player_write_samples.cc index 37c66692e4437..73dfeb2fd0f56 100644 --- a/starboard/shared/starboard/player/player_write_samples.cc +++ b/starboard/shared/starboard/player/player_write_samples.cc @@ -17,11 +17,7 @@ #include "starboard/common/log.h" #include "starboard/shared/starboard/player/player_internal.h" -#if SB_API_VERSION >= 15 void SbPlayerWriteSamples(SbPlayer player, -#else // SB_API_VERSION >= 15 -void SbPlayerWriteSample2(SbPlayer player, -#endif // SB_API_VERSION >= 15 SbMediaType sample_type, const SbPlayerSampleInfo* sample_infos, int number_of_sample_infos) { diff --git a/starboard/shared/stub/player_get_info.cc b/starboard/shared/stub/player_get_info.cc index f368ccbd9412a..04c38acde0caf 100644 --- a/starboard/shared/stub/player_get_info.cc +++ b/starboard/shared/stub/player_get_info.cc @@ -14,8 +14,4 @@ #include "starboard/player.h" -#if SB_API_VERSION >= 15 void SbPlayerGetInfo(SbPlayer player, SbPlayerInfo* out_player_info) {} -#else // SB_API_VERSION >= 15 -void SbPlayerGetInfo2(SbPlayer player, SbPlayerInfo2* out_player_info) {} -#endif // SB_API_VERSION >= 15 diff --git a/starboard/shared/stub/player_seek.cc b/starboard/shared/stub/player_seek.cc index 43acbe2b842b2..ad5c70435951e 100644 --- a/starboard/shared/stub/player_seek.cc +++ b/starboard/shared/stub/player_seek.cc @@ -14,8 +14,4 @@ #include "starboard/player.h" -#if SB_API_VERSION >= 15 void SbPlayerSeek(SbPlayer player, int64_t seek_to_timestamp, int ticket) {} -#else // SB_API_VERSION >= 15 -void SbPlayerSeek2(SbPlayer player, int64_t seek_to_timestamp, int ticket) {} -#endif // SB_API_VERSION >= 15 diff --git a/starboard/shared/stub/player_write_samples.cc b/starboard/shared/stub/player_write_samples.cc index ef08d173b8967..a732cf7ca5579 100644 --- a/starboard/shared/stub/player_write_samples.cc +++ b/starboard/shared/stub/player_write_samples.cc @@ -14,12 +14,7 @@ #include "starboard/player.h" -#if SB_API_VERSION >= 15 void SbPlayerWriteSamples(SbPlayer player, -#else // SB_API_VERSION >= 15 -void SbPlayerWriteSample2(SbPlayer player, -#endif // SB_API_VERSION >= 15 SbMediaType sample_type, const SbPlayerSampleInfo* sample_infos, - int number_of_sample_infos) { -} + int number_of_sample_infos) {}