-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathFFmpegDecoder.h
51 lines (34 loc) · 934 Bytes
/
FFmpegDecoder.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
//
// Created by Cry on 2018-12-20.
//
#ifndef APPREMOTE_FFMPEGDECODER_H
#define APPREMOTE_FFMPEGDECODER_H
#include <SDL2/SDL_stdinc.h>
#include <SDL2/SDL_thread.h>
#include "SocketConnection.h"
#include "FrameCache.h"
#include "SDL2/SDL_events.h"
#include "SDL_Screen.h"
#define BUF_SIZE 0x10000
class FFmpegDecoder {
public:
SocketConnection *connection;
FrameCache *cache;
SDL_Thread *decoder_tid;
SDL_Screen *screen;
AVFormatContext *format_ctx;
AVCodecContext *codec_ctx;
AVIOContext *avio_ctx;
AVPacket *packet;
SDL_bool request_stop;
Size latestSize;
FFmpegDecoder(SocketConnection *connection);
FFmpegDecoder(SocketConnection *connection, FrameCache *cache, SDL_Screen *screen);
SDL_bool init();
SDL_bool async_start();
SDL_bool resize(Size nSize);
void _decode_loop();
void stop();
void destroy();
};
#endif //APPREMOTE_FFMPEGDECODER_H