CCIMXDesktop
 
Loading...
Searching...
No Matches
VideoPlayerImpl.h
1#ifndef VIDEOPLAYERIMPL_H
2#define VIDEOPLAYERIMPL_H
3#include "CVImage.h"
4#include <QString>
5static constexpr short INVALID_VIDEO_FRAME_N = -1;
6
11enum class VideoPlayerOpenErrorCode {
12 NoError,
13 DupOpen,
14 FileUnExsited,
15 OpenFailed,
16};
17
22struct VideoPlayerInfo {
23 int fps;
24 int width;
25 int height;
26};
27
33class VideoPlayerImpl {
34public:
39 VideoPlayerImpl() = default;
40 virtual ~VideoPlayerImpl() = default;
46
47 /* data interfaces */
48 /* current video owns frame waiting for display */
53 virtual int total_frame() const = 0;
54
59 virtual int current_frame() = 0;
60
68 virtual bool rollto_nextFrame(CVImage& container) = 0;
78 virtual bool peek_frame(CVImage& container, int frame_request) = 0;
85
91 virtual void escapeFrame() = 0;
92
98 virtual void jumpToFrame(int frame_request) = 0;
99
100 /*
101 * Function interfaces
102 */
103
111 virtual bool open(const char* filename, VideoPlayerOpenErrorCode& error_code) = 0;
112
117 virtual bool isOpened() const = 0;
118
124 virtual void close() = 0;
125};
126
132public:
138};
139
140#endif // VIDEOPLAYERIMPL_H
The CVImage class is the image class that provides the image in the frameworks.
Definition CVImage.h:9
The VideoPlayerImplFactory class is the factory class for the video player impl.
Definition VideoPlayerImpl.h:131
static VideoPlayerImpl * request_impl()
request_impl fetch the IMPL according platform/backend framework
The VideoPlayerImpl class VideoPlayerImpl is the interface for video player and the impl class is sup...
Definition VideoPlayerImpl.h:33
virtual bool rollto_nextFrame(CVImage &container)=0
rollto_nextFrame roll to the next frame
virtual int current_frame()=0
current_frame get the current frame of the video
Q_DISABLE_COPY(VideoPlayerImpl)
Copy is not acceptable for video.
virtual bool open(const char *filename, VideoPlayerOpenErrorCode &error_code)=0
open open the video file
virtual bool peek_frame(CVImage &container, int frame_request)=0
peek_frame peek the frame of the video
VideoPlayerImpl()=default
Construct a new Video Player Impl object.
virtual void close()=0
close close the video file
virtual void escapeFrame()=0
escapeFrame escape the current frame
virtual int total_frame() const =0
total_frame get the total frame of the video
virtual VideoPlayerInfo current_video_info() const =0
current_video_info get the current video information
virtual void jumpToFrame(int frame_request)=0
jumpToFrame jump to the frame of the video
virtual bool isOpened() const =0
isOpened check if the video is opened
The VideoPlayerInfo struct provides the video information.
Definition VideoPlayerImpl.h:22
int width
video width
Definition VideoPlayerImpl.h:24
int height
video height
Definition VideoPlayerImpl.h:25
int fps
fps
Definition VideoPlayerImpl.h:23