-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplayer.h
43 lines (35 loc) · 1.06 KB
/
player.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
#ifndef __PLAYER_H__
#define __PLAYER_H__
#include <string>
#include <fstream>
const unsigned int PLAYER_SOCKETS_NR = 2;
const unsigned int PLAYER_PARAMETERS_NR = 6;
const unsigned int MAX_BUF_SIZE = 32768;
const int MAX_PORT = 65335;
const std::string TITLE_STR = "StreamTitle='";
struct Parameters {
std::string host;
std::string path;
int serv_port;
int our_udp_port;
std::string output_file;
bool md;
};
std::string create_request(std::string path, std::string meta);
int setup_tcp_client(std::string host, std::string path,
int servPort, bool md);
int setup_udp_server(int port);
void process_udp_event(int udp_fd);
void process_tcp_event(int tcp_fd, bool is_player_paused);
void pause_player();
void resume_player();
void send_title(int udp_fd, struct sockaddr client_address);
void finito_amigos();
extern int md_int;
extern std::string last_received_title;
extern bool is_md_in_data;
extern bool is_md_int_fetched;
extern bool is_player_paused;
extern bool is_output_to_file;
extern std::ofstream output_to_file_stream;
#endif