// Native Starboard symbols backed by actual VitaSDK platform implementations. // The lookup only exposes implementations we genuinely have. Missing APIs fail closed. #include "starboard/log.h" #include "starboard/event.h" #include "starboard/accessibility.h" #include "starboard/microphone.h" #include "starboard/speech_synthesis.h" #include "starboard/drm.h" #include "starboard/media.h" #include "starboard/audio_sink.h" #include "starboard/ui_navigation.h" #include "starboard/decode_target.h" #include "starboard/player.h" #include "starboard/thread.h" #include "starboard/string.h" #include "starboard/time_zone.h" #include "starboard/configuration_constants.h" #include "starboard/system.h" #include "starboard/cpu_features.h" #include "starboard/time.h" #include "starboard/window.h" #include "starboard/user.h" #include "starboard/storage.h" #include "starboard/file.h" #include "starboard/directory.h" #include "starboard/mutex.h" #include "starboard/condition_variable.h" #include "starboard/socket.h" #include "starboard/socket_waiter.h" #include "starboard/memory.h" #include "starboard/once.h" #include "starboard/thread.h" #include "starboard/egl.h" #include "starboard/gles.h" #include #include namespace { struct Entry { const char* name; uintptr_t pointer; }; const Entry kExports[] = { {"SbDirectoryClose", reinterpret_cast(&SbDirectoryClose)}, {"SbDirectoryCreate", reinterpret_cast(&SbDirectoryCreate)}, {"SbDirectoryGetNext", reinterpret_cast(&SbDirectoryGetNext)}, {"SbDirectoryOpen", reinterpret_cast(&SbDirectoryOpen)}, {"SbFileAtomicReplace", reinterpret_cast(&SbFileAtomicReplace)}, {"SbFileClose", reinterpret_cast(&SbFileClose)}, {"SbFileDelete", reinterpret_cast(&SbFileDelete)}, {"SbFileExists", reinterpret_cast(&SbFileExists)}, {"SbFileFlush", reinterpret_cast(&SbFileFlush)}, {"SbFileGetInfo", reinterpret_cast(&SbFileGetInfo)}, {"SbFileGetPathInfo", reinterpret_cast(&SbFileGetPathInfo)}, {"SbFileOpen", reinterpret_cast(&SbFileOpen)}, {"SbFileRead", reinterpret_cast(&SbFileRead)}, {"SbFileSeek", reinterpret_cast(&SbFileSeek)}, {"SbFileTruncate", reinterpret_cast(&SbFileTruncate)}, {"SbFileWrite", reinterpret_cast(&SbFileWrite)}, {"SbMutexAcquire", reinterpret_cast(&SbMutexAcquire)}, {"SbMutexAcquireTry", reinterpret_cast(&SbMutexAcquireTry)}, {"SbMutexCreate", reinterpret_cast(&SbMutexCreate)}, {"SbMutexDestroy", reinterpret_cast(&SbMutexDestroy)}, {"SbMutexRelease", reinterpret_cast(&SbMutexRelease)}, {"SbConditionVariableBroadcast", reinterpret_cast(&SbConditionVariableBroadcast)}, {"SbConditionVariableCreate", reinterpret_cast(&SbConditionVariableCreate)}, {"SbConditionVariableDestroy", reinterpret_cast(&SbConditionVariableDestroy)}, {"SbConditionVariableSignal", reinterpret_cast(&SbConditionVariableSignal)}, {"SbConditionVariableWait", reinterpret_cast(&SbConditionVariableWait)}, {"SbConditionVariableWaitTimed", reinterpret_cast(&SbConditionVariableWaitTimed)}, {"SbSocketIsIpv6Supported", reinterpret_cast(&SbSocketIsIpv6Supported)}, {"SbSocketCreate", reinterpret_cast(&SbSocketCreate)}, {"SbSocketDestroy", reinterpret_cast(&SbSocketDestroy)}, {"SbSocketConnect", reinterpret_cast(&SbSocketConnect)}, {"SbSocketBind", reinterpret_cast(&SbSocketBind)}, {"SbSocketListen", reinterpret_cast(&SbSocketListen)}, {"SbSocketAccept", reinterpret_cast(&SbSocketAccept)}, {"SbSocketGetLastError", reinterpret_cast(&SbSocketGetLastError)}, {"SbSocketClearLastError", reinterpret_cast(&SbSocketClearLastError)}, {"SbSocketGetLocalAddress", reinterpret_cast(&SbSocketGetLocalAddress)}, {"SbSocketReceiveFrom", reinterpret_cast(&SbSocketReceiveFrom)}, {"SbSocketSendTo", reinterpret_cast(&SbSocketSendTo)}, {"SbSocketSetBroadcast", reinterpret_cast(&SbSocketSetBroadcast)}, {"SbSocketSetReuseAddress", reinterpret_cast(&SbSocketSetReuseAddress)}, {"SbSocketSetReceiveBufferSize", reinterpret_cast(&SbSocketSetReceiveBufferSize)}, {"SbSocketSetSendBufferSize", reinterpret_cast(&SbSocketSetSendBufferSize)}, {"SbSocketSetTcpNoDelay", reinterpret_cast(&SbSocketSetTcpNoDelay)}, {"SbSocketResolve", reinterpret_cast(&SbSocketResolve)}, {"SbSocketFreeResolution", reinterpret_cast(&SbSocketFreeResolution)}, {"SbSocketWaiterCreate", reinterpret_cast(&SbSocketWaiterCreate)}, {"SbSocketWaiterDestroy", reinterpret_cast(&SbSocketWaiterDestroy)}, {"SbSocketWaiterAdd", reinterpret_cast(&SbSocketWaiterAdd)}, {"SbSocketWaiterRemove", reinterpret_cast(&SbSocketWaiterRemove)}, {"SbSocketWaiterWait", reinterpret_cast(&SbSocketWaiterWait)}, {"SbSocketWaiterWaitTimed", reinterpret_cast(&SbSocketWaiterWaitTimed)}, {"SbSocketWaiterWakeUp", reinterpret_cast(&SbSocketWaiterWakeUp)}, {"SbMemoryAllocate", reinterpret_cast(&SbMemoryAllocate)}, {"SbMemoryAllocateAligned", reinterpret_cast(&SbMemoryAllocateAligned)}, {"SbMemoryDeallocate", reinterpret_cast(&SbMemoryDeallocate)}, {"SbMemoryReallocate", reinterpret_cast(&SbMemoryReallocate)}, {"SbOnce", reinterpret_cast(&SbOnce)}, {"SbLogFlush", reinterpret_cast(&SbLogFlush)}, {"SbLogFormat", reinterpret_cast(&SbLogFormat)}, {"SbLogRawFormat", reinterpret_cast(&SbLogRawFormat)}, {"SbThreadCreate", reinterpret_cast(&SbThreadCreate)}, {"SbThreadJoin", reinterpret_cast(&SbThreadJoin)}, {"SbThreadDetach", reinterpret_cast(&SbThreadDetach)}, {"SbThreadYield", reinterpret_cast(&SbThreadYield)}, {"SbThreadSleep", reinterpret_cast(&SbThreadSleep)}, {"SbThreadGetCurrent", reinterpret_cast(&SbThreadGetCurrent)}, {"SbThreadIsEqual", reinterpret_cast(&SbThreadIsEqual)}, {"SbThreadGetId", reinterpret_cast(&SbThreadGetId)}, {"SbThreadGetName", reinterpret_cast(&SbThreadGetName)}, {"SbThreadSetName", reinterpret_cast(&SbThreadSetName)}, {"SbThreadCreateLocalKey", reinterpret_cast(&SbThreadCreateLocalKey)}, {"SbThreadDestroyLocalKey", reinterpret_cast(&SbThreadDestroyLocalKey)}, {"SbThreadGetLocalValue", reinterpret_cast(&SbThreadGetLocalValue)}, {"SbThreadSetLocalValue", reinterpret_cast(&SbThreadSetLocalValue)}, {"SbGetEglInterface", reinterpret_cast(&SbGetEglInterface)}, {"SbGetGlesInterface", reinterpret_cast(&SbGetGlesInterface)}, {"SbMemoryMap", reinterpret_cast(&SbMemoryMap)}, {"SbMemoryUnmap", reinterpret_cast(&SbMemoryUnmap)}, {"SbMemoryProtect", reinterpret_cast(&SbMemoryProtect)}, {"SbUserGetCurrent", reinterpret_cast(&SbUserGetCurrent)}, {"SbStorageOpenRecord", reinterpret_cast(&SbStorageOpenRecord)}, {"SbStorageCloseRecord", reinterpret_cast(&SbStorageCloseRecord)}, {"SbStorageGetRecordSize", reinterpret_cast(&SbStorageGetRecordSize)}, {"SbStorageReadRecord", reinterpret_cast(&SbStorageReadRecord)}, {"SbStorageWriteRecord", reinterpret_cast(&SbStorageWriteRecord)}, {"SbStorageDeleteRecord", reinterpret_cast(&SbStorageDeleteRecord)}, {"SbCPUFeaturesGet", reinterpret_cast(&SbCPUFeaturesGet)}, {"SbSystemGetLocaleId", reinterpret_cast(&SbSystemGetLocaleId)}, {"SbSystemGetProperty", reinterpret_cast(&SbSystemGetProperty)}, {"SbSystemHasCapability", reinterpret_cast(&SbSystemHasCapability)}, {"SbSystemGetNumberOfProcessors", reinterpret_cast(&SbSystemGetNumberOfProcessors)}, {"SbSystemGetTotalCPUMemory", reinterpret_cast(&SbSystemGetTotalCPUMemory)}, {"SbSystemGetRandomData", reinterpret_cast(&SbSystemGetRandomData)}, {"SbSystemGetRandomUInt64", reinterpret_cast(&SbSystemGetRandomUInt64)}, {"SbSystemGetLastError", reinterpret_cast(&SbSystemGetLastError)}, {"SbSystemClearLastError", reinterpret_cast(&SbSystemClearLastError)}, {"SbSystemGetErrorString", reinterpret_cast(&SbSystemGetErrorString)}, {"SbSystemGetExtension", reinterpret_cast(&SbSystemGetExtension)}, {"SbSystemSupportsResume", reinterpret_cast(&SbSystemSupportsResume)}, {"SbSystemHideSplashScreen", reinterpret_cast(&SbSystemHideSplashScreen)}, {"SbEventSchedule", reinterpret_cast(&SbEventSchedule)}, {"SbEventCancel", reinterpret_cast(&SbEventCancel)}, {"kSbFileAltSepChar", reinterpret_cast(&kSbFileAltSepChar)}, {"kSbFileMaxName", reinterpret_cast(&kSbFileMaxName)}, {"kSbFileMaxPath", reinterpret_cast(&kSbFileMaxPath)}, {"kSbFileSepChar", reinterpret_cast(&kSbFileSepChar)}, {"kSbFileSepString", reinterpret_cast(&kSbFileSepString)}, {"kSbMaxSystemPathCacheDirectorySize", reinterpret_cast(&kSbMaxSystemPathCacheDirectorySize)}, {"kSbMaxThreadNameLength", reinterpret_cast(&kSbMaxThreadNameLength)}, {"kSbMaxThreads", reinterpret_cast(&kSbMaxThreads)}, {"kSbMemoryPageSize", reinterpret_cast(&kSbMemoryPageSize)}, {"kSbNetworkReceiveBufferSize", reinterpret_cast(&kSbNetworkReceiveBufferSize)}, {"kSbPathSepChar", reinterpret_cast(&kSbPathSepChar)}, {"kSbPreferredRgbaByteOrder", reinterpret_cast(&kSbPreferredRgbaByteOrder)}, {"SbAccessibilityGetTextToSpeechSettings", reinterpret_cast(&SbAccessibilityGetTextToSpeechSettings)}, {"SbAccessibilityGetDisplaySettings", reinterpret_cast(&SbAccessibilityGetDisplaySettings)}, {"SbAccessibilityGetCaptionSettings", reinterpret_cast(&SbAccessibilityGetCaptionSettings)}, {"SbAccessibilitySetCaptionsEnabled", reinterpret_cast(&SbAccessibilitySetCaptionsEnabled)}, {"SbSpeechSynthesisIsSupported", reinterpret_cast(&SbSpeechSynthesisIsSupported)}, {"SbSpeechSynthesisSpeak", reinterpret_cast(&SbSpeechSynthesisSpeak)}, {"SbSpeechSynthesisCancel", reinterpret_cast(&SbSpeechSynthesisCancel)}, {"SbMicrophoneGetAvailable", reinterpret_cast(&SbMicrophoneGetAvailable)}, {"SbMicrophoneIsSampleRateSupported", reinterpret_cast(&SbMicrophoneIsSampleRateSupported)}, {"SbMicrophoneCreate", reinterpret_cast(&SbMicrophoneCreate)}, {"SbMicrophoneOpen", reinterpret_cast(&SbMicrophoneOpen)}, {"SbMicrophoneClose", reinterpret_cast(&SbMicrophoneClose)}, {"SbMicrophoneRead", reinterpret_cast(&SbMicrophoneRead)}, {"SbMicrophoneDestroy", reinterpret_cast(&SbMicrophoneDestroy)}, {"SbDrmCreateSystem", reinterpret_cast(&SbDrmCreateSystem)}, {"SbDrmGenerateSessionUpdateRequest", reinterpret_cast(&SbDrmGenerateSessionUpdateRequest)}, {"SbDrmUpdateSession", reinterpret_cast(&SbDrmUpdateSession)}, {"SbDrmCloseSession", reinterpret_cast(&SbDrmCloseSession)}, {"SbDrmIsServerCertificateUpdatable", reinterpret_cast(&SbDrmIsServerCertificateUpdatable)}, {"SbDrmUpdateServerCertificate", reinterpret_cast(&SbDrmUpdateServerCertificate)}, {"SbDrmGetMetrics", reinterpret_cast(&SbDrmGetMetrics)}, {"SbDrmDestroySystem", reinterpret_cast(&SbDrmDestroySystem)}, {"SbMediaCanPlayMimeAndKeySystem", reinterpret_cast(&SbMediaCanPlayMimeAndKeySystem)}, {"SbMediaGetAudioBufferBudget", reinterpret_cast(&SbMediaGetAudioBufferBudget)}, {"SbMediaGetAudioConfiguration", reinterpret_cast(&SbMediaGetAudioConfiguration)}, {"SbMediaGetBufferAlignment", reinterpret_cast(&SbMediaGetBufferAlignment)}, {"SbMediaGetBufferAllocationUnit", reinterpret_cast(&SbMediaGetBufferAllocationUnit)}, {"SbMediaGetBufferGarbageCollectionDurationThreshold", reinterpret_cast(&SbMediaGetBufferGarbageCollectionDurationThreshold)}, {"SbMediaGetBufferPadding", reinterpret_cast(&SbMediaGetBufferPadding)}, {"SbMediaGetInitialBufferCapacity", reinterpret_cast(&SbMediaGetInitialBufferCapacity)}, {"SbMediaGetProgressiveBufferBudget", reinterpret_cast(&SbMediaGetProgressiveBufferBudget)}, {"SbMediaGetVideoBufferBudget", reinterpret_cast(&SbMediaGetVideoBufferBudget)}, {"SbMediaIsBufferPoolAllocateOnDemand", reinterpret_cast(&SbMediaIsBufferPoolAllocateOnDemand)}, {"SbStringFormat", reinterpret_cast(&SbStringFormat)}, {"SbStringFormatWide", reinterpret_cast(&SbStringFormatWide)}, {"SbStringScan", reinterpret_cast(&SbStringScan)}, {"SbTimeZoneGetCurrent", reinterpret_cast(&SbTimeZoneGetCurrent)}, {"SbTimeZoneGetName", reinterpret_cast(&SbTimeZoneGetName)}, {"SbSystemNetworkIsDisconnected", reinterpret_cast(&SbSystemNetworkIsDisconnected)}, {"SbSystemGetTotalGPUMemory", reinterpret_cast(&SbSystemGetTotalGPUMemory)}, {"SbSystemGetUsedGPUMemory", reinterpret_cast(&SbSystemGetUsedGPUMemory)}, {"SbSystemGetStack", reinterpret_cast(&SbSystemGetStack)}, {"SbSystemSymbolize", reinterpret_cast(&SbSystemSymbolize)}, {"SbSystemSignWithCertificationSecretKey", reinterpret_cast(&SbSystemSignWithCertificationSecretKey)}, {"SbSystemRaisePlatformError", reinterpret_cast(&SbSystemRaisePlatformError)}, {"SbSystemBreakIntoDebugger", reinterpret_cast(&SbSystemBreakIntoDebugger)}, {"SbSocketGetInterfaceAddress", reinterpret_cast(&SbSocketGetInterfaceAddress)}, {"SbSocketIsConnected", reinterpret_cast(&SbSocketIsConnected)}, {"SbSocketIsConnectedAndIdle", reinterpret_cast(&SbSocketIsConnectedAndIdle)}, {"SbSocketJoinMulticastGroup", reinterpret_cast(&SbSocketJoinMulticastGroup)}, {"SbSocketSetTcpKeepAlive", reinterpret_cast(&SbSocketSetTcpKeepAlive)}, {"SbSocketSetTcpWindowScaling", reinterpret_cast(&SbSocketSetTcpWindowScaling)}, {"SbAudioSinkCreate", reinterpret_cast(&SbAudioSinkCreate)}, {"SbAudioSinkDestroy", reinterpret_cast(&SbAudioSinkDestroy)}, {"SbAudioSinkGetMaxChannels", reinterpret_cast(&SbAudioSinkGetMaxChannels)}, {"SbAudioSinkGetMinBufferSizeInFrames", reinterpret_cast(&SbAudioSinkGetMinBufferSizeInFrames)}, {"SbAudioSinkGetNearestSupportedSampleFrequency", reinterpret_cast(&SbAudioSinkGetNearestSupportedSampleFrequency)}, {"SbAudioSinkIsAudioSampleTypeSupported", reinterpret_cast(&SbAudioSinkIsAudioSampleTypeSupported)}, {"SbAudioSinkIsValid", reinterpret_cast(&SbAudioSinkIsValid)}, {"SbAudioSinkIsAudioFrameStorageTypeSupported", reinterpret_cast(&SbAudioSinkIsAudioFrameStorageTypeSupported)}, {"SbSystemRequestConceal", reinterpret_cast(&SbSystemRequestConceal)}, {"SbSystemRequestFreeze", reinterpret_cast(&SbSystemRequestFreeze)}, {"SbSystemRequestStop", reinterpret_cast(&SbSystemRequestStop)}, {"SbThreadContextGetPointer", reinterpret_cast(&SbThreadContextGetPointer)}, {"SbThreadSamplerCreate", reinterpret_cast(&SbThreadSamplerCreate)}, {"SbThreadSamplerDestroy", reinterpret_cast(&SbThreadSamplerDestroy)}, {"SbThreadSamplerFreeze", reinterpret_cast(&SbThreadSamplerFreeze)}, {"SbThreadSamplerThaw", reinterpret_cast(&SbThreadSamplerThaw)}, {"SbUiNavGetInterface", reinterpret_cast(&SbUiNavGetInterface)}, {"SbDecodeTargetRelease", reinterpret_cast(&SbDecodeTargetRelease)}, {"SbDecodeTargetGetInfo", reinterpret_cast(&SbDecodeTargetGetInfo)}, {"SbPlayerCreate", reinterpret_cast(&SbPlayerCreate)}, {"SbPlayerDestroy", reinterpret_cast(&SbPlayerDestroy)}, {"SbPlayerGetAudioConfiguration", reinterpret_cast(&SbPlayerGetAudioConfiguration)}, {"SbPlayerGetCurrentFrame", reinterpret_cast(&SbPlayerGetCurrentFrame)}, {"SbPlayerGetInfo", reinterpret_cast(&SbPlayerGetInfo)}, {"SbPlayerGetMaximumNumberOfSamplesPerWrite", reinterpret_cast(&SbPlayerGetMaximumNumberOfSamplesPerWrite)}, {"SbPlayerGetPreferredOutputMode", reinterpret_cast(&SbPlayerGetPreferredOutputMode)}, {"SbPlayerSeek", reinterpret_cast(&SbPlayerSeek)}, {"SbPlayerSetBounds", reinterpret_cast(&SbPlayerSetBounds)}, {"SbPlayerSetPlaybackRate", reinterpret_cast(&SbPlayerSetPlaybackRate)}, {"SbPlayerSetVolume", reinterpret_cast(&SbPlayerSetVolume)}, {"SbPlayerWriteEndOfStream", reinterpret_cast(&SbPlayerWriteEndOfStream)}, {"SbPlayerWriteSamples", reinterpret_cast(&SbPlayerWriteSamples)}, {"SbSystemGetUsedCPUMemory", reinterpret_cast(&SbSystemGetUsedCPUMemory)}, {"SbLog", reinterpret_cast(&SbLog)}, {"SbLogRaw", reinterpret_cast(&SbLogRaw)}, {"SbSystemGetPath", reinterpret_cast(&SbSystemGetPath)}, {"SbTimeGetMonotonicNow", reinterpret_cast(&SbTimeGetMonotonicNow)}, {"SbTimeGetMonotonicThreadNow", reinterpret_cast(&SbTimeGetMonotonicThreadNow)}, {"SbTimeGetNow", reinterpret_cast(&SbTimeGetNow)}, {"SbWindowCreate", reinterpret_cast(&SbWindowCreate)}, {"SbWindowDestroy", reinterpret_cast(&SbWindowDestroy)}, {"SbWindowGetDiagonalSizeInInches", reinterpret_cast(&SbWindowGetDiagonalSizeInInches)}, {"SbWindowGetPlatformHandle", reinterpret_cast(&SbWindowGetPlatformHandle)}, {"SbWindowGetSize", reinterpret_cast(&SbWindowGetSize)}, {"SbWindowSetDefaultOptions", reinterpret_cast(&SbWindowSetDefaultOptions)} }; } extern "C" uintptr_t ytv_find_real_starboard_export(const char* name) { if(!name) return 0; for(const Entry& item : kExports) { if(strcmp(name,item.name)==0)return item.pointer; } return 0; } extern "C" unsigned ytv_real_starboard_export_count(void) { return sizeof(kExports)/sizeof(kExports[0]); }