Compare commits
2 Commits
211ecd1aa1
...
70bc3a47f2
Author | SHA1 | Date | |
---|---|---|---|
70bc3a47f2 | |||
788abb7383 |
@ -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" />
|
||||
|
||||
|
@ -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?
|
||||
|
Loading…
Reference in New Issue
Block a user