forked from xufuji456/FFmpegAndroid
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVideoStream.h
More file actions
39 lines (24 loc) · 739 Bytes
/
VideoStream.h
File metadata and controls
39 lines (24 loc) · 739 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
#ifndef VIDEOSTREAM_H
#define VIDEOSTREAM_H
#include <inttypes.h>
#include <mutex>
#include "rtmp/rtmp.h"
#include "x264/x264.h"
class VideoStream {
typedef void (*VideoCallback)(RTMPPacket *packet);
private:
std::mutex m_mutex;
int m_frameLen;
x264_t *videoCodec = 0;
x264_picture_t *pic_in = 0;
VideoCallback videoCallback;
void sendSpsPps(uint8_t *sps, uint8_t *pps, int sps_len, int pps_len);
void sendFrame(int type, uint8_t *payload, int i_payload);
public:
VideoStream();
~VideoStream();
int setVideoEncInfo(int width, int height, int fps, int bitrate);
void encodeVideo(int8_t *data, int camera_type);
void setVideoCallback(VideoCallback videoCallback);
};
#endif