基于qt,msvc2017-64bits,ffmpeg.opengl的播放器
zhangmeng
2021-03-03 4a6d9312cc1c9d62d66c4def71246d9faae29edb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef VIDEOFRAME_H
#define VIDEOFRAME_H
 
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <memory>
 
#define VideoFramePtr std::shared_ptr<VideoFrame>
 
class VideoFrame
{
public:
    VideoFrame();
    ~VideoFrame();
 
    void initBuffer(const int &width, const int &height);
 
    void setYUVbuf(const uint8_t *buf);
    void setYbuf(const uint8_t *buf);
    void setUbuf(const uint8_t *buf);
    void setVbuf(const uint8_t *buf);
 
    uint8_t * buffer(){return mYuv420Buffer;}
    int width(){return mWidth;}
    int height(){return mHegiht;}
 
protected:
    uint8_t *mYuv420Buffer;
 
    int mWidth;
    int mHegiht;
};
 
#endif // VIDEOFRAME_H