From 146a9558417298e3d8ec620e9b1d9300f3b4a5dc Mon Sep 17 00:00:00 2001 From: JIe Jie Date: Thu, 22 Feb 2024 18:05:00 +0800 Subject: [PATCH] videoDecoder , --- include/{decoder.h => videoDecoder.h} | 0 main.cc | 8 +++++--- src/{decoder.cc => videoDecoder.cc} | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) rename include/{decoder.h => videoDecoder.h} (100%) rename src/{decoder.cc => videoDecoder.cc} (98%) diff --git a/include/decoder.h b/include/videoDecoder.h similarity index 100% rename from include/decoder.h rename to include/videoDecoder.h diff --git a/main.cc b/main.cc index 860f923..d7a378a 100644 --- a/main.cc +++ b/main.cc @@ -1,11 +1,12 @@ #include #include -#include #include #include +#define SDL_MAIN_HANDLED +#include #include "util.h" -#include "decoder.h" +#include "videoDecoder.h" #include "shaderService.h" #include "shader.h" using std::cout; @@ -151,7 +152,8 @@ void OpenglRenderVideo(VideoParam& videoParam, const OpenglVideoParam& openglVid glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_INT, nullptr); } -int main(int argc, char** const argv) + +int main(int argc, char** argv) { // Check File const char* targetFilepath = argv[1]; diff --git a/src/decoder.cc b/src/videoDecoder.cc similarity index 98% rename from src/decoder.cc rename to src/videoDecoder.cc index a5a901a..7e6c326 100644 --- a/src/decoder.cc +++ b/src/videoDecoder.cc @@ -1,4 +1,4 @@ -#include "decoder.h" +#include "videoDecoder.h" #include #include using namespace std::literals::chrono_literals; @@ -37,6 +37,7 @@ void RequestPacket(VideoParam& param) { std::this_thread::sleep_for(100ms); continue; } + //FIX: const int ret = av_read_frame(fmtCtx, packet); if (param.eof) { std::this_thread::sleep_for(100ms);