Compare commits

..

2 Commits

Author SHA1 Message Date
70bc3a47f2
add audio and cam permissions
Some checks are pending
ContinuousDelivery / linux-ubuntu (push) Waiting to run
ContinuousDelivery / android (map[ndk_abi:arm64-v8a vcpkg_toolkit:arm64-android]) (push) Waiting to run
ContinuousDelivery / android (map[ndk_abi:x86_64 vcpkg_toolkit:x64-android]) (push) Waiting to run
ContinuousDelivery / windows (push) Waiting to run
ContinuousDelivery / windows-asan (push) Waiting to run
ContinuousDelivery / release (push) Blocked by required conditions
ContinuousIntegration / linux (push) Waiting to run
ContinuousIntegration / android (map[ndk_abi:arm64-v8a vcpkg_toolkit:arm64-android]) (push) Waiting to run
ContinuousIntegration / android (map[ndk_abi:x86_64 vcpkg_toolkit:x64-android]) (push) Waiting to run
ContinuousIntegration / macos (push) Waiting to run
ContinuousIntegration / windows (push) Waiting to run
2024-10-05 18:49:40 +02:00
788abb7383
try to fix android yuv texture uploading 2024-10-05 18:46:55 +02:00
2 changed files with 34 additions and 9 deletions

View File

@ -33,17 +33,15 @@
android:required="false" />
<!-- Audio recording support -->
<!-- if you want to capture audio, uncomment this. -->
<!-- <uses-feature
<uses-feature
android:name="android.hardware.microphone"
android:required="false" /> -->
android:required="false" />
<!-- Camera support -->
<!-- if you want to record video, uncomment this. -->
<!--
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
-->
<uses-feature
android:name="android.hardware.camera"
android:required="false" />
<uses-permission android:name="android.permission.INTERNET" />

View File

@ -79,9 +79,36 @@ uint64_t SDLRendererTextureUploader::upload(const uint8_t* data, uint32_t width,
}
}
// while this split *should* not needed, the opengles renderer might like this more...
if (sdl_format == SDL_PIXELFORMAT_IYUV || sdl_format == SDL_PIXELFORMAT_YV12) {
if (!SDL_UpdateYUVTexture(
tex,
nullptr,
static_cast<const uint8_t*>(surf->pixels),
surf->w * 1,
static_cast<const uint8_t*>(surf->pixels) + surf->w * surf->h,
surf->w/2 * 1,
static_cast<const uint8_t*>(surf->pixels) + (surf->w/2) * (surf->h/2),
surf->w/2 * 1
)) {
std::cerr << "SDLRTU error: tex yuv update failed " << SDL_GetError() << "\n";
}
} else if (sdl_format == SDL_PIXELFORMAT_NV12 || sdl_format == SDL_PIXELFORMAT_NV21) {
if (!SDL_UpdateNVTexture(
tex,
nullptr,
static_cast<const uint8_t*>(surf->pixels),
surf->w * 1,
static_cast<const uint8_t*>(surf->pixels) + surf->w * surf->h,
surf->w * 1
)) {
std::cerr << "SDLRTU error: tex nv update failed " << SDL_GetError() << "\n";
}
} else {
if (!SDL_UpdateTexture(tex, nullptr, surf->pixels, surf->pitch)) {
std::cerr << "SDLRTU error: tex update failed " << SDL_GetError() << "\n";
}
}
if (need_to_lock) {
// error check?