[7497] | 1 | #ifndef STRUCT_H |
---|
| 2 | #define STRUCT_H |
---|
| 3 | |
---|
[7934] | 4 | #define _GNU_SOURCE |
---|
| 5 | |
---|
| 6 | #ifdef SIMULATE |
---|
| 7 | #include <mcheck.h> |
---|
| 8 | #endif |
---|
| 9 | |
---|
| 10 | #include <stdio.h> |
---|
| 11 | #include <stdlib.h> |
---|
| 12 | #include <stdint.h> |
---|
| 13 | #include <string.h> |
---|
[8411] | 14 | #include <libgen.h> |
---|
[7934] | 15 | #include <fcntl.h> |
---|
| 16 | #include <ctype.h> |
---|
| 17 | #include <linux/fb.h> |
---|
| 18 | #include <sys/ioctl.h> |
---|
| 19 | #include <sys/mman.h> |
---|
[8463] | 20 | #include <bpamem.h> |
---|
[7934] | 21 | #include <png.h> |
---|
[8463] | 22 | #include <jpeglib.h> |
---|
| 23 | #include <libmmeimage.h> |
---|
[7934] | 24 | #include <libintl.h> |
---|
| 25 | #include <locale.h> |
---|
| 26 | #include <math.h> |
---|
| 27 | #include <linux/input.h> |
---|
| 28 | #include <sys/wait.h> |
---|
| 29 | #include <time.h> |
---|
| 30 | #include <dirent.h> |
---|
| 31 | #include <fnmatch.h> |
---|
| 32 | #include <dlfcn.h> |
---|
| 33 | #include <pthread.h> |
---|
| 34 | #include <linux/dvb/frontend.h> |
---|
| 35 | #include <linux/dvb/dmx.h> |
---|
| 36 | #include <linux/dvb/audio.h> |
---|
| 37 | #include <linux/dvb/video.h> |
---|
| 38 | #include <sys/vfs.h> |
---|
| 39 | #include <inttypes.h> |
---|
| 40 | #include <sys/socket.h> |
---|
| 41 | #include <sys/un.h> |
---|
| 42 | #include <unistd.h> |
---|
| 43 | #include <zlib.h> |
---|
[8259] | 44 | #include <net/if.h> |
---|
| 45 | #include <netinet/in.h> |
---|
| 46 | #include <arpa/inet.h> |
---|
[8401] | 47 | #include <netdb.h> |
---|
[8506] | 48 | #include <errno.h> |
---|
[8513] | 49 | #include <linux/dvb/version.h> |
---|
[8645] | 50 | #include <setjmp.h> |
---|
[8690] | 51 | #include <sys/mount.h> |
---|
[8749] | 52 | #include <execinfo.h> |
---|
[9918] | 53 | #include <ifaddrs.h> |
---|
[10366] | 54 | #include <linux/dvb/ca.h> |
---|
[10496] | 55 | #include <poll.h> |
---|
[7934] | 56 | |
---|
| 57 | #ifndef SIMULATE |
---|
| 58 | #include <linux/stmfb.h> |
---|
| 59 | #endif |
---|
| 60 | |
---|
| 61 | //for freetype |
---|
| 62 | #include <ft2build.h> |
---|
| 63 | #include FT_FREETYPE_H |
---|
| 64 | #include FT_CACHE_H |
---|
| 65 | |
---|
| 66 | //for eplayer |
---|
[10626] | 67 | #ifdef EPLAYER3 |
---|
[7934] | 68 | #include <common.h> |
---|
| 69 | #endif |
---|
| 70 | |
---|
[10626] | 71 | #ifdef EPLAYER4 |
---|
| 72 | #include <gst/gst.h> |
---|
| 73 | #include <gst/pbutils/missing-plugins.h> |
---|
| 74 | #endif |
---|
| 75 | |
---|
[10399] | 76 | #define VERSION "1.2" |
---|
[7497] | 77 | #define PROGNAME "titan" |
---|
| 78 | #define COPYRIGHT "NIT" |
---|
[9625] | 79 | #define CRONTRIBUT "obi, black, dvboxer, oxygen, gost" |
---|
[7497] | 80 | |
---|
| 81 | #define _(x) gettext(x) |
---|
[7571] | 82 | #define MINMALLOC 4096 |
---|
[7497] | 83 | #define SCROLLBARWIDTH 15 |
---|
| 84 | #define SCROLLBARBORDERSIZE 1 |
---|
| 85 | #define FONTPOSYOFFSET -3 |
---|
[7694] | 86 | #define FB "fb0" |
---|
| 87 | #define FB1 "fb1" |
---|
[7497] | 88 | #define SKINFB "skinfb" |
---|
| 89 | #define ACCELFB "accelfb" |
---|
| 90 | #define CONFIGFILE PROGNAME".cfg" |
---|
[7652] | 91 | #define KILLPROG "killall -9 "PROGNAME |
---|
| 92 | #define REBOOT "init 6" |
---|
[7791] | 93 | #define FILELISTDELMARK 255 |
---|
[8017] | 94 | #define PLUGINDELMARK 254 |
---|
[7612] | 95 | #define MAXDVBADAPTER 2 |
---|
[7497] | 96 | #define MAXFRONTENDDEV 4 |
---|
| 97 | #define MAXDEMUXDEV 4 |
---|
[7906] | 98 | #define MAXDEMUXDEVOPEN 10 |
---|
[10473] | 99 | #define MAXAUDIODEV 4 |
---|
| 100 | #define MAXVIDEODEV 4 |
---|
| 101 | #define MAXCIDEV 4 |
---|
| 102 | #define MAXCADEV 4 |
---|
[9713] | 103 | #define MAXDVRDEV 4 |
---|
[7612] | 104 | #define RCTIMEOUT 999999 |
---|
[7763] | 105 | #define RCTHREADSTANDBY 999998 |
---|
[7670] | 106 | #define MAXSERVICETYPE 10 |
---|
| 107 | #define TSSIZE 188 |
---|
[10287] | 108 | #define CHANNELCACHEMAX 1000 |
---|
[9220] | 109 | #define MAXHTTPDCONN 20 |
---|
[9295] | 110 | #define MAXHTMLLINE 300 |
---|
[9501] | 111 | #define LISTHASHSIZE 27 |
---|
[10473] | 112 | #define MAXCASESSION 16 |
---|
[7497] | 113 | |
---|
[10473] | 114 | //CA Defines |
---|
| 115 | #define T_SB 0x80 //sb (h<--m) |
---|
| 116 | #define T_RCV 0x81 //receive (h-->m) |
---|
| 117 | #define T_CREATE_T_C 0x82 //create transport connection (h-->m) |
---|
| 118 | #define T_C_T_C_REPLY 0x83 //ctc reply (h<--m) |
---|
| 119 | #define T_DELETE_T_C 0x84 //delete tc (h<->m) |
---|
| 120 | #define T_D_T_C_REPLY 0x85 //dtc reply (h<->m) |
---|
| 121 | #define T_REQUEST_T_C 0x86 //request transport connection (h<--m) |
---|
| 122 | #define T_NEW_T_C 0x87 //new tc - reply to t_request (h-->m) |
---|
| 123 | #define T_T_C_ERROR 0x77 //error creating tc (h-->m) |
---|
| 124 | #define T_DATA_LAST 0xA0 //convey data from higher (h<->m) |
---|
| 125 | #define T_DATA_MORE 0xA1 //convey data from higher (h<->m) |
---|
| 126 | |
---|
[7971] | 127 | // VFD icons supported (more or less) on all boxes: |
---|
| 128 | typedef enum { VFD_USB = 0x10, VFD_HD, VFD_HDD, VFD_LOCK, VFD_BT, VFD_MP3, VFD_MUSIC, VFD_DD, VFD_MAIL, VFD_MUTE, VFD_PLAY, VFD_PAUSE, VFD_FF, VFD_FR, VFD_REC, VFD_CLOCK } vfdicons; |
---|
| 129 | |
---|
[8964] | 130 | #define MIN(a,b) (a < b ? a : b) |
---|
| 131 | #define MAX(a,b) (a > b ? a : b) |
---|
| 132 | |
---|
[7728] | 133 | #define bcdtoint(i) ((((i & 0xf0) >> 4) * 10) + (i & 0x0f)) |
---|
| 134 | |
---|
[8520] | 135 | #define alpha_composite(composite, fg, alpha, bg) { \ |
---|
| 136 | unsigned short temp = ((unsigned short)(fg)*(unsigned short)(alpha) + \ |
---|
| 137 | (unsigned short)(bg)*(unsigned short)(255 - (unsigned short)(alpha)) + \ |
---|
| 138 | (unsigned short)128); \ |
---|
| 139 | (composite) = (unsigned char)((temp + (temp >> 8)) >> 8); } |
---|
| 140 | |
---|
[7816] | 141 | enum {LEFT=20000, CENTER, RIGHT}; |
---|
| 142 | enum {TOP=20000, MIDDLE, BOTTOM}; |
---|
[7497] | 143 | enum {BOTTOMLEFT, BOTTOMRIGHT, TOPLEFT, TOPRIGHT}; |
---|
[8985] | 144 | enum {LEFTRIGHT=1, TOPBOTTOM, LEFTMIDDLE, TOPMIDDLE}; |
---|
[7497] | 145 | enum {NO, YES, AUTONO, AUTOYES}; |
---|
[10664] | 146 | enum {UNDEF, LISTBOX, TEXTBOX, CHOICEBOX, INPUTBOX, INPUTBOXNUM, FILELIST, PROGRESSBAR, MENU, MULTIPROGRESSBAR, GRID, GRIDBR, TEXTBOXGRIDBR}; |
---|
[9713] | 147 | enum {FRONTENDDEV, DEMUXDEV, VIDEODEV, AUDIODEV, CADEV, CIDEV, FRONTENDDEVDUMMY, DVRDEV}; |
---|
[7571] | 148 | enum {TV, RADIO}; |
---|
[9713] | 149 | enum {RECDIRECT, RECTIMER, RECTIMESHIFT, RECSTREAM, RECPLAY}; |
---|
[7623] | 150 | enum {AC3 = 0, MPEGA = 1, DTS = 2, LPCM = 6, AAC = 8, AACHE = 9}; |
---|
| 151 | enum {MPEGV = 0, MPEG4V = 4, H264 = 1}; |
---|
[7659] | 152 | enum {ALLCHANNEL, SATCHANNEL, PROVIDERCHANNEL, AZCHANNEL, BOUQUETCHANNEL, SATLIST, PROVIDERLIST, AZLIST, MAINBOUQUETLIST}; |
---|
[8076] | 153 | enum {NOMODE, MVMODE, RMMODE, CPMODE, PROTECTMODE}; |
---|
[9713] | 154 | enum {NOTHING, CHANNEL, STILLPIC, RECORDDIRECT, RECORDTIMER, RECORDTIMESHIFT, RECORDSTREAM, TMPOTHER, RECORDPLAY}; |
---|
[7728] | 155 | enum {START, PAUSE, STOP}; |
---|
[8997] | 156 | enum {DEACTIVE, ACTIVE, INPAUSE, ERROR}; |
---|
[7734] | 157 | enum {FUNCTEXT, FUNCPIC, FUNCPROGRESS}; |
---|
[10473] | 158 | enum {CASESSIONCREATE, CASESSIONBUSY, CASESSIONDEL, CASESSIONSTART, CASESSIONFINAL, CARESFIRSTENQUIRY, CARESCHANGE, CARESENQUIRY, CADATETIMESEND, CAMMIIDLE, CAMMIDISPLAYREPLAY, CAMMIFAKEOK}; |
---|
[7497] | 159 | |
---|
[10502] | 160 | struct queue |
---|
| 161 | { |
---|
| 162 | //0-99 for ca module |
---|
| 163 | int type; |
---|
[10718] | 164 | int flag; |
---|
[10502] | 165 | int len; |
---|
| 166 | void* data; |
---|
| 167 | struct queue* prev; |
---|
| 168 | struct queue* next; |
---|
| 169 | }; |
---|
| 170 | |
---|
[10473] | 171 | struct casession |
---|
| 172 | { |
---|
| 173 | int inuse; |
---|
| 174 | int sessionnr; |
---|
| 175 | int action; |
---|
| 176 | int state; |
---|
| 177 | }; |
---|
| 178 | |
---|
[10366] | 179 | struct caslot |
---|
| 180 | { |
---|
[10473] | 181 | struct casession casession[MAXCASESSION]; |
---|
| 182 | int connid; |
---|
[10810] | 183 | int poll; |
---|
[10876] | 184 | int capmtsend; |
---|
[10366] | 185 | int status; |
---|
| 186 | int rlen; |
---|
[10473] | 187 | unsigned char* rbuf; |
---|
| 188 | char* name; |
---|
[10635] | 189 | int fastrun; |
---|
[10865] | 190 | int mmiopen; |
---|
[10366] | 191 | int mmimanager; |
---|
| 192 | int camanager; |
---|
[10473] | 193 | int datetimemanager; |
---|
[10366] | 194 | int appmanager; |
---|
[10473] | 195 | int resmanager; |
---|
[10865] | 196 | char* caids; |
---|
[10366] | 197 | }; |
---|
| 198 | |
---|
[10347] | 199 | struct hdd |
---|
| 200 | { |
---|
| 201 | char* device; |
---|
| 202 | int partition; |
---|
| 203 | unsigned long size; |
---|
| 204 | char* filesystem; |
---|
| 205 | char* label; |
---|
[10701] | 206 | char* uuid; |
---|
[10347] | 207 | char* vendor; |
---|
| 208 | char* model; |
---|
| 209 | int removable; |
---|
| 210 | struct hdd* prev; |
---|
| 211 | struct hdd* next; |
---|
| 212 | }; |
---|
| 213 | |
---|
[10129] | 214 | struct scaninfo |
---|
| 215 | { |
---|
| 216 | struct dvbdev* fenode; |
---|
| 217 | struct transponder* tpnode; |
---|
| 218 | struct skin* scanscreen; |
---|
| 219 | struct skin* listbox; |
---|
[10165] | 220 | int threadend; |
---|
[10129] | 221 | int scantype; |
---|
[10338] | 222 | int fetype; |
---|
[10129] | 223 | int orbitalpos; |
---|
| 224 | int timeout; |
---|
[10165] | 225 | int onlyfree; |
---|
[10326] | 226 | int clear; |
---|
[10338] | 227 | char* satname; |
---|
[10129] | 228 | int tpcount; |
---|
| 229 | int tvcount; |
---|
| 230 | int newtvcount; |
---|
| 231 | int radiocount; |
---|
| 232 | int newradiocount; |
---|
| 233 | int datacount; |
---|
| 234 | int newdatacount; |
---|
| 235 | } scaninfo; |
---|
| 236 | |
---|
[9448] | 237 | struct screensaver |
---|
| 238 | { |
---|
| 239 | int type; |
---|
| 240 | int speed; |
---|
| 241 | int newposx; |
---|
| 242 | int newposy; |
---|
| 243 | struct skin* screen; |
---|
[9449] | 244 | struct skin* screennode; |
---|
[9448] | 245 | struct skin* filelist; |
---|
| 246 | struct skin* aktnode; |
---|
| 247 | struct pic* pic; |
---|
| 248 | char* value; |
---|
| 249 | }; |
---|
| 250 | |
---|
[9389] | 251 | struct playlist |
---|
| 252 | { |
---|
| 253 | char* file; |
---|
| 254 | struct playlist* prev; |
---|
| 255 | struct playlist* next; |
---|
| 256 | }; |
---|
| 257 | |
---|
| 258 | struct mainplaylist |
---|
| 259 | { |
---|
| 260 | char* name; |
---|
| 261 | char* filename; |
---|
| 262 | struct playlist* playlist; |
---|
| 263 | struct mainplaylist* prev; |
---|
| 264 | struct mainplaylist* next; |
---|
| 265 | }; |
---|
| 266 | |
---|
[9347] | 267 | struct epgrecord |
---|
| 268 | { |
---|
| 269 | time_t begin; |
---|
| 270 | time_t end; |
---|
| 271 | int posx; |
---|
| 272 | int size; |
---|
| 273 | struct epgrecord* prev; |
---|
| 274 | struct epgrecord* next; |
---|
| 275 | }; |
---|
| 276 | |
---|
[9230] | 277 | struct download |
---|
| 278 | { |
---|
| 279 | char* host; |
---|
| 280 | char* page; |
---|
| 281 | int port; |
---|
| 282 | char* filename; |
---|
| 283 | int connfd; |
---|
| 284 | int proz; |
---|
| 285 | unsigned int maxkb; |
---|
| 286 | unsigned int aktkb; |
---|
| 287 | int ret; |
---|
| 288 | }; |
---|
| 289 | |
---|
[8976] | 290 | struct epgscanlist |
---|
| 291 | { |
---|
| 292 | int serviceid; |
---|
| 293 | unsigned long transponderid; |
---|
[8981] | 294 | time_t scantime; |
---|
[8976] | 295 | struct epgscanlist* prev; |
---|
| 296 | struct epgscanlist* next; |
---|
| 297 | }; |
---|
| 298 | |
---|
[8964] | 299 | struct rgba |
---|
| 300 | { |
---|
| 301 | char r; |
---|
| 302 | char g; |
---|
| 303 | char b; |
---|
| 304 | char a; |
---|
| 305 | }; |
---|
| 306 | |
---|
| 307 | struct subclutentry |
---|
| 308 | { |
---|
| 309 | unsigned char Y, Cr, Cb, T; |
---|
| 310 | unsigned char valid; |
---|
| 311 | }; |
---|
| 312 | |
---|
| 313 | struct subclut |
---|
| 314 | { |
---|
| 315 | unsigned char clutid; |
---|
| 316 | unsigned char clutversionnumber; |
---|
| 317 | struct subclutentry entries2bit[4]; |
---|
| 318 | struct subclutentry entries4bit[16]; |
---|
| 319 | struct subclutentry entries8bit[256]; |
---|
| 320 | struct subclut *next; |
---|
| 321 | }; |
---|
| 322 | |
---|
| 323 | struct subpagereg |
---|
| 324 | { |
---|
| 325 | int regid; |
---|
| 326 | int reghorizontaladdress; |
---|
| 327 | int regverticaladdress; |
---|
| 328 | int scaleposx, scaleposy; |
---|
| 329 | struct subpagereg *next; |
---|
| 330 | }; |
---|
| 331 | |
---|
| 332 | struct subregobj |
---|
| 333 | { |
---|
| 334 | int objid; |
---|
| 335 | int objtype; |
---|
| 336 | int objproviderflag; |
---|
| 337 | int objhorizontalpos; |
---|
| 338 | int objverticalpos; |
---|
| 339 | // not supported right now... |
---|
| 340 | int foregroundpixel; |
---|
| 341 | int backgroundpixel; |
---|
| 342 | struct subregobj *next; |
---|
| 343 | }; |
---|
| 344 | |
---|
| 345 | struct subreg |
---|
| 346 | { |
---|
| 347 | int regid; |
---|
| 348 | int versionnumber; |
---|
| 349 | int height, width; |
---|
| 350 | int scaleheight, scalewidth; |
---|
| 351 | int depth; |
---|
| 352 | unsigned char *buf; |
---|
| 353 | struct rgba *palette; |
---|
| 354 | int clutid; |
---|
| 355 | int committed; |
---|
| 356 | struct subregobj *objects; |
---|
| 357 | struct subreg *next; |
---|
| 358 | }; |
---|
| 359 | |
---|
| 360 | struct subpage |
---|
| 361 | { |
---|
| 362 | int pageid; |
---|
| 363 | time_t pagetimeout; |
---|
| 364 | int pageversionnumber; |
---|
| 365 | int state; |
---|
| 366 | int pcssize; |
---|
| 367 | struct subpagereg *pageregions; |
---|
| 368 | struct subreg *regions; |
---|
| 369 | struct subclut *cluts; |
---|
| 370 | struct subpage *next; |
---|
| 371 | }; |
---|
| 372 | |
---|
| 373 | struct bitstream |
---|
| 374 | { |
---|
| 375 | unsigned char *data; |
---|
| 376 | int size; |
---|
| 377 | int avail; |
---|
| 378 | int consumed; |
---|
| 379 | }; |
---|
| 380 | |
---|
[10165] | 381 | //there are a copyrectimer function |
---|
| 382 | //if you change the struct you must change this funktion |
---|
[8536] | 383 | struct rectimer |
---|
| 384 | { |
---|
| 385 | char* name; |
---|
| 386 | time_t begin; |
---|
| 387 | time_t end; |
---|
| 388 | int repeate; |
---|
| 389 | int afterevent; |
---|
[10645] | 390 | char* pincode; |
---|
[8536] | 391 | int disabled; |
---|
| 392 | int justplay; |
---|
[8609] | 393 | char* recpath; |
---|
| 394 | int servicetype; |
---|
| 395 | char* channellist; |
---|
| 396 | int serviceid; |
---|
[8663] | 397 | //0 = nothing |
---|
| 398 | //1 = running |
---|
| 399 | //2 = end |
---|
[9107] | 400 | //3 = error |
---|
[8663] | 401 | int status; |
---|
[9107] | 402 | char* errstr; |
---|
[8663] | 403 | struct service* servicenode; |
---|
[8609] | 404 | unsigned long transponderid; |
---|
[8536] | 405 | struct rectimer *prev; |
---|
| 406 | struct rectimer *next; |
---|
| 407 | }; |
---|
| 408 | |
---|
[8228] | 409 | struct inetwork |
---|
| 410 | { |
---|
[8259] | 411 | int id; |
---|
| 412 | char* device; |
---|
[8228] | 413 | char* ip; |
---|
| 414 | char* netmask; |
---|
| 415 | char* mac; |
---|
| 416 | char* broadcast; |
---|
| 417 | int dhcp; |
---|
[8259] | 418 | struct inetwork *prev; |
---|
| 419 | struct inetwork *next; |
---|
| 420 | }; |
---|
[8228] | 421 | |
---|
[8028] | 422 | struct rcmap |
---|
| 423 | { |
---|
| 424 | char* name; |
---|
| 425 | int key; |
---|
[8228] | 426 | int newkey; |
---|
[8028] | 427 | struct rcmap* next; |
---|
| 428 | }; |
---|
| 429 | |
---|
[7763] | 430 | struct splitstr |
---|
| 431 | { |
---|
| 432 | char* part; |
---|
| 433 | }; |
---|
| 434 | |
---|
| 435 | struct channelcache |
---|
| 436 | { |
---|
| 437 | int serviceid; |
---|
[8609] | 438 | unsigned long transponderid; |
---|
[7763] | 439 | struct channel* chnode; |
---|
[10287] | 440 | struct channelcache* next; |
---|
[7763] | 441 | }; |
---|
| 442 | |
---|
[7751] | 443 | struct filelist |
---|
| 444 | { |
---|
| 445 | int type; |
---|
| 446 | char* name; |
---|
| 447 | char* shortname; |
---|
| 448 | char* path; |
---|
| 449 | char* imdbpath; |
---|
| 450 | off64_t size; |
---|
| 451 | time_t date; |
---|
| 452 | }; |
---|
| 453 | |
---|
[7497] | 454 | struct skin |
---|
| 455 | { |
---|
| 456 | char* name; |
---|
[7791] | 457 | uint8_t type; |
---|
| 458 | uint8_t wrap; |
---|
| 459 | uint8_t bordersize; |
---|
| 460 | uint8_t scrollbar; |
---|
| 461 | uint16_t halign; |
---|
| 462 | uint16_t valign; |
---|
[7816] | 463 | int16_t posx; |
---|
| 464 | int16_t posy; |
---|
[7791] | 465 | int16_t width; |
---|
| 466 | int16_t height; |
---|
[7546] | 467 | long bordercol; |
---|
| 468 | long deaktivcol; |
---|
| 469 | long shadowcol; |
---|
[7791] | 470 | uint8_t shadowsize; |
---|
| 471 | uint8_t shadowpos; |
---|
| 472 | uint8_t fontsize; |
---|
[7955] | 473 | uint8_t fontsize2; |
---|
[7546] | 474 | long fontcol; |
---|
[7778] | 475 | long fontcol2; |
---|
[7497] | 476 | char* font; |
---|
[7816] | 477 | int16_t zorder; |
---|
| 478 | int16_t titlealign; |
---|
[7497] | 479 | char* title; |
---|
| 480 | char* text; |
---|
[7778] | 481 | char* text2; |
---|
[7546] | 482 | long bgcol; |
---|
[8985] | 483 | long bgcol2; |
---|
| 484 | long titlebgcol; |
---|
| 485 | long titlebgcol2; |
---|
[7546] | 486 | long progresscol; |
---|
[7497] | 487 | char* pic; |
---|
[7816] | 488 | int16_t picwidth; |
---|
| 489 | int16_t picheight; |
---|
[7982] | 490 | uint16_t hspace; |
---|
| 491 | uint16_t vspace; |
---|
[7497] | 492 | char* (*skinfunc)(void*, void*); |
---|
| 493 | char* param1; |
---|
| 494 | char* param2; |
---|
| 495 | char* parent; |
---|
| 496 | char* input; |
---|
| 497 | char* mask; |
---|
[7791] | 498 | uint16_t textposx; |
---|
[7956] | 499 | uint16_t textposx2; |
---|
[8985] | 500 | int16_t gradient; |
---|
| 501 | int16_t titlegradient; |
---|
[7957] | 502 | uint8_t transparent; |
---|
[7982] | 503 | uint8_t hidden; |
---|
| 504 | uint8_t funcrettype; |
---|
[9437] | 505 | int8_t charspace; |
---|
[9487] | 506 | int8_t bordertype; |
---|
[9465] | 507 | int16_t borderradius; |
---|
[10668] | 508 | uint16_t bgspace; |
---|
[7497] | 509 | |
---|
[7957] | 510 | uint8_t titlesize; |
---|
[7751] | 511 | struct filelist* filelist; |
---|
[7497] | 512 | struct skin* parentpointer; |
---|
| 513 | char* ret; |
---|
| 514 | char* choiceboxvalue; |
---|
| 515 | unsigned int linecount; |
---|
| 516 | unsigned int pagecount; |
---|
| 517 | unsigned int poscount; |
---|
[9823] | 518 | unsigned int gridcol; |
---|
[7497] | 519 | int aktpage; |
---|
| 520 | int aktline; |
---|
[7791] | 521 | uint8_t scrollbarbordersize; |
---|
| 522 | uint8_t prozposx; |
---|
| 523 | uint8_t prozposy; |
---|
| 524 | uint8_t prozwidth; |
---|
| 525 | uint8_t prozheight; |
---|
| 526 | uint8_t picprozwidth; |
---|
| 527 | uint8_t del; |
---|
| 528 | uint8_t picprozheight; |
---|
[7957] | 529 | int16_t scrollbarheight; |
---|
| 530 | int16_t progresssize; |
---|
| 531 | int16_t scrollbarwidth; |
---|
| 532 | int16_t scrollbarpos; |
---|
[7816] | 533 | int16_t rposx; |
---|
| 534 | int16_t rposy; |
---|
| 535 | int16_t rwidth; |
---|
| 536 | int16_t rheight; |
---|
| 537 | int16_t rpicwidth; |
---|
| 538 | int16_t rpicheight; |
---|
| 539 | int16_t iposx; |
---|
| 540 | int16_t iposy; |
---|
| 541 | int16_t iwidth; |
---|
| 542 | int16_t iheight; |
---|
[7497] | 543 | char* handle; |
---|
[7659] | 544 | char* handle1; |
---|
[9350] | 545 | struct epgrecord* epgrecord; |
---|
[7497] | 546 | char* pluginhandle; |
---|
| 547 | struct skin *select; |
---|
| 548 | struct skin *child; |
---|
[8282] | 549 | struct skin *prev; |
---|
[7497] | 550 | struct skin *next; |
---|
| 551 | }; |
---|
| 552 | |
---|
[7728] | 553 | struct epg |
---|
| 554 | { |
---|
| 555 | int eventid; |
---|
[7750] | 556 | int version; |
---|
[7728] | 557 | time_t starttime; |
---|
| 558 | time_t endtime; |
---|
| 559 | char* title; |
---|
| 560 | char* subtitle; |
---|
| 561 | char* desc; |
---|
[7734] | 562 | int desclen; |
---|
[7750] | 563 | int desccomplen; |
---|
[10314] | 564 | int parentalrating; |
---|
[9339] | 565 | struct epg* prev; |
---|
[7728] | 566 | struct epg* next; |
---|
| 567 | }; |
---|
| 568 | |
---|
[7746] | 569 | struct shutdowntimer |
---|
| 570 | { |
---|
| 571 | int active,type; //type: 0=DeepStandby, 1=Standby |
---|
| 572 | long long shutdown_time; |
---|
| 573 | }; |
---|
| 574 | |
---|
[7497] | 575 | struct dvbdev |
---|
| 576 | { |
---|
| 577 | char* dev; |
---|
| 578 | int fd; |
---|
[7791] | 579 | uint8_t type; |
---|
| 580 | uint8_t adapter; |
---|
| 581 | uint8_t devnr; |
---|
| 582 | uint8_t felock; |
---|
[8952] | 583 | struct transponder* felasttransponder; |
---|
| 584 | struct transponder* feakttransponder; |
---|
[7606] | 585 | int feloffrequency; |
---|
[7506] | 586 | int feaktband; |
---|
[9111] | 587 | int feaktpolarization; |
---|
[7728] | 588 | int fedmxsource; |
---|
[7506] | 589 | char* feaktlnb; |
---|
| 590 | char* feaktdiseqc; |
---|
[7497] | 591 | char* feshortname; |
---|
| 592 | struct dvb_frontend_info* feinfo; |
---|
[10366] | 593 | struct caslot* caslot; |
---|
[7497] | 594 | struct dvbdev *next; |
---|
| 595 | }; |
---|
| 596 | |
---|
[10165] | 597 | //there are a copytransponder and createtransponder function |
---|
| 598 | //if you change this struct you must change the function |
---|
[7497] | 599 | struct transponder |
---|
| 600 | { |
---|
[7728] | 601 | unsigned long id; |
---|
[7791] | 602 | uint8_t fetype; |
---|
| 603 | uint8_t polarization; |
---|
| 604 | uint8_t modulation; |
---|
| 605 | uint8_t fec; |
---|
| 606 | uint8_t pilot; |
---|
| 607 | uint8_t rolloff; |
---|
| 608 | uint8_t inversion; |
---|
| 609 | uint8_t system; |
---|
| 610 | uint8_t flag; |
---|
[8262] | 611 | // 0 = unknown |
---|
| 612 | // 1 = tunable |
---|
| 613 | // 2 = not tunable |
---|
| 614 | uint8_t tunablestatus; |
---|
[7791] | 615 | int orbitalpos; |
---|
[7728] | 616 | unsigned int frequency; |
---|
[7497] | 617 | int symbolrate; |
---|
| 618 | struct transponder *next; |
---|
| 619 | }; |
---|
| 620 | |
---|
[7612] | 621 | struct provider |
---|
| 622 | { |
---|
| 623 | int providerid; |
---|
| 624 | char* name; |
---|
| 625 | int flag; |
---|
[7652] | 626 | struct provider *prev; |
---|
[7612] | 627 | struct provider *next; |
---|
| 628 | }; |
---|
| 629 | |
---|
[7667] | 630 | struct subtitle |
---|
[7623] | 631 | { |
---|
[7667] | 632 | char* name; |
---|
[7791] | 633 | int16_t pid; |
---|
| 634 | int16_t type; |
---|
| 635 | int16_t id1; |
---|
| 636 | int16_t id2; |
---|
[7667] | 637 | struct subtitle* next; |
---|
[7623] | 638 | }; |
---|
| 639 | |
---|
[8878] | 640 | struct esinfo |
---|
| 641 | { |
---|
| 642 | int streamtype; |
---|
| 643 | int reserved1; |
---|
| 644 | int pid; |
---|
| 645 | int reserved2; |
---|
| 646 | struct esinfo* next; |
---|
| 647 | }; |
---|
| 648 | |
---|
| 649 | struct cadesc |
---|
| 650 | { |
---|
| 651 | int len; |
---|
| 652 | int systemid; |
---|
| 653 | int reserved; |
---|
| 654 | int pid; |
---|
| 655 | char* privat; |
---|
| 656 | struct cadesc* next; |
---|
| 657 | }; |
---|
| 658 | |
---|
| 659 | struct pmt |
---|
| 660 | { |
---|
| 661 | int programnumber; |
---|
| 662 | int reserved1; |
---|
| 663 | int versionnumber; |
---|
| 664 | int currentnextindicator; |
---|
| 665 | int reserved2; |
---|
| 666 | }; |
---|
| 667 | |
---|
[7667] | 668 | struct audiotrack |
---|
| 669 | { |
---|
| 670 | char* name; |
---|
[7791] | 671 | uint8_t audiocodec; |
---|
| 672 | int16_t audiopid; |
---|
[7667] | 673 | struct audiotrack* next; |
---|
| 674 | }; |
---|
| 675 | |
---|
[10165] | 676 | //there are a createchannel function |
---|
| 677 | //if you change this struct you must change the function |
---|
[7524] | 678 | struct channel |
---|
| 679 | { |
---|
| 680 | char* name; |
---|
[7728] | 681 | unsigned long transponderid; |
---|
[7612] | 682 | int providerid; |
---|
| 683 | int serviceid; |
---|
| 684 | int servicetype; |
---|
[7791] | 685 | uint8_t flag; |
---|
| 686 | uint8_t crypt; |
---|
| 687 | int8_t videocodec; |
---|
| 688 | int8_t audiocodec; |
---|
| 689 | int16_t videopid; |
---|
| 690 | int16_t audiopid; |
---|
| 691 | int16_t ac3audiopid; |
---|
| 692 | int16_t txtpid; |
---|
| 693 | int16_t pcrpid; |
---|
[9033] | 694 | int16_t pmtpid; |
---|
[8076] | 695 | uint8_t protect; |
---|
[7612] | 696 | struct transponder *transponder; |
---|
| 697 | struct provider *provider; |
---|
[7667] | 698 | struct audiotrack *audiotrack; |
---|
| 699 | struct subtitle *subtitle; |
---|
[8878] | 700 | struct pmt *pmt; |
---|
| 701 | struct cadesc *cadesc; |
---|
| 702 | struct esinfo *esinfo; |
---|
[7728] | 703 | struct epg *epg; |
---|
[7652] | 704 | struct channel *prev; |
---|
[7524] | 705 | struct channel *next; |
---|
| 706 | }; |
---|
| 707 | |
---|
[7906] | 708 | struct sat |
---|
[7497] | 709 | { |
---|
| 710 | char* name; |
---|
| 711 | int orbitalpos; |
---|
| 712 | int flag; |
---|
[8954] | 713 | int fetype; |
---|
[10338] | 714 | int scan; |
---|
[7652] | 715 | struct sat *prev; |
---|
[7497] | 716 | struct sat *next; |
---|
| 717 | }; |
---|
| 718 | |
---|
[7557] | 719 | struct service |
---|
| 720 | { |
---|
[7667] | 721 | int type; |
---|
[10849] | 722 | char* channellist; |
---|
[7557] | 723 | struct dvbdev *fedev; |
---|
| 724 | struct dvbdev *dmxaudiodev; |
---|
| 725 | struct dvbdev *dmxvideodev; |
---|
[7728] | 726 | struct dvbdev *dmxpcrdev; |
---|
| 727 | struct dvbdev *dmxsubtitledev; |
---|
[7557] | 728 | struct dvbdev *audiodev; |
---|
| 729 | struct dvbdev *videodev; |
---|
[7571] | 730 | struct transponder *transponder; |
---|
[7583] | 731 | struct channel *channel; |
---|
[9498] | 732 | unsigned char *pmtbuf; |
---|
| 733 | int pmtlen; |
---|
[9134] | 734 | int recdmxstart; |
---|
[9107] | 735 | int recdstfd; |
---|
| 736 | int recsrcfd; |
---|
[9012] | 737 | int camsockfd; |
---|
[8316] | 738 | time_t recendtime; |
---|
[8570] | 739 | size_t reclastsync; |
---|
| 740 | off64_t rectotal; |
---|
| 741 | int reccount; |
---|
[8227] | 742 | char* recname; |
---|
[7557] | 743 | struct service *next; |
---|
| 744 | }; |
---|
| 745 | |
---|
[8285] | 746 | struct stimerthread |
---|
| 747 | { |
---|
| 748 | int delay; |
---|
[8648] | 749 | int count; |
---|
[8976] | 750 | int notfirst; |
---|
[8285] | 751 | pthread_attr_t attr; |
---|
| 752 | pthread_t thread; |
---|
| 753 | int status; |
---|
| 754 | int aktion; |
---|
[8648] | 755 | void* param1; |
---|
| 756 | void* param2; |
---|
[8944] | 757 | void* (*func)(struct stimerthread*, void*, void*); |
---|
[8285] | 758 | struct stimerthread* next; |
---|
| 759 | }; |
---|
| 760 | |
---|
[9683] | 761 | struct hddparm |
---|
| 762 | { |
---|
| 763 | char* device; |
---|
| 764 | int read; |
---|
| 765 | int write; |
---|
| 766 | int sleeptime; |
---|
| 767 | int notchanged; |
---|
| 768 | }; |
---|
| 769 | |
---|
[7497] | 770 | struct status |
---|
| 771 | { |
---|
[10840] | 772 | //set to 1 if channellist or channelnr open |
---|
| 773 | int channelswitch; |
---|
[10578] | 774 | //deaktivates child protect if greater then akttime |
---|
| 775 | time_t protecttime; |
---|
[10315] | 776 | char* boxtype; |
---|
[9630] | 777 | pthread_t mainthread; |
---|
[9490] | 778 | //videosize from stream |
---|
| 779 | video_size_t videosize; |
---|
[9632] | 780 | time_t videosizevalid; |
---|
[9464] | 781 | //radius for rounded border |
---|
| 782 | int borderradius; |
---|
[9554] | 783 | int picbordersize; |
---|
| 784 | int titlelinesize; |
---|
[8983] | 785 | //0 border |
---|
| 786 | //1 fullbar |
---|
| 787 | int listboxselecttype; |
---|
[8892] | 788 | //0 camd.socket |
---|
| 789 | //1 pmt.tmp |
---|
| 790 | int pmtmode; |
---|
[8748] | 791 | //timer for del old epg entrys |
---|
| 792 | time_t deloldepg; |
---|
[8976] | 793 | //0 dektiv |
---|
| 794 | //1 only scan |
---|
| 795 | //2 only whitlist |
---|
| 796 | //3 scan and whitelist |
---|
| 797 | int epglistmode; |
---|
[8667] | 798 | // 1 manual |
---|
| 799 | // 2 from standby |
---|
| 800 | int startmode; |
---|
[8645] | 801 | jmp_buf longjumpbuf; |
---|
[8626] | 802 | pthread_mutex_t drawingmutex; |
---|
[8750] | 803 | pthread_mutex_t rectimermutex; |
---|
| 804 | pthread_mutex_t servicemutex; |
---|
| 805 | pthread_mutex_t epgmutex; |
---|
[8954] | 806 | pthread_mutex_t channelmutex; |
---|
[8964] | 807 | pthread_mutex_t timerthreadmutex; |
---|
[9012] | 808 | pthread_mutex_t audiotrackmutex; |
---|
| 809 | pthread_mutex_t subtitlemutex; |
---|
[9659] | 810 | pthread_mutex_t dmxdevmutex; |
---|
[10180] | 811 | pthread_mutex_t rcmutex; |
---|
[10502] | 812 | pthread_mutex_t queuemutex; |
---|
| 813 | pthread_mutex_t clistmutex; |
---|
[10519] | 814 | pthread_mutex_t hddmutex; |
---|
[10473] | 815 | // mutex for VFD handling |
---|
[8750] | 816 | pthread_mutex_t vfdmutex; |
---|
[8570] | 817 | off64_t recsplitsize; |
---|
[8546] | 818 | char* gateway; |
---|
| 819 | char* dnsserver1; |
---|
| 820 | char* dnsserver2; |
---|
[8520] | 821 | int fasttextrender; |
---|
[8466] | 822 | // 1 release all menus |
---|
| 823 | int menurelease; |
---|
[8375] | 824 | int play; |
---|
| 825 | int pause; |
---|
[9389] | 826 | int playspeed; |
---|
[9384] | 827 | int random; |
---|
[9478] | 828 | int repeat; |
---|
[8318] | 829 | int epgdays; |
---|
| 830 | int spinnertime; |
---|
| 831 | int spinnerspeed; |
---|
| 832 | int hangtime; |
---|
[8285] | 833 | int timeupdatecount; |
---|
[8261] | 834 | int maxsat; |
---|
[7659] | 835 | int markmodus; |
---|
[7765] | 836 | // 1 from main prog |
---|
| 837 | // 2 from a thread |
---|
[7652] | 838 | int standby; |
---|
[7639] | 839 | char* tmp; |
---|
[8646] | 840 | // rc filedescriptor |
---|
[7532] | 841 | int fdrc; |
---|
[9300] | 842 | // rc filedescriptor for simulating keypress (fifo) |
---|
| 843 | int fdrcsim; |
---|
[7497] | 844 | int writeconfig; |
---|
| 845 | int writeownconfig; |
---|
| 846 | int writercconfig; |
---|
[9046] | 847 | int writeskinconfig; |
---|
[7497] | 848 | int writechannel; |
---|
| 849 | int writetransponder; |
---|
[7612] | 850 | int writeprovider; |
---|
[7571] | 851 | int writemainbouquet; |
---|
| 852 | int writebouquet; |
---|
[9389] | 853 | int writemainplaylist; |
---|
| 854 | int writeplaylist; |
---|
[7659] | 855 | int writesat; |
---|
[8536] | 856 | int writerectimer; |
---|
[8976] | 857 | int writeepgscanlist; |
---|
[7765] | 858 | // 1 mute is aktiv |
---|
[7497] | 859 | int mute; |
---|
[7765] | 860 | // 1 spinner is aktiv |
---|
[7497] | 861 | int spinner; |
---|
[7765] | 862 | // 1 infobar is aktiv |
---|
[9313] | 863 | // 2 infobar is aktiv (with wait befor show) |
---|
| 864 | // 3 infobar is aktiv (no autohide) |
---|
[7497] | 865 | int infobar; |
---|
[9339] | 866 | // with infobar to display |
---|
| 867 | int infobarnr; |
---|
[7497] | 868 | // 0 is for mute screen |
---|
[8748] | 869 | struct skin *drawallways[1]; |
---|
| 870 | char* drawallwaysbg[1]; |
---|
[7497] | 871 | int usedirectfb; |
---|
[7765] | 872 | // count how long last rcwait (shows spinner if to long) |
---|
[7497] | 873 | time_t sec; |
---|
[7765] | 874 | // if set to a value != 0, rcwait returns this number |
---|
[7639] | 875 | int rckey; |
---|
[7497] | 876 | struct skin* skinerr; |
---|
| 877 | // 0 calc and draw |
---|
| 878 | // 1 calc only without hidden nodes |
---|
| 879 | // 2 calc only with hidden nodes |
---|
| 880 | int screencalc; |
---|
[7765] | 881 | // 0 deaktiv |
---|
| 882 | // 1 struct filelist filled |
---|
| 883 | // 2 struct filelist and show filesize |
---|
| 884 | // 3 struct filelist and show filedate |
---|
[7751] | 885 | int filelistextend; |
---|
[8285] | 886 | pthread_attr_t timerthreadattr; |
---|
| 887 | pthread_t timerthread; |
---|
| 888 | int timerthreadstatus; |
---|
| 889 | int timerthreadaktion; |
---|
[7670] | 890 | pthread_attr_t subthreadattr; |
---|
| 891 | pthread_t subthread; |
---|
[7694] | 892 | int subthreadstatus; |
---|
[7728] | 893 | int subthreadaktion; |
---|
[7694] | 894 | int subthreadpid; |
---|
[8976] | 895 | // epg thread pointer |
---|
| 896 | struct stimerthread* epgthread; |
---|
[9754] | 897 | // epgscanlist thread pointer |
---|
| 898 | struct stimerthread* epgscanlistthread; |
---|
[9174] | 899 | // httpd thread pointer |
---|
| 900 | struct stimerthread* httpthread; |
---|
[7557] | 901 | struct service* aktservice; |
---|
[7606] | 902 | struct service* lastservice; |
---|
[7734] | 903 | struct channel* markedchannel; |
---|
[7583] | 904 | char* configfile; |
---|
[7765] | 905 | // for bouquet channel numbering |
---|
[7670] | 906 | int bouquetnr[MAXSERVICETYPE]; |
---|
| 907 | int servicetype; |
---|
[7746] | 908 | struct shutdowntimer *sd_timer; |
---|
[7765] | 909 | // akt pos in channel cache |
---|
[7763] | 910 | int channelcachepos; |
---|
[7791] | 911 | // aktivate/deaktivate auto updatevfd |
---|
| 912 | int updatevfd; |
---|
[8226] | 913 | // count for recording |
---|
| 914 | int recording; |
---|
[8964] | 915 | // count for streaming |
---|
| 916 | int streaming; |
---|
[9630] | 917 | // timeshift running = 1 |
---|
| 918 | int timeshift; |
---|
[9713] | 919 | // ts playing running = 1 |
---|
| 920 | int playing; |
---|
[8247] | 921 | // if set to a skin (screenpointer) only this screen has rc |
---|
| 922 | struct skin* rcowner; |
---|
[9557] | 923 | // timerstuktur fuer autores |
---|
| 924 | struct stimerthread* restimer; |
---|
[9687] | 925 | //spindown USB/HDD |
---|
[9732] | 926 | struct hddparm hdd[3]; |
---|
[9687] | 927 | struct stimerthread* hddsleeptimer; |
---|
[9557] | 928 | |
---|
[7497] | 929 | } status; |
---|
| 930 | |
---|
| 931 | struct fb |
---|
| 932 | { |
---|
[7694] | 933 | int dev; |
---|
[7497] | 934 | char *name; |
---|
| 935 | int fd; |
---|
| 936 | unsigned char *fb; |
---|
[9527] | 937 | unsigned long *fblong; |
---|
[7497] | 938 | int width; |
---|
| 939 | int height; |
---|
[8590] | 940 | int pitch; |
---|
[7497] | 941 | unsigned long fixfbsize; |
---|
| 942 | unsigned long varfbsize; |
---|
| 943 | int colbytes; |
---|
| 944 | struct fb *next; |
---|
| 945 | }; |
---|
| 946 | |
---|
[7906] | 947 | struct rc |
---|
[7497] | 948 | { |
---|
| 949 | int key; |
---|
| 950 | void (*rcfunc)(struct skin*, struct skin*); |
---|
| 951 | struct skin *screen; |
---|
| 952 | struct skin *screennode; |
---|
| 953 | struct skin *owner; |
---|
| 954 | struct rc *next; |
---|
| 955 | }; |
---|
| 956 | |
---|
[9044] | 957 | struct clist |
---|
[7497] | 958 | { |
---|
| 959 | char *key; |
---|
| 960 | char *value; |
---|
| 961 | char *def; |
---|
| 962 | char *tmp; |
---|
[9044] | 963 | struct clist *next; |
---|
[7497] | 964 | }; |
---|
| 965 | |
---|
[7571] | 966 | struct bouquet |
---|
| 967 | { |
---|
[7639] | 968 | int nr; |
---|
[7571] | 969 | int serviceid; |
---|
[8609] | 970 | unsigned long transponderid; |
---|
[7571] | 971 | struct channel *channel; |
---|
[7652] | 972 | struct bouquet *prev; |
---|
[7571] | 973 | struct bouquet *next; |
---|
| 974 | }; |
---|
| 975 | |
---|
| 976 | struct mainbouquet |
---|
| 977 | { |
---|
| 978 | char *name; |
---|
| 979 | int type; |
---|
| 980 | char *filename; |
---|
| 981 | struct bouquet *bouquet; |
---|
[7652] | 982 | struct mainbouquet *prev; |
---|
[7571] | 983 | struct mainbouquet *next; |
---|
| 984 | }; |
---|
| 985 | |
---|
[7664] | 986 | struct pic |
---|
| 987 | { |
---|
| 988 | char* name; |
---|
| 989 | unsigned char* picbuf; |
---|
[9905] | 990 | // < 0 when picbuf is normal mem (hw jpg) |
---|
| 991 | int memfd; |
---|
[7664] | 992 | unsigned long width; |
---|
| 993 | unsigned long height; |
---|
| 994 | unsigned long rowbytes; |
---|
| 995 | int channels; |
---|
| 996 | int del; |
---|
| 997 | struct pic* next; |
---|
| 998 | }; |
---|
| 999 | |
---|
[7497] | 1000 | struct font |
---|
| 1001 | { |
---|
| 1002 | char *name; |
---|
| 1003 | FT_Error error; |
---|
| 1004 | FTC_Manager manager; |
---|
| 1005 | FTC_SBitCache cache; |
---|
| 1006 | FTC_ImageTypeRec desc; |
---|
| 1007 | FT_Face face; |
---|
| 1008 | FT_UInt prev_glyphindex; |
---|
| 1009 | FT_Bool use_kerning; |
---|
| 1010 | struct font *next; |
---|
| 1011 | }; |
---|
| 1012 | |
---|
[7728] | 1013 | #define HILO(x) (x##_hi << 8 | x##_lo) |
---|
[7734] | 1014 | |
---|
| 1015 | /* |
---|
[7728] | 1016 | #define HILO2(x) (x##1 << 8 | x##2) |
---|
| 1017 | #define HILO3(x) (x##1 << 16 | x##2 << 8 | x##3) |
---|
| 1018 | #define HILO4(x) (x##4 << 24 | x##2 << 16 | x##3 << 8 | x##4) |
---|
| 1019 | |
---|
| 1020 | #define MjdToEpochTime(x) ((HILO(x)-40587)*86400) |
---|
| 1021 | #define BcdTimeToSeconds(x) ((3600 * ((10*((x##_h & 0xF0)>>4)) + (x##_h & 0xF))) + \ |
---|
| 1022 | (60 * ((10*((x##_m & 0xF0)>>4)) + (x##_m & 0xF))) + \ |
---|
| 1023 | ((10*((x##_s & 0xF0)>>4)) + (x##_s & 0xF))) |
---|
| 1024 | #define BcdTimeToMinutes(x) ((60 * ((10*((x##_h & 0xF0)>>4)) + (x##_h & 0xF))) + \ |
---|
| 1025 | (((10*((x##_m & 0xF0)>>4)) + (x##_m & 0xF)))) |
---|
| 1026 | #define BcdCharToInt(x) (10*((x & 0xF0)>>4) + (x & 0xF)) |
---|
| 1027 | #define CheckBcdChar(x) ((((x & 0xF0)>>4) <= 9) && \ |
---|
| 1028 | ((x & 0x0F) <= 9)) |
---|
| 1029 | #define CheckBcdSignedChar(x) ((((x & 0xF0)>>4) >= 0) && (((x & 0xF0)>>4) <= 9) && \ |
---|
| 1030 | ((x & 0x0F) >= 0) && ((x & 0x0F) <= 9)) |
---|
| 1031 | |
---|
| 1032 | #define GetSectionLength(x) HILO(((si_tab_t *)(x))->section_length) |
---|
| 1033 | #define GetServiceId(x) HILO(((eit_t *)(x))->service_id) |
---|
| 1034 | #define GetLastTableId(x) ((eit_t *)(x))->segment_last_table_id |
---|
| 1035 | #define GetSegmentLastSectionNumber(x) ((eit_t *)(x))->segment_last_section_number |
---|
[7734] | 1036 | #define GetPrivateDataSpecifier(x) HILO4(((descr_private_data_specifier_t *)x)->private_data_specifier) |
---|
[7728] | 1037 | */ |
---|
| 1038 | |
---|
| 1039 | struct eit |
---|
| 1040 | { |
---|
| 1041 | u_char table_id /*:8*/; |
---|
| 1042 | u_char section_length_hi :4; |
---|
| 1043 | u_char :3; |
---|
| 1044 | u_char section_syntax_indicator :1; |
---|
| 1045 | u_char section_length_lo /*:8*/; |
---|
| 1046 | u_char service_id_hi /*:8*/; |
---|
| 1047 | u_char service_id_lo /*:8*/; |
---|
| 1048 | u_char current_next_indicator :1; |
---|
| 1049 | u_char version_number :5; |
---|
| 1050 | u_char :2; |
---|
| 1051 | u_char section_number /*:8*/; |
---|
| 1052 | u_char last_section_number /*:8*/; |
---|
| 1053 | u_char transport_stream_id_hi /*:8*/; |
---|
| 1054 | u_char transport_stream_id_lo /*:8*/; |
---|
| 1055 | u_char original_network_id_hi /*:8*/; |
---|
| 1056 | u_char original_network_id_lo /*:8*/; |
---|
| 1057 | u_char segment_last_section_number /*:8*/; |
---|
| 1058 | u_char segment_last_table_id /*:8*/; |
---|
| 1059 | u_char data[]; /* struct eitevent */ |
---|
| 1060 | }; |
---|
| 1061 | #define EITLEN sizeof(struct eit) |
---|
[7734] | 1062 | #define GETEITSECLEN(x) HILO(((struct eit*)(x))->section_length) |
---|
[7728] | 1063 | |
---|
| 1064 | struct eitevent |
---|
| 1065 | { |
---|
| 1066 | u_char event_id_hi /*:8*/; |
---|
| 1067 | u_char event_id_lo /*:8*/; |
---|
| 1068 | u_char mjd_hi /*:8*/; |
---|
| 1069 | u_char mjd_lo /*:8*/; |
---|
| 1070 | u_char start_time_h /*:8*/; |
---|
| 1071 | u_char start_time_m /*:8*/; |
---|
| 1072 | u_char start_time_s /*:8*/; |
---|
| 1073 | u_char duration_h /*:8*/; |
---|
| 1074 | u_char duration_m /*:8*/; |
---|
| 1075 | u_char duration_s /*:8*/; |
---|
| 1076 | u_char descriptors_loop_length_hi :4; |
---|
| 1077 | u_char free_ca_mode :1; |
---|
| 1078 | u_char running_status :3; |
---|
| 1079 | u_char descriptors_loop_length_lo /*:8*/; |
---|
| 1080 | u_char data[]; |
---|
| 1081 | }; |
---|
| 1082 | #define EITEVENTLEN sizeof(struct eitevent) |
---|
[7734] | 1083 | #define GETEITDESCLEN(x) HILO(((struct eitevent *)x)->descriptors_loop_length) |
---|
[7728] | 1084 | |
---|
| 1085 | struct eitshortevent |
---|
| 1086 | { |
---|
| 1087 | u_char descriptor_tag /*:8*/; |
---|
| 1088 | u_char descriptor_length /*:8*/; |
---|
| 1089 | u_char lang_code1 /*:8*/; |
---|
| 1090 | u_char lang_code2 /*:8*/; |
---|
| 1091 | u_char lang_code3 /*:8*/; |
---|
| 1092 | u_char event_name_length /*:8*/; |
---|
| 1093 | u_char data[]; |
---|
| 1094 | }; |
---|
| 1095 | #define EITSHORTEVENTLEN sizeof(struct eitshortevent) |
---|
| 1096 | |
---|
| 1097 | struct eitlongevent |
---|
| 1098 | { |
---|
| 1099 | u_char descriptor_tag /*:8*/; |
---|
| 1100 | u_char descriptor_length /*:8*/; |
---|
| 1101 | u_char last_descriptor_number :4; |
---|
| 1102 | u_char descriptor_number :4; |
---|
| 1103 | u_char lang_code1 /*:8*/; |
---|
| 1104 | u_char lang_code2 /*:8*/; |
---|
| 1105 | u_char lang_code3 /*:8*/; |
---|
| 1106 | u_char length_of_items /*:8*/; |
---|
| 1107 | u_char data[]; /* struct eitlongeventitem */ |
---|
| 1108 | }; |
---|
| 1109 | #define EITLONGEVENTLEN sizeof(struct eitlongevent) |
---|
| 1110 | |
---|
| 1111 | struct eitlongeventitem |
---|
| 1112 | { |
---|
| 1113 | u_char item_description_length /*:8*/; |
---|
| 1114 | u_char data[]; |
---|
| 1115 | }; |
---|
| 1116 | #define EITLONGEVENTITEMLEN sizeof(struct eitlongeventitem) |
---|
| 1117 | |
---|
[9572] | 1118 | struct eitlinkage |
---|
| 1119 | { |
---|
| 1120 | u_char descriptor_tag /*:8*/; |
---|
| 1121 | u_char descriptor_length /*:8*/; |
---|
| 1122 | u_char transport_stream_id_hi /*:8*/; |
---|
| 1123 | u_char transport_stream_id_lo /*:8*/; |
---|
| 1124 | u_char original_network_id_hi /*:8*/; |
---|
| 1125 | u_char original_network_id_lo /*:8*/; |
---|
| 1126 | u_char service_id_hi /*:8*/; |
---|
| 1127 | u_char service_id_lo /*:8*/; |
---|
| 1128 | u_char linkage_type /*:8*/; |
---|
| 1129 | }; |
---|
| 1130 | #define EITLLINKAGELEN sizeof(struct eitlinkage) |
---|
| 1131 | |
---|
[10314] | 1132 | struct parentalrating |
---|
| 1133 | { |
---|
| 1134 | u_char descriptor_tag /*:8*/; |
---|
| 1135 | u_char descriptor_length /*:8*/; |
---|
| 1136 | u_char data[]; //struct parental_rating_item |
---|
| 1137 | }; |
---|
| 1138 | #define PARENTALRATINGLEN sizeof(struct parentalrating) |
---|
| 1139 | |
---|
| 1140 | struct parentalratingitem |
---|
| 1141 | { |
---|
| 1142 | u_char lang_code1 /*:8*/; |
---|
| 1143 | u_char lang_code2 /*:8*/; |
---|
| 1144 | u_char lang_code3 /*:8*/; |
---|
| 1145 | u_char rating /*:8*/; |
---|
| 1146 | }; |
---|
| 1147 | #define PARENTALRATINGITEMLEN sizeof(struct parentalratingitem) |
---|
| 1148 | |
---|
[7497] | 1149 | #endif |
---|