Statistics
| Branch: | Revision:

chunker-player / chunker_player / chunker_player.h @ 74564eb3

History | View | Annotate | Download (2.91 KB)

1 1e69ae95 GiuseppeTropea
#ifndef _CHUNKER_PLAYER_H
2
#define _CHUNKER_PLAYER_H
3
4 10c75ef7 GiuseppeTropea
#include "player_defines.h"
5
#include <SDL.h>
6
#include <SDL_mutex.h>
7 78068e21 GiuseppeTropea
8
typedef struct SChannel
9
{
10
        char LaunchString[255];
11
        char Title[255];
12 3a240a99 GiuseppeTropea
        int Width;
13
        int Height;
14
        float Ratio;
15 e11386c0 CsabaKiraly
        int Bitrate;
16 3a240a99 GiuseppeTropea
        int SampleRate;
17
        short int AudioChannels;
18 10c75ef7 GiuseppeTropea
        int Index;
19 dae4a53f GiuseppeTropea
        //quality related info
20
        double instant_score; //updated continuously
21
        double average_score; //updated on a long term time window (i.e. 2 minutes)
22
        double score_history[CHANNEL_SCORE_HISTORY_SIZE];
23
        int history_index;
24
        char quality[255];
25
        int startTime;
26 78068e21 GiuseppeTropea
} SChannel;
27
28 10c75ef7 GiuseppeTropea
SDL_mutex *OverlayMutex;
29
SDL_Overlay *YUVOverlay;
30
SDL_Rect OverlayRect;
31
SDL_Surface *MainScreen;
32
int SilentMode;
33
int queue_filling_threshold;
34
int quit;
35
short int QueueFillingMode;
36 e11386c0 CsabaKiraly
int LogTraces;
37 74564eb3 CarmeloDaniele
char NetworkID[255];
38 e11386c0 CsabaKiraly
39
#ifdef EMULATE_CHUNK_LOSS
40
typedef struct
41
{
42
        time_t Time;
43
        unsigned int Value;
44
        unsigned int MinValue;
45
        unsigned int MaxValue;
46
        unsigned int Burstiness;
47
} SChunkLoss;
48
SChunkLoss* ScheduledChunkLosses;
49
int CurrChunkLossIndex, NScheduledChunkLosses;
50
#endif
51
52
void* P2PProcessHandle;
53 10c75ef7 GiuseppeTropea
54
#ifdef __WIN32__
55 e11386c0 CsabaKiraly
//~ #define KILL_PROCESS(pid) {char command_name[255]; sprintf(command_name, "taskkill /pid %d /F", pid); system(command_name);}
56
#define KILL_PROCESS(handle) {TerminateProcess(((PROCESS_INFORMATION*)handle)->hProcess, 0);}
57 10c75ef7 GiuseppeTropea
#define KILLALL(pname) {char command_name[255]; sprintf(command_name, "taskkill /im %s /F", pname); system(command_name);}
58 e11386c0 CsabaKiraly
//#endif
59
//#ifdef __LINUX__
60
#else
61
#define KILL_PROCESS(handle) {if(*((pid_t*)handle)>0){char command_name[255]; sprintf(command_name, "kill %d", *((pid_t*)handle)); system(command_name);}}
62 10c75ef7 GiuseppeTropea
#define KILLALL(pname) {char command_name[255]; sprintf(command_name, "killall %s -9", pname); system(command_name);}
63
#endif
64 e11386c0 CsabaKiraly
//#ifdef __MACOS__
65
//#define KILL_PROCESS(handle) {if(*((pid_t*)handle)>0){char command_name[255]; sprintf(command_name, "kill %d", *((pid_t*)handle)); system(command_name);}}
66
//#define KILLALL(pname) {char command_name[255]; sprintf(command_name, "killall %s -9", pname); system(command_name);}
67
//#endif
68 b9e6f879 CsabaKiraly
69 e11386c0 CsabaKiraly
#ifdef __LINUX__
70
#define DELETE_DIR(folder) {char command_name[255]; sprintf(command_name, "rm -fR %s", folder); system(command_name); }
71
#define CREATE_DIR(folder) {char command_name[255]; sprintf(command_name, "mkdir %s", folder); system(command_name); }
72
#else
73
#define DELETE_DIR(folder) {char command_name[255]; sprintf(command_name, "rd /S /Q %s", folder); system(command_name); }
74
#define CREATE_DIR(folder) {char command_name[255]; sprintf(command_name, "mkdir %s", folder); system(command_name); }
75
#endif
76 10c75ef7 GiuseppeTropea
77
SChannel Channels[MAX_CHANNELS_NUM];
78
int NChannels;
79
int SelectedChannel;
80 e11386c0 CsabaKiraly
char StreamerFilename[255];
81 10c75ef7 GiuseppeTropea
int FullscreenMode; // fullscreen vs windowized flag
82
int window_width, window_height;
83 e11386c0 CsabaKiraly
int Audio_ON;
84
85
#ifdef HTTPIO
86 10c75ef7 GiuseppeTropea
int HttpPort;
87 e11386c0 CsabaKiraly
#else
88
#ifdef TCPIO
89
int TcpPort;
90
#endif
91
#endif
92 78068e21 GiuseppeTropea
93 10c75ef7 GiuseppeTropea
void ZapDown();
94
void ZapUp();
95
int ParseConf();
96
int SwitchChannel(SChannel* channel);
97 e11386c0 CsabaKiraly
int ReTune(SChannel* channel);
98 9240dba2 GiuseppeTropea
99 10c75ef7 GiuseppeTropea
#endif // _CHUNKER_PLAYER_H