Переглянути джерело

Z991239-1387 #comment other: 图片播放增加支持jpg格式

陈礼鹏80274480 4 роки тому
батько
коміт
9b649d10ce

+ 1 - 1
Other/libmediaplayer/CMakeLists.txt

@@ -28,7 +28,7 @@ BASIC_SETUP CMAKE_TARGETS
 BUILD missing)
 else(WIN32)
 conan_cmake_run(REQUIRES ffmpeg/4.1.6@LR04.02_ThirdParty/dynamic
-SDL2/2.0.12@LR04.02_ThirdParty/stable
+SDL2/2.0.12@LR04.02_ThirdParty/shared
 BASIC_SETUP CMAKE_TARGETS
 BUILD missing)
 endif(WIN32)

+ 1 - 1
Other/libpictureplayer/CMakeLists.txt

@@ -15,7 +15,7 @@ if(WIN32)
 conan_cmake_run(REQUIRES SDL2/2.0.9@LR04.02_ThirdParty/testing
 BASIC_SETUP CMAKE_TARGETS)
 else(WIN32)
-conan_cmake_run(REQUIRES SDL2/2.0.12@LR04.02_ThirdParty/stable
+conan_cmake_run(REQUIRES SDL2/2.0.12@LR04.02_ThirdParty/shared
 BASIC_SETUP CMAKE_TARGETS)
 endif(WIN32)
 

+ 8 - 5
Other/libpictureplayer/CPicturePlayer.cpp

@@ -206,14 +206,17 @@ bool CPicturePlayer::StartPicPlay()
 			if (m_busrstop) {
 				break;
 			}
-			SDL_Surface* image = SDL_LoadBMP(m_strfile_names[index]);
-			//SDL_Surface* image = IMG_Load(is->m_strfile_names[index]);
+			
+			SDL_Surface* image = IMG_Load(m_strfile_names[index]);
 			if (NULL == image) {
-				m_pHostApi->PicDebug("SDL_LoadBMP %s failed!", m_strfile_names[index]);
-				continue;
+				m_pHostApi->PicDebug("IMG_Load %s failed!", m_strfile_names[index]);
+				image = SDL_LoadBMP(m_strfile_names[index]);
+				if (NULL == image) {
+					continue;
+				}
 			}
 			else {
-				m_pHostApi->PicDebug("SDL_LoadBMP %s success!", m_strfile_names[index]);
+				m_pHostApi->PicDebug("IMG_Load %s success!", m_strfile_names[index]);
 			}
 
 			SDL_Rect dst;

+ 2 - 2
Other/libpictureplayer/CPicturePlayer.h

@@ -18,14 +18,14 @@ extern "C"
 #include <SDL_render.h>
 #include <SDL_rect.h>
 #include <SDL_mutex.h>
-//#include <SDL_image.h>
+#include <SDL_image.h>
 #else
 #include <SDL2/SDL.h>
 #include <SDL2/SDL_video.h>
 #include <SDL2/SDL_render.h>
 #include <SDL2/SDL_rect.h>
 #include <SDL2/SDL_mutex.h>
-//#include <SDL2/SDL_image.h>
+#include <SDL2/SDL_image.h>
 #endif
 
 #ifdef __cplusplus