forked from Motion-Project/motion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnetcam_rtsp.h
50 lines (41 loc) · 1.43 KB
/
netcam_rtsp.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
#ifndef _INCLUDE_NETCAM_RTSP_H
#define _INCLUDE_NETCAM_RTSP_H
#include "netcam.h"
#ifdef HAVE_FFMPEG
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavformat/avio.h>
#include <libavutil/avutil.h>
#include <libavutil/imgutils.h>
#include <libswscale/swscale.h>
struct rtsp_context {
AVFormatContext* format_context;
AVCodecContext* codec_context;
AVFrame* frame;
AVFrame* swsframe_in;
AVFrame* swsframe_out;
int swsframe_size;
int video_stream_index;
char* path;
char* user;
char* pass;
const char* netcam_url;
int interrupted;
int active;
enum RTSP_STATUS status;
struct timeval startreadtime;
struct SwsContext* swsctx;
};
#else /* Do not have FFmpeg */
struct rtsp_context {
int* format_context;
enum RTSP_STATUS status;
};
#endif /* end HAVE_FFMPEG */
struct rtsp_context *rtsp_new_context(void);
void netcam_shutdown_rtsp(netcam_context_ptr netcam);
int netcam_connect_rtsp(netcam_context_ptr netcam);
int netcam_read_rtsp_image(netcam_context_ptr netcam);
int netcam_setup_rtsp(netcam_context_ptr netcam, struct url_t *url);
int netcam_next_rtsp(unsigned char *image , netcam_context_ptr netcam);
#endif /* _INCLUDE_NETCAM_RTSP_H */