-
Notifications
You must be signed in to change notification settings - Fork 1
/
rtmpStream.h
executable file
·33 lines (18 loc) · 1.13 KB
/
rtmpStream.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
#ifndef _RTMPSTREAM_H_
#define _RTMPSTREAM_H_
#include "Common.h"
RTMP * AllocRtmp();//rtmp初始化
int ConnectToServer(RTMP *rtmp, char *url);
void DisconnectToServer();
int SendAMFPacket(RTMP *rtmp, LPRTMPMetadata lpMetaData);
int SendPacket(RTMP *rtmp, unsigned int nTagType,unsigned char *data,unsigned int size,unsigned int nTimestamp);
int SendVideoSpsPpsPacket(RTMP *rtmp, unsigned char *pps,int pps_len,unsigned char * sps,int sps_len);
int SendH264Packet(RTMP *rtmp, LPRTMPMetadata lpMetaData, unsigned char *data,unsigned int size,int bIsKeyFrame,unsigned int nTimeStamp);
//file referent 可读取h264文件进行发送
int SendH264File(RTMP *rtmp, LPRTMPMetadata lpMetaData, char *filename);
int Geth264FileSpsPpsData(unsigned char *fileData, int fileLength, LPRTMPMetadata pMetaData);
//bool parseSpsData(LPRTMPMetadata pMetaData);
int ReadOneNaluFromBuf(NaluUnit *nalu, unsigned char *data, int dataLength);//h264数据获取每一个Nalu,可以处理文件也可以处理缓存
//H264 缓存数据的操作
int putH264BufferToRtmpStream(RTMP *rtmp, LPRTMPMetadata lpMetaData, unsigned char *h264Buffer, unsigned int h264size);
#endif