-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmediaserver.h
53 lines (43 loc) · 997 Bytes
/
mediaserver.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
#ifndef VIDEOAPI_MEDIASERVER_H
#define VIDEOAPI_MEDIASERVER_H
#include <ev.h>
#include "radixtree/radix.h"
#include "rtmp.h"
#ifndef videoapi_unused
#if defined(__GNUC__)
# define videoapi_unused __attribute__((unused))
#else
# define videoapi_unused
#endif
#endif
#define QUOTELITERAL(x) #x
#define QUOTEVALUE(x) QUOTELITERAL(x)
typedef struct {
rtmp *rtmp_handle;
rtmp_stream *stream;
}stream_mapping;
typedef struct {
stream_mapping **list; // receivers
rtmp_stream *stream;
int nb_recvs;
int max_recvs;
}recv_ctx;
struct srv_ctx;
typedef struct client_ctx {
int id;
rtmp rtmp_handle;
recv_ctx *outgoing;
ev_io read_watcher;
struct srv_ctx *srv;
struct client_ctx *next;
}client_ctx;
typedef struct srv_ctx {
int fd;
int connections;
int total_cxns;
struct ev_loop *loop;
ev_io io; /* socket listener event */
client_ctx *clients;
rxt_node *streams;
}srv_ctx;
#endif //VIDEOAPI_MEDIASERVER_H