This commit is contained in:
2026-03-29 09:18:56 +09:00
parent a5c0bd67a8
commit e056e68808
4 changed files with 83 additions and 12 deletions
+2 -2
View File
@@ -227,7 +227,7 @@ bool MediaAsset::loadVideoWithFFmpeg(int fd) {
}
width_ = codecCtx_->width;
height_ = codecCtx_->height;
swsCtx_ = sws_getContext(width_, height_, codecCtx_->pix_fmt, width_, height_, AV_PIX_FMT_RGBA, SWS_BILINEAR, nullptr, nullptr, nullptr);
swsCtx_ = sws_getContext(width_, height_, codecCtx_->pix_fmt, width_, height_, AV_PIX_FMT_BGRA, SWS_BILINEAR, nullptr, nullptr, nullptr);
if (!swsCtx_) {
LOGE("Could not create SwsContext");
release(); return false;
@@ -265,7 +265,7 @@ bool MediaAsset::loadVideoWithFFmpeg(const std::string& path) {
frame_ = av_frame_alloc(); packet_ = av_packet_alloc();
if (!frame_ || !packet_) { release(); return false; }
width_ = codecCtx_->width; height_ = codecCtx_->height;
swsCtx_ = sws_getContext(width_, height_, codecCtx_->pix_fmt, width_, height_, AV_PIX_FMT_RGBA, SWS_BILINEAR, nullptr, nullptr, nullptr);
swsCtx_ = sws_getContext(width_, height_, codecCtx_->pix_fmt, width_, height_, AV_PIX_FMT_BGRA, SWS_BILINEAR, nullptr, nullptr, nullptr);
if (!swsCtx_) { release(); return false; }
rgbBuffer_.resize(width_ * height_ * 4);
LOGI("Successfully loaded video from path: %s", path.c_str());
+1 -1
View File
@@ -252,7 +252,7 @@ void Renderer::renderFrame(ANativeWindow* window) {
currentFrameDelay_ = std::chrono::milliseconds(static_cast<long long>(1000.0 / currentMedia_.getFps()));
LOGI("Media type: Video. Frame delay set to %lldms for %.2f FPS", currentFrameDelay_.count(), currentMedia_.getFps());
} else {
currentFrameDelay_ = std::chrono::milliseconds(33); // 이미지일 경우 30fps
currentFrameDelay_ = std::chrono::milliseconds(70); // 이미지일 경우 30fps
LOGI("Media type: Image. Frame delay set to 33ms (~30 FPS)");
}
currentState_ = RenderState::ANIMATING;
+1 -1
View File
@@ -93,7 +93,7 @@ Java_bums_lunatic_launcher_wall_NativeRenderer_nativeStartRenderLoop(JNIEnv* env
LOGE("Could not get ANativeWindow from Surface.");
return;
}
ANativeWindow_setBuffersGeometry(window, 0, 0, WINDOW_FORMAT_RGBA_8888);
ANativeWindow_setBuffersGeometry(window, 0, 0, WINDOW_FORMAT_RGBX_8888);
renderer->startRenderLoop(window);
ANativeWindow_release(window);
}