| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- #pragma once
- #include "ivideorenderinterface.h"
- #include <SDL2/SDL.h>
- #include <SDL2/SDL_video.h>
- #include <SDL2/SDL_render.h>
- #include <SDL2/SDL_rect.h>
- #include <SDL2/SDL_mutex.h>
- class VideoRenderImpl : public IVideoRender
- {
- public:
- VideoRenderImpl(videorender_callback_t* pCallback);
- ~VideoRenderImpl();
- int VideoRenderSetParam(videorender_param_t* tparam);
- int StartVideoRender();
- int StopVideoRender();
- void VideoRenderDestroy();
- int ShowVideoWindow();
- int HideVideoWindow();
- int RenderVideoFrame(video_frame* pframe, RVC_RendererFlip eFlipType = RVC_FLIP_NONE);
- int SetWindowProperty(videorender_param_t* tparam);
- SDL_PixelFormatEnum GetPixelFormat();
- void ConVert24to32(unsigned char* image_in, unsigned char* image_out, int w, int h);
- bool GetReFreshFlag();
- void RenderLog(const char* fmt, ...);
- private:
- SDL_Window* m_sdl_window;
- SDL_Texture* m_rending_texture;
- SDL_Renderer* m_renderer;
- videorender_callback_t m_callback;
- SDL_Thread *m_refresh_thread;
- bool m_refresh_flag;
- int m_cx;
- int m_cy;
- uint32_t m_videowidth;
- uint32_t m_videoheight;
- uint32_t m_width;
- uint32_t m_height;
- uint32_t m_flags;
- int m_videoformat;
- bool m_bmoveable;
- };
|