-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdecoderabstract.h
More file actions
51 lines (41 loc) · 1.05 KB
/
decoderabstract.h
File metadata and controls
51 lines (41 loc) · 1.05 KB
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
#ifndef DECODERABSTRACT_H
#define DECODERABSTRACT_H
/*
* Defined interface of decoder module
* This interface is designed according to ffmpeg
* Maybe refactor to more general form future
*/
#include <atomic>
struct AVCodecParameters;
struct AVFrame;
struct AVPacket;
class DecoderAbstract
{
public:
/**
* Open decoder module with codec parameter
* @param para can be obtained from demuxer
* @param threadNum is num of thread for decode
* @return success or failed
*/
virtual bool open(AVCodecParameters *para, int threadNum) = 0;
/**
* Push demuxed data to decode queue
* @param pkt is data after demux
* @return success or failed
*/
virtual bool push2DecodeQueue(AVPacket *pkt) = 0;
/**
* Get decode data
* @return decoded data
*/
virtual AVFrame* getDecodeData() = 0;
/**
* Clear and close decoder
* @return decoded data
*/
virtual void close() = 0;
// pts: for synchonize
std::atomic_uint64_t pts = 0;
};
#endif // DECODERABSTRACT_H