Skip to content

Commit

Permalink
Add flag for partial audio frame support
Browse files Browse the repository at this point in the history
Allow Starboard implementations to turn partial audio frames off.

b/324905656
  • Loading branch information
kaidokert committed Apr 6, 2024
1 parent 1c11b06 commit a8e7da2
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 0 deletions.
3 changes: 3 additions & 0 deletions starboard/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ since the version previous to it.

## Version 16

## Added new configuration constant `kHasPartialAudioFramesSupport`
Set this to true if your platform supports partial audio frames.

## Removed configs for `SB_EXPORT_PLATFORM` and `SB_IMPORT_PLATFORM`
These are auto-detected based on compilers, platforms can optionally override.

Expand Down
4 changes: 4 additions & 0 deletions starboard/android/shared/configuration_constants.cc
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,7 @@ const uint32_t kSbUserMaxSignedIn = 1;
// 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
SB_EXPORT extern const bool kHasPartialAudioFramesSupport = false;
#endif
5 changes: 5 additions & 0 deletions starboard/configuration_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,4 +153,9 @@ SB_EXPORT extern const uint32_t kSbUserMaxSignedIn;
SB_EXPORT extern const uint32_t kSbMaxSystemPathCacheDirectorySize;
#endif

#if SB_API_VERSION >= 16
// Platform can support partial audio frames
SB_EXPORT extern const bool kHasPartialAudioFramesSupport;
#endif

#endif // STARBOARD_CONFIGURATION_CONSTANTS_H_
4 changes: 4 additions & 0 deletions starboard/linux/shared/configuration_constants.cc
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,7 @@ const uint32_t kSbUserMaxSignedIn = 1;
// 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
SB_EXPORT extern const bool kHasPartialAudioFramesSupport = false;
#endif
4 changes: 4 additions & 0 deletions starboard/nplb/player_test_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,11 @@ 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
Expand Down
4 changes: 4 additions & 0 deletions starboard/raspi/shared/configuration_constants.cc
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,7 @@ const uint32_t kSbUserMaxSignedIn = 1;
// 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
SB_EXPORT extern const bool kHasPartialAudioFramesSupport = false;
#endif
4 changes: 4 additions & 0 deletions starboard/stub/configuration_constants.cc
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,7 @@ const uint32_t kSbUserMaxSignedIn = 1;
// 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
SB_EXPORT extern const bool kHasPartialAudioFramesSupport = false;
#endif
4 changes: 4 additions & 0 deletions starboard/win/shared/configuration_constants.cc
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,7 @@ const uint32_t kSbUserMaxSignedIn = 1;
// 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
SB_EXPORT extern const bool kHasPartialAudioFramesSupport = false;
#endif
4 changes: 4 additions & 0 deletions starboard/xb1/shared/configuration_constants.cc
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,7 @@ const uint32_t kSbUserMaxSignedIn = 1;
// 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
SB_EXPORT extern const bool kHasPartialAudioFramesSupport = false;
#endif

0 comments on commit a8e7da2

Please sign in to comment.