forked from Motion-Project/motion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnetcam_rtsp.h
43 lines (37 loc) · 1.33 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
#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>
#endif /* end HAVE_FFMPEG */
struct rtsp_context {
#ifdef HAVE_FFMPEG
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;
int readingframe;
int status;
struct timeval startreadtime;
struct SwsContext* swsctx;
#else /* Do not have FFmpeg */
int* format_context;
int readingframe;
int 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);