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 Jun 3, 2024
1 parent c8d3eac commit 3d9fa0d
Show file tree
Hide file tree
Showing 9 changed files with 28 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.

### Deprecated `SbMutex`, `SbConditionVariable` and `SbThread`.
The standard POSIX `pthread` APIs replace the Starboard concurrency
primitives.
Expand Down
3 changes: 3 additions & 0 deletions starboard/android/shared/configuration_constants.cc
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,7 @@ const uint32_t kSbMaxSystemPathCacheDirectorySize = 24 << 20; // 24MiB
// 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 = false;
#endif
3 changes: 3 additions & 0 deletions starboard/configuration_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ SB_EXPORT extern const uint32_t kSbMaxSystemPathCacheDirectorySize;
// 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_
3 changes: 3 additions & 0 deletions starboard/linux/shared/configuration_constants.cc
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,7 @@ 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 = 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
3 changes: 3 additions & 0 deletions starboard/raspi/shared/configuration_constants.cc
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,7 @@ const uint32_t kSbMaxSystemPathCacheDirectorySize = 24 << 20; // 24MiB
// 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 = false;
#endif
3 changes: 3 additions & 0 deletions starboard/stub/configuration_constants.cc
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,7 @@ const uint32_t kSbMaxSystemPathCacheDirectorySize = 24 << 20; // 24MiB
// 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
3 changes: 3 additions & 0 deletions starboard/win/shared/configuration_constants.cc
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,7 @@ const uint32_t kSbMaxSystemPathCacheDirectorySize = 24 << 20; // 24MiB
// 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 = false;
#endif
3 changes: 3 additions & 0 deletions starboard/xb1/shared/configuration_constants.cc
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,7 @@ const uint32_t kSbMaxSystemPathCacheDirectorySize = 24 << 20; // 24MiB
// 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 = false;
#endif

0 comments on commit 3d9fa0d

Please sign in to comment.