-
Notifications
You must be signed in to change notification settings - Fork 0
/
output.c
52 lines (44 loc) · 866 Bytes
/
output.c
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
#include "output.h"
#include "getstream.h"
#include "sap.h"
void output_send(struct output_s *o, uint8_t *tsp) {
/* Does this stream output have receiver */
if (o->receiver == 0)
return;
switch(o->type) {
case(OTYPE_UDP):
output_send_udp(o, tsp);
break;
case(OTYPE_RTP):
case(OTYPE_RTCP):
output_send_rtp(o, tsp);
break;
case(OTYPE_HTTP):
output_send_http(o, tsp);
break;
case(OTYPE_PIPE):
output_send_pipe(o, tsp);
break;
}
}
int output_init(struct output_s *o) {
/* Initialize all stream outputs for this stream */
switch(o->type) {
case(OTYPE_HTTP):
output_init_http(o);
break;
case(OTYPE_UDP):
output_init_udp(o);
break;
case(OTYPE_RTP):
case(OTYPE_RTCP):
output_init_rtp(o);
break;
case(OTYPE_PIPE):
output_init_pipe(o);
break;
}
if (o->sap)
sap_init(o->sap);
return 1;
}