-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathPlayer.h
54 lines (36 loc) · 976 Bytes
/
Player.h
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include "stdafx.h"
class Player
{
public:
static Player* get_instance();
void run(std::string, std::string window_name="");
void clear();
static int getAudioPacket(AudioPacket*, AVPacket*, int);
private:
static Player* instance;
Player() {}
void open();
int malloc(void);
int display_video(void);
int create_display(void);
int get_video_stream(void);
int read_audio_video_codec(void);
std::string video_addr;
std::string window_name;
int videoStream = 0;
int audioStream = 0;
AVFormatContext* pFormatCtx = NULL;
AVCodecParameters* pCodecParameters = NULL;
AVCodecParameters* pCodecAudioParameters = NULL;
AVCodecContext* pCodecCtx = NULL;
AVCodecContext* pCodecAudioCtx = NULL;
AVCodec* pCodec = NULL;
AVCodec* pAudioCodec = NULL;
AVFrame* pFrame = NULL;
AVFrame* pFrameRGB = NULL;
uint8_t* buffer = NULL;
SDL_Window* screen = NULL;
SDL_Renderer* renderer = NULL;
SDL_Texture* bmp = NULL;
struct SwsContext* sws_ctx = NULL;
};