-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathRtspParser.h
executable file
·55 lines (46 loc) · 1.11 KB
/
RtspParser.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
52
53
54
55
/*
* RtspParser.h
*
* Created on: Dec 22, 2014
* Author: rayan
*/
#ifndef SRC_RTSPPARSER_H_
#define SRC_RTSPPARSER_H_
typedef int (*fDataReadyCallback)(long lMainEventType, long lSubEventType, void* pReserved, void* pData);
enum MediaType {
MEDIA_TYPE_UNKNOWN = -1,
MEDIA_TYPE_VIDEO,
MEDIA_TYPE_AUDIO
};
// callback main event
enum eventCB {
cb_dataReady = 0,
cb_receiveNoData,
cb_prepareReconnect,
} eventCB;
typedef struct FrameData {
long TimeStamp;
long frameDuration;
long FrameType;
long FrameLen;
char* pdata;
};
typedef struct MediaData {
int width;
int height;
char* extraSPS;
int extraSPS_Len;
};
class CRtspParser {
public:
CRtspParser();
virtual ~CRtspParser();
public:
int rtspClientOpenAndPlay(char const* progName, char const* rtspURL, int nIpcID, void* pStreamObj);
int rtspClientReadFrame(int nIpcID, FrameData* pFrameData);
int rtspClientCloseAllStream(void);
int rtspClientCloseStream(int nIpcID);
int rtspClinetGetMediaInfo(int nIpcID, MediaData& mediaData);
void setCallback(int nIpcID, void* pStreamObj, fDataReadyCallback Callback);
};
#endif /* SRC_RTSPPARSER_H_ */