123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- #ifndef __CPICTURE_PLAYER_H__
- #define __CPICTURE_PLAYER_H__
- #include <stdio.h>
- #include <stdint.h>
- #include <stdbool.h>
- #include <semaphore.h>
- #include "ipicdatastruct.h"
- #ifdef __cplusplus
- extern "C"
- {
- #endif // __cplusplus
- #if defined(_WIN32)
- #include <SDL.h>
- #include <SDL_video.h>
- #include <SDL_render.h>
- #include <SDL_rect.h>
- #include <SDL_mutex.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>
- #endif
- #ifdef __cplusplus
- }
- #endif // __cplusplus
- #ifndef MAX_FILECOUNT
- #define MAX_FILECOUNT 32
- #endif // !MAX_FILECOUNT
- #ifndef MAX_PATH
- #define MAX_PATH 260
- #endif
- #ifndef MAX_DISPLAYNUM
- #define MAX_DISPLAYNUM 5
- #endif // !MAX_DISPLAYNUM
- typedef struct rvc_picture_player_param_s {
- int icx;
- int icy;
- uint8_t uwindow_width;
- uint8_t uwindow_height;
- bool bfull_screen;
- bool bprim_monitor;
- int nfile_cnt;
- int nplay_cnt;
- int nplay_interval;
- char strroot_path[MAX_PATH];
- char strfile_names[MAX_FILECOUNT][MAX_PATH];
- }rvc_picture_player_param_t;
- class CPicturePlayer
- {
- public:
- CPicturePlayer(CPicHostApi* pHostApi);
- ~CPicturePlayer();
- int InitParam(rvc_picture_player_param_t* tparam);
- int DeInit();
- bool StartPicPlay();
- int StopPicPlay();
- bool GetPicPlayingFlag();
- bool SetPicPlayingFlag(bool bret);
- size_t GetVideoDisplayInfo();
- public:
- SDL_Window* m_window;
- CPicHostApi* m_pHostApi;
- int m_nfile_cnt;
- int m_nplay_cnt;
- int m_nplay_interval;
- char m_strroot_path[MAX_PATH];
- char m_strfile_names[MAX_FILECOUNT][MAX_PATH];
- int m_show_width;
- int m_show_height;
- bool m_busrstop;
-
- private:
- bool m_bplaying;
- char* m_stricopath;
- SDL_Thread* m_thid;
- SDL_DisplayMode m_dispalymode[MAX_DISPLAYNUM];
- sem_t m_play_exit_sem;
- };
- #endif
|