forked from zhuohengfeng/OpenCVFFmpegRtmp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathXRtmp.h
More file actions
43 lines (29 loc) · 809 Bytes
/
XRtmp.h
File metadata and controls
43 lines (29 loc) · 809 Bytes
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
//
// Created by hengfeng zhuo on 2019-07-20.
//
#ifndef OPENCVFFMPEGRTMP_XRTMP_H
#define OPENCVFFMPEGRTMP_XRTMP_H
// 为了编译过,不引入头文件
struct AVCodecContext;
struct AVPacket;
/**
* 负责封装mux和推流
*/
class XRtmp {
public:
// 工厂方法
static XRtmp* getInstance(unsigned char index = 0);
// 初始化封装器MUX上下文
virtual bool InitMux(const char* url) = 0;
// 添加视频或者音频流
virtual int AddStream(const AVCodecContext* codecContext) = 0;
// 打开RTMP网络IO,发送封装头MUX
virtual bool SendMuxHead() = 0;
// RTMP推流
virtual bool SendFrame(AVPacket* pack, int streamIndex) = 0;
virtual void Close() = 0;
virtual ~XRtmp();
protected:
XRtmp();
};
#endif //OPENCVFFMPEGRTMP_XRTMP_H