1 /* includes default */
2 #include <stdio.h>
3 #include <stdlib.h>
4 #include <string.h>
5 
6 /* includes for gpac library */
7 #include <gpac/scene_engine.h>
8 #include <gpac/config_file.h>
9 #include <gpac/thread.h>
10 #include <gpac/network.h>
11 #include <gpac/ietf.h>
12 #include <gpac/mpeg4_odf.h>
13 #include <gpac/base_coding.h>
14 #include <gpac/constants.h>
15 #include <gpac/scene_manager.h>
16 #include <gpac/bifs.h>
17 
18 /* includes for BIFS carousel */
19 /* RTP sends */
20 #include "RTP_serv_sender.h"
21 /* packetization */
22 #include "RTP_serv_packetizer.h"
23 /* applicative module */
24 #include "RTP_serv_generator.h"
25 
26 /* for SDP generation */
27 #include "sdp_generator.h"
28 
29 /* definitions */
30 #define MAX_BUF 4096
31 
32 /* configuration data*/
33 #define MAIN_SECTION "Broadcaster"
34 #define SCENE_INIT "InitialScene"
35 #define RAP_TIMER "RAPPeriod"
36 #define PORT_CONFIG "ConfigPort"
37 #define PORT_MODIF "SceneUpdatePort"
38 
39 #define DEST_SECTION "Destination"
40 #define DEST_ADDRESS "IP"
41 #define PORT_OUTPUT "Port"
42 
43 #define FEEDBACK_SECTION "Feedback"
44 #define IP_FEEDBACK "IP"
45 #define PORT_FEEDBACK "Port"
46 
47 /* data struct on the server side */
48 typedef struct config_data
49 {
50 	const char *rap_timer;
51 	const char *scene_init_file;
52 	const char *modif_input_port;
53 	const char *config_input_port;
54 
55 	const char *feedback_ip;
56 	const char *feedback_port;
57 
58 	const char *dest_ip;
59 	const char *dest_port;
60 } CONF_Data;
61 
62 typedef struct tcp_input
63 {
64 	u16 port;	// server port
65 	u32 *config_flag;	// indicates whether the tcp server waits for configuration data
66 	// GF_Socket *socket;	// socket tcp for the GUI interface
67 	u32 *RAPtimer;
68 	CONF_Data *config;
69 	u32 status;
70 	int debug;
71 } TCP_Input;
72 
73 typedef struct rap_input
74 {
75 	GF_Mutex *carrousel_mutex;
76 	u32 *RAPtimer;
77 	PNC_CallbackData *data;
78 	u32 status;
79 } RAP_Input;
80 
81 /*void command_line_parsing(int* argc, const char** argv, int *tcp_port, const char *config_file, int *config_flag);
82 int server_command_line(char *arg_a, char *arg_b, char *value, int argument);*/
83 u32 tcp_server(void *par);
84 u32 RAP_send(void *par);
85 void print_usage(void);
86