source: titan/titan/struct.h @ 40315

Last change on this file since 40315 was 40315, checked in by obi, 6 years ago

switch v1.86

File size: 44.0 KB
Line 
1/*****************************************************/
2/* this file is part of the tiTan / tiTanNIT Project */
3/* and allowed only for use with this.               */
4/*                                                   */
5/* copyright by NIT                                  */
6/*****************************************************/
7
8#ifndef STRUCT_H
9#define STRUCT_H
10
11#define _GNU_SOURCE
12
13#ifdef SIMULATE
14#include <mcheck.h>
15#endif
16
17#include <stdio.h>
18#include <stdlib.h>
19#include <stdint.h>
20#include <string.h>
21#include <libgen.h>
22#include <fcntl.h>
23#include <ctype.h>
24#include <linux/fb.h>
25#include <sys/ioctl.h>
26#include <sys/mman.h>
27#include <png.h>
28#include <jpeglib.h>
29#include <libintl.h>
30#include <locale.h>
31#include <math.h>
32#include <linux/input.h>
33#include <sys/wait.h>
34#include <time.h>
35#include <dirent.h>
36#include <fnmatch.h>
37#include <dlfcn.h>
38#include <pthread.h>
39#include <linux/dvb/frontend.h>
40#include <linux/dvb/dmx.h>
41#include <linux/dvb/audio.h>
42#include <linux/dvb/video.h>
43#include <sys/vfs.h>
44#include <inttypes.h>
45#include <sys/socket.h>
46#include <sys/un.h>
47#include <unistd.h>
48#include <zlib.h>
49#include <net/if.h>
50#include <netinet/in.h>
51#include <arpa/inet.h>
52#include <netdb.h>
53#include <errno.h>
54#include <linux/dvb/version.h>
55#include <setjmp.h>
56#include <sys/mount.h>
57#include <execinfo.h>
58#include <ifaddrs.h>
59#include <linux/dvb/ca.h>
60#include <poll.h>
61#include <sys/utsname.h>
62#include <regex.h>
63#include <mntent.h>
64#include <termios.h>
65//#ifndef SH4
66#include <sys/stat.h>
67//#endif
68#include <openssl/aes.h>
69#include <openssl/dh.h>
70#include <openssl/rsa.h>
71#include <openssl/sha.h>
72#include <stdio.h>
73#include <unistd.h>
74#include <fcntl.h>
75#include <sys/ioctl.h>
76#include <stdint.h>
77#include <inttypes.h>
78#include <arpa/inet.h>
79#include <time.h>
80#include <linux/dvb/ca.h>
81#include <sys/types.h>
82
83#include <fcntl.h>
84#include <stdint.h>
85#include <stdio.h>
86#include <stdlib.h>
87#include <string.h>
88#include <sys/types.h>
89#include <sys/stat.h>
90#include <unistd.h>
91#include <time.h>
92
93#include <openssl/pem.h>
94#include <openssl/x509.h>
95#include <openssl/x509v3.h>
96#include <openssl/sha.h>
97#include <openssl/aes.h>
98
99//for freetype
100#include <ft2build.h>
101#include FT_FREETYPE_H
102#include FT_CACHE_H
103
104//for eplayer
105#ifdef EPLAYER3
106#include <common.h>
107//#ifndef BETA
108//#include <subtitle.h>
109//#endif
110#endif
111
112#ifdef EPLAYER4
113#include <gst/gst.h>
114#include <gst/pbutils/missing-plugins.h>
115#endif
116
117#ifdef DVDPLAYER
118#include <ddvdlib.h>
119#endif
120
121#define DRIVER " -   - "
122#define OVERSION "1.86"
123#define PROGNAME "titan"
124#define COPYRIGHT "NIT"
125#define CRONTRIBUT "obi, gost"
126#define PLUGINVERSION 1
127
128#define _(x) gettext(x)
129#define MINMALLOC 4096
130#define SCROLLBARWIDTH 15
131#define SCROLLBARBORDERSIZE 1
132#define FONTPOSYOFFSET -3
133#define FB "fb0"
134#define FB1 "fb1"
135#define SKINFB "skinfb"
136#define ACCELFB "accelfb"
137#define CONFIGFILE PROGNAME".cfg"
138#define KILLPROG "killall -9 "PROGNAME
139#define REBOOT "init 6"
140#define FILELISTDELMARK 255
141#define PLUGINDELMARK 254
142#define MAXDVBADAPTER 1
143//#ifndef MIPSEL
144#define MAXFRONTENDDEV 4
145//#else
146//#define MAXFRONTENDDEV 2
147//#endif
148#define MAXDEMUXDEVOPEN 10
149#define MAXAUDIODEV 4
150#define MAXVIDEODEV 4
151#define MAXCIDEV 4
152#define MAXCADEV 4
153#ifndef MIPSEL
154#define MAXDVRDEV 4
155#define MAXDEMUXDEV 4
156#else
157#define MAXDVRDEV 5
158#define MAXDEMUXDEV 5
159#define MAXENCODERDEV 2
160#define DVB_API_VERSION 5
161#endif   
162#define MAXSCDEV 2
163#define RCTIMEOUT 999999
164#define RCTHREADSTANDBY 999998
165#define MAXSERVICETYPE 10
166#define CHANNELCACHEMAX 1000
167#define MEDIADBCACHEMAX 1000
168#define TRANSPONDERCACHEMAX 500
169#define MAXHTTPDCONN 20
170#define MAXHTMLLINE 300
171#define MAXRGUIDCONN 1
172#define LISTHASHSIZE 27
173#define MAXCASESSION 16
174#define MAXCASERVICE 20
175#define MAXLONGKEY 10
176#define MAXSAT 64
177#define MAXBGDOWNLOAD 10
178#ifdef MIPSEL
179#define EPGSCANLOG "/mnt/logs/epgscan.log"
180#else
181#define EPGSCANLOG "/tmp/epgscan.log"
182#endif
183#define MAXCHANNELHISTORY 6
184#define HILO(x) (x##_hi << 8 | x##_lo)
185#define HILO32(x) (x##_hi << 24 | x##_mh << 16 | x##_ml << 8 | x##_lo)
186#define SERIALDEV "/dev/ttyAS0"
187#define MAXTOKENS 256
188#define MAXSTACKTRACE 30
189#define MAXSTACKTRACEFUNC 20
190
191#define USBDEVICE_SUPER_MAGIC 0x9fa2
192#define EXT2_SUPER_MAGIC 0xEF53
193#define EXT3_SUPER_MAGIC 0xEF53
194#define SMB_SUPER_MAGIC 0x517B
195#define NFS_SUPER_MAGIC 0x6969
196#define MSDOS_SUPER_MAGIC 0x4d44
197
198#ifndef VIDEO_SOURCE_HDMI
199#define VIDEO_SOURCE_HDMI 2
200#endif
201#ifndef AUDIO_SOURCE_HDMI
202#define AUDIO_SOURCE_HDMI 2
203#endif
204
205//cacc cert check
206#define ROOT_CERT     "/mnt/swapextensions/etc/pem/root.pem"
207#define CUSTOMER_CERT "/mnt/swapextensions/etc/pem/customer.pem"
208#define DEVICE_CERT   "/mnt/swapextensions/etc/pem/device.pem"
209#define MAX_ELEMENTS    33
210#ifdef MIPSEL
211#define CA_SET_DESCR_DATA _IOW('o', 137, struct ca_descr_data)
212#endif
213#ifdef SH4NEW
214#define CA_SET_DESCR_DATA _IOW('o', 137, struct ca_descr_data)
215#endif
216
217//Start Function Entry Point
218#define STARTFUNC
219
220//CA Defines
221#define T_SB 0x80               //sb (h<--m)
222#define T_RCV 0x81              //receive (h-->m)
223#define T_CREATE_T_C 0x82       //create transport connection (h-->m)
224#define T_C_T_C_REPLY 0x83      //ctc reply (h<--m)
225#define T_DELETE_T_C 0x84       //delete tc (h<->m)
226#define T_D_T_C_REPLY 0x85      //dtc reply (h<->m)
227#define T_REQUEST_T_C 0x86      //request transport connection (h<--m)
228#define T_NEW_T_C 0x87          //new tc - reply to t_request (h-->m)
229#define T_T_C_ERROR 0x77        //error creating tc (h-->m)
230#define T_DATA_LAST 0xA0        //convey data from higher (h<->m)
231#define T_DATA_MORE 0xA1        //convey data from higher (h<->m)
232
233//Alarm Signal used as timeout
234#define ALARMTIMEOUT 1
235#define ALARMSTARTTIME(x) if(ALARMTIMEOUT == 1) {alarm(x);}
236#define ALARMSTOPTIME if(ALARMTIMEOUT == 1) {alarm(0);}
237
238// VFD icons supported (more or less) on all boxes:
239typedef 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;
240
241#define OMIN(a,b) (a < b ? a : b)
242#define OMAX(a,b) (a > b ? a : b)
243
244#define bcdtoint(i) ((((i & 0xf0) >> 4) * 10) + (i & 0x0f))
245
246#define alpha_composite(composite, fg, alpha, ralpha, bg) { (composite) = ((fg)*(alpha) + (bg)*(ralpha)) >> 8; }
247
248enum {LEFT=20000, CENTER, RIGHT, TEXTCENTER, TEXTRIGHT};
249enum {TOP=20000, MIDDLE, BOTTOM, TEXTMIDDLE, TEXTBOTTOM};
250enum {BOTTOMLEFT, BOTTOMRIGHT, TOPLEFT, TOPRIGHT};
251enum {LEFTRIGHT=1, TOPBOTTOM, LEFTMIDDLE, TOPMIDDLE};
252enum {NO, YES, AUTONO, AUTOYES};
253enum {UNDEF=0, LISTBOX=1, TEXTBOX=2, CHOICEBOX=4, INPUTBOX=8, INPUTBOXNUM=16, FILELIST=32, PROGRESSBAR=64, MENU=128, MULTIPROGRESSBAR=256, GRID=512, GRIDBR=1024, PASSWORD=2048};
254enum {FRONTENDDEV, DEMUXDEV, VIDEODEV, AUDIODEV, CADEV, CIDEV, FRONTENDDEVDUMMY, DVRDEV, SCDEV, ENCODERDEV};
255enum {TV, RADIO};
256enum {RECDIRECT, RECTIMER, RECTIMESHIFT, RECSTREAM, RECPLAY, RECSTREAMENC};
257#ifdef DREAMBOX
258enum {MPEGV = 0, MPEG4V = 4, H264 = 1, VC1 = 10, H265 = 22};
259enum {AC3 = 0, MPEGA = 1, DTS = 2, LPCM = 6, AAC = 8, AACHE = 9, DTSHD = 16, DDP = 7};
260#else
261enum {AC3 = 0, MPEGA = 1, DTS = 2, LPCM = 6, AAC = 8, AACHE = 9, DTSHD = 16, DDP = 34};
262enum {MPEGV = 0, MPEG4V = 4, H264 = 1, VC1 = 10, H265 = 7};
263#endif
264enum {ALLCHANNEL, SATCHANNEL, PROVIDERCHANNEL, AZCHANNEL, BOUQUETCHANNEL, SATLIST, PROVIDERLIST, AZLIST, MAINBOUQUETLIST};
265enum {NOMODE, MVMODE, RMMODE, CPMODE, PROTECTMODE, EDITMODE};
266enum {NOTHING, CHANNEL, STILLPIC, RECORDDIRECT, RECORDTIMER, RECORDTIMESHIFT, RECORDSTREAM, TMPOTHER, RECORDPLAY, HDMIIN};
267enum {START, PAUSE, STOP};
268enum {DEACTIVE, ACTIVE, INPAUSE, ERROR};
269enum {FUNCTEXT, FUNCPIC, FUNCPROGRESS,FUNCPICOLED};
270enum {CASESSIONCREATE, CASESSIONBUSY, CASESSIONDEL, CASESSIONSTART, CASESSIONFINAL, CARESFIRSTENQUIRY, CARESCHANGE, CARESENQUIRY, CADATETIMESEND, CAMMIIDLE, CAMMIDISPLAYREPLAY, CAMMIFAKEOK};
271
272#ifdef BETA
273struct stacktrace
274{
275        int pos;
276        pthread_t thread;
277        void* func[MAXSTACKTRACEFUNC];
278};
279struct stacktrace stacktrace[MAXSTACKTRACE];
280#endif
281
282struct lastsubtitle
283{
284        uint64_t transponderid;
285        int serviceid;
286        int16_t subtitlepid;
287        int16_t subtitleid1;
288        int16_t subtitleid2;
289        struct lastsubtitle* next;
290};
291
292struct newsletter
293{
294        unsigned long nr;
295        char* date;
296        char* title;
297        char* text;
298        struct newsletter* next;
299};
300
301struct oldentry
302{
303        void* entry;
304        //0 = epg
305        int type;
306        time_t del;
307        struct oldentry* next;
308};
309
310struct unicable
311{
312        char* manufacturer;
313        char* product;
314        int scr1;
315        int scr2;
316        int scr3;
317        int scr4;
318        int scr5;
319        int scr6;
320        int scr7;
321        int scr8;
322        int lofl;
323        int lofh;
324        struct unicable* next;
325        struct unicable* prev;
326};
327
328struct id3tag
329{
330        int version;
331        char* title;
332        char* artist;
333        char* album;
334        char* year;
335        char* comment;
336        char* genrecode;
337        char* genretext;
338        char* poster;
339        int track;
340        int len;
341        int picturetype;
342        unsigned int picturepos;
343        unsigned int picturelen;
344};
345
346struct id3genre
347{
348        int code;
349        char text[30];
350};
351
352struct regex
353{
354        char* match1;
355        char* match2;
356        char* match3;
357        char* match4;
358        char* match5;
359        char* match6;
360        char* match7;
361        char* match8;
362        char* match9;
363        char* match10;
364};
365
366struct imdb
367{
368        char* title;
369        char* year;
370        char* rated;
371        char* released;
372        char* genre;
373        char* director;
374        char* writer;
375        char* actors;
376        char* plot;
377        char* poster;
378        char* runtime;
379        char* rating;
380        char* votes;
381        char* id;
382        char* thumb;
383};
384
385struct imdbapi
386{
387        char* title;
388        char* year;
389        char* rated;
390        char* released;
391        char* genre;
392        char* director;
393        char* writer;
394        char* actors;
395        char* plot;
396        char* poster;
397        char* runtime;
398        char* rating;
399        char* votes;
400        char* id;
401};
402
403struct tmdb
404{
405        char* title;
406        char* year;
407        char* rated;
408        char* released;
409        char* genre;
410        char* runtime;
411        char* plot;
412        char* postermid;
413        char* rating;
414        char* votes;
415        char* id;
416        char* backdrop;
417        char* imdbid;
418        char* orgname;
419        char* language;
420        char* type;
421        char* score;
422        char* cover;
423        char* thumb;
424        char* mvi;
425        struct tmdb* prev;
426        struct tmdb* next;
427};
428
429struct mediadbfilter
430{
431        struct mediadb* node;
432        int count;
433        struct mediadbfilter* prev;
434        struct mediadbfilter* next;
435};
436
437struct mediadbcategory
438{
439        int type;
440        char* name;
441        struct mediadbcategory* prev;
442        struct mediadbcategory* next;
443};
444
445struct mediadb
446{
447        char* id;
448        int type;
449        char* title;
450        int year;
451        char* released;
452        char* runtime;
453        char* genre;
454        char* director;
455        char* writer;
456        char* actors;
457        char* plot;
458        char* poster;
459        int rating;
460        int votes;
461        char* path;
462        char* file;
463        char* shortname;
464        char* fileinfo;
465        time_t timestamp;
466        //bit 31: manual change
467        int flag;
468        int backdropcount;
469        struct mediadb* prev;
470        struct mediadb* next;
471};
472
473struct mediadbcache
474{
475        char* path;
476        char* file;
477        struct mediadb* mediadbnode;
478        struct mediadbcache* next;
479};
480
481struct mostzap
482{
483        int serviceid;
484        uint64_t transponderid;
485        int count;
486        struct mostzap* prev;
487        struct mostzap* next;
488};
489
490struct menulist
491{
492        char* name;
493        char* text;
494        char* pic;
495        char* param;
496        char* param1;
497        char* param2;
498        char* param3;
499        int deaktiv;
500        int defaultentry;
501        struct menulist* next;
502};
503
504struct channelhistory
505{
506        struct channel* chnode;
507        char* channellist;
508};
509
510struct queue
511{
512        //0-99 for ca module
513        //101 for thumb thread
514        int type;
515        int flag;
516        int len;
517        void* data;
518        void* data1;
519        struct queue* prev;
520        struct queue* next;
521};
522
523struct casession
524{
525        int inuse;
526        int sessionnr;
527        int action;
528        int state;
529        int mmimanager;
530        int camanager;
531        int datetimemanager;
532        int appmanager;
533        int resmanager;
534        int ccmanager;
535        char* mmititle;
536        char* mmisubtitle;
537        char* mmitext;
538        char* mmibottom;
539};
540
541struct caslot
542{
543        struct casession casession[MAXCASESSION];
544        int connid;
545        int poll;
546        int status;
547        int rlen;
548        unsigned char* rbuf;
549        char* name;
550        int fastrun;
551        char* caids;
552        // cacc
553        unsigned char lastKey[32];
554        uint8_t lastParity;
555//      unsigned char scrambled;
556        int scrambled;
557        void *private_data;
558        int ccmgr_ready;
559        // not in used currently
560        int inuse;
561        int sidblacklisted;
562};
563
564struct hdd
565{
566        char* device;
567        int partition;
568        unsigned long long size;
569        char* filesystem;
570        char* label;
571        char* uuid;
572        char* vendor;
573        char* model;
574        int removable;
575        int read;
576        int write;
577        int sleeptime;
578        int notchanged;
579        struct hdd* prev;
580        struct hdd* next;
581};
582
583struct scaninfo
584{
585        struct dvbdev* fenode;
586        struct transponder* tpnode;
587        struct skin* scanscreen;
588        struct skin* listbox;
589        int threadend;
590        int scantype;
591        int fetype;
592        int orbitalpos;
593        int timeout;
594        int onlyfree;
595        int networkscan;
596        int clear;
597        int blindscan;
598        char* satname;
599        int tpcount;
600        int tpmax;
601        int tpnew;
602        int tpdel;
603        int tvcount;
604        int newtvcount;
605        int radiocount;
606        int newradiocount;
607        int datacount;
608        int newdatacount;
609        int blindcount;
610        int newblindcount;
611        int changename;
612        int cleartransponder;
613        unsigned int blindmax;
614} scaninfo;
615
616struct screensaver
617{
618        int type;
619        int speed;
620        int newposx;
621        int newposy;
622        int flag;
623        struct skin* screen;
624        struct skin* screennode;
625        struct skin* filelist;
626        struct skin* aktnode;
627        struct pic* pic;
628        char* value;
629        char* path;
630};
631
632struct playlist
633{
634        char* file;
635        struct playlist* prev;
636        struct playlist* next;
637};
638
639struct mainplaylist
640{
641        char* name;
642        char* filename;
643        struct playlist* playlist;
644        struct mainplaylist* prev;
645        struct mainplaylist* next;
646};
647
648struct epgrecord
649{
650        time_t begin;
651        time_t end;
652        int posx;
653        int size;
654        struct epgrecord* prev;
655        struct epgrecord* next;
656};
657
658struct download
659{
660        char* host;
661        char* page;
662        int port;
663        char* filename;
664        char* auth;
665        int connfd;
666        int proz;
667        unsigned int maxkb;
668        unsigned int aktkb;
669        int ret;
670        int timeout;
671        int flag;
672};
673
674struct copyfile
675{
676        char* from;
677        char* to;
678        int proz;
679        int filecount;
680        int maxfilecount;
681        off64_t maxkb;
682        off64_t aktkb;
683        int stop;
684        int ret;
685        int flag;
686};
687
688struct epgscanlist
689{
690        int serviceid;
691        uint64_t transponderid;
692        time_t scantime;
693        struct epgscanlist* prev;
694        struct epgscanlist* next;
695        char* name;
696};
697
698struct rgba
699{
700        char r;
701        char g;
702        char b;
703        char a;
704};
705
706struct subclutentry
707{
708        unsigned char Y, Cr, Cb, T;
709        unsigned char valid;
710};
711
712struct subclut
713{
714        unsigned char clutid;
715        unsigned char clutversionnumber;
716        struct subclutentry entries2bit[4];
717        struct subclutentry entries4bit[16];
718        struct subclutentry entries8bit[256];
719        struct subclut *next;
720};
721
722struct subpagereg
723{
724        int regid;
725        int reghorizontaladdress;
726        int regverticaladdress;
727        int scaleposx, scaleposy;
728        struct subpagereg *next;
729};
730
731struct subregobj
732{
733        int objid;
734        int objtype;
735        int objproviderflag;
736        int objhorizontalpos;
737        int objverticalpos;
738        // not supported right now...
739        int foregroundpixel;
740        int backgroundpixel;
741        struct subregobj *next;
742};
743
744struct subreg
745{
746        int regid;
747        int versionnumber;
748        int height, width;
749        int scaleheight, scalewidth;
750        int depth;
751        unsigned char *buf;
752        struct rgba *palette;
753        int clutid;
754        int committed;
755        struct subregobj *objects;
756        struct subreg *next;
757};
758
759struct subpage
760{
761        int pageid;
762        time_t pagetimeout;
763        int pageversionnumber;
764        int state;
765        int pcssize;
766        struct subpagereg *pageregions;
767        struct subreg *regions;
768        struct subclut *cluts;
769        struct subpage *next;
770};
771
772struct bitstream
773{
774        unsigned char *data;
775        int size;
776        int avail;
777        int consumed;
778};
779
780//there are a copyrectimer function
781//if you change the struct you must change this funktion
782struct rectimer
783{
784        char* name;
785        char* timestamp;
786        time_t begin;
787        time_t end;
788        int repeate;
789        int afterevent;
790        char* pincode;
791        int disabled;
792        int justplay;
793        char* recpath;
794        int servicetype;
795        char* channellist;
796        int serviceid;
797        //0 = nothing
798        //1 = running
799        //2 = end
800        //3 = error
801        //4 = epgscan timer activ
802        //5 = epgscan timer not activ
803        int status;
804        char* errstr;
805        struct service* servicenode;
806        uint64_t transponderid;
807        struct rectimer *prev;
808        struct rectimer *next;
809};
810
811struct inetwork
812{
813        char* device;
814        char* ip;
815        char* netmask;
816        char* mac;
817        char* broadcast;
818        //0 = static
819        //1 = dhcp
820        //2 = off
821        int type;
822        int found;
823        //flag 1 = used in titan
824        int flag;
825        struct inetwork *prev;
826        struct inetwork *next;
827};
828
829struct rcmap
830{
831        char* name;
832        int key;
833        int newkey;
834        struct rcmap* next;
835};
836
837struct splitstr
838{
839        char* part;
840};
841
842struct channelcache
843{
844        int serviceid;
845        uint64_t transponderid;
846        struct channel* chnode;
847        struct channelcache* next;
848};
849
850struct transpondercache
851{
852        uint64_t transponderid;
853        struct transponder* tpnode;
854        struct transpondercache* next;
855};
856
857struct filelist
858{
859        int type;
860        int view;
861        off64_t size;
862        time_t date;
863};
864
865struct skin
866{
867        char* name;
868        unsigned int type;
869        uint8_t wrap;
870        uint8_t bordersize;
871        uint8_t scrollbar;
872        uint16_t halign;
873        uint16_t valign;
874        int16_t posx;
875        int16_t posy;
876        int16_t width;
877        int16_t height;
878        long bordercol;
879        long deaktivcol;
880        long shadowcol;
881        uint8_t shadowsize;
882        uint8_t shadowpos;
883        uint8_t fontsize;
884        uint8_t fontsize2;
885        long fontcol;
886        long fontcol2;
887        char* font;
888        int16_t zorder;
889        int16_t titlealign;
890        char* title;
891        char* text;
892        char* text2;
893        long bgcol;
894        long bgcol2;
895        long titlebgcol;
896        long titlebgcol2;
897        long progresscol;
898        char* selectpic;
899        char* pic;
900        int16_t picwidth;
901        int16_t picheight;
902        uint16_t hspace;
903        uint16_t vspace;
904        char* (*skinfunc)(struct skin*, void*, void*);
905        char* param1;
906        char* param2;
907        char* parent;
908        char* input;
909        char* mask;
910        uint16_t textposx;
911        uint16_t textposx2;
912        int16_t gradient;
913        int16_t titlegradient;
914        uint8_t transparent;
915        uint8_t hidden;
916        uint8_t funcrettype;
917        int8_t charspace;
918        int8_t bordertype;
919        int16_t borderradius;
920        uint16_t bgspace;
921        uint8_t picquality;
922
923        uint8_t titlesize;
924        struct filelist* filelist;
925        struct skin* parentpointer;
926        char* ret;
927        char* choiceboxvalue;
928        unsigned int linecount;
929        unsigned int pagecount;
930        unsigned int poscount;
931        unsigned int gridcol;
932        int aktpage;
933        int aktline;
934        uint8_t scrollbarbordersize;
935        uint8_t prozposx;
936        uint8_t prozposy;
937        uint8_t prozwidth;
938        uint8_t prozheight;
939        uint8_t picprozwidth;
940        uint8_t del;
941        uint8_t picprozheight;
942        int16_t scrollbarheight;
943        int16_t progresssize;
944        int16_t scrollbarwidth;
945        int16_t scrollbarpos;
946        int16_t rposx;
947        int16_t rposy;
948        int16_t rwidth;
949        int16_t rheight;
950        int16_t rpicwidth;
951        int16_t rpicheight;
952        int16_t iposx;
953        int16_t iposy;
954        int16_t iwidth;
955        int16_t iheight;
956        char* handle;
957        char* handle1;
958        struct epgrecord* epgrecord;
959        char* pluginhandle;
960        uint8_t locked;
961        uint8_t picmem;
962        //bit 0: 1 = node is drawed
963        //bit 1: 1 = node is changed
964        uint8_t flag;
965        int hash;
966        struct skin *select;
967        struct skin *child;
968        struct skin *prev;
969        struct skin *next;
970        struct skin *drawnext;
971        // usesavebg=0 disable
972        // usesavebg=1 save always
973        // usesavebg=2 save one times then free
974        // usesavebg=3 dummy for filelist
975        int usesavebg;
976        // savebg is saved date
977        char* savebg;
978        // fuer blinken
979        int nodestyle;
980};
981
982struct style
983{
984        char* name;
985        int16_t posx;
986        int16_t posy;
987        int16_t width;
988        int16_t height;
989        int16_t picwidth;
990        int16_t picheight;
991        uint16_t textposx;
992        uint16_t textposx2;
993        uint16_t halign;
994        uint16_t valign;
995        uint16_t hspace;
996        uint16_t vspace;
997        uint16_t bgspace;
998        int16_t borderradius;
999        int16_t titlealign;
1000        int16_t zorder;
1001        int16_t gradient;
1002        int16_t titlegradient;
1003        uint8_t picquality;
1004        uint8_t hidden;
1005        uint8_t wrap;
1006        uint8_t scrollbar;
1007        uint8_t bordersize;
1008        int8_t bordertype;
1009        uint8_t shadowsize;
1010        uint8_t shadowpos;
1011        uint8_t fontsize;
1012        uint8_t fontsize2;
1013        int8_t charspace;
1014        uint8_t transparent;
1015        uint8_t prozposx;
1016        uint8_t prozposy;
1017        uint8_t prozwidth;
1018        uint8_t prozheight;
1019        uint8_t picprozwidth;
1020        uint8_t picprozheight;
1021        uint8_t funcrettype;
1022        uint8_t picmem;
1023        long bordercol;
1024        long deaktivcol;
1025        long progresscol;
1026        long shadowcol;
1027        long fontcol;
1028        long fontcol2;
1029        long titlebgcol;
1030        long titlebgcol2;
1031        long bgcol;
1032        long bgcol2;
1033        char* font;
1034        char* pic;
1035        char* param1;
1036        char* param2;
1037        char* input;
1038        char* mask;
1039        char* (*skinfunc)(struct skin*, void*, void*);
1040        struct style* next;
1041};
1042
1043struct epg
1044{
1045        int eventid;
1046        int version;
1047        time_t starttime;
1048        time_t endtime;
1049        char* title;
1050        char* subtitle;
1051        char* desc;
1052        int desclen;
1053        int desccomplen;
1054        int parentalrating;
1055        struct epg* prev;
1056        struct epg* next;
1057};
1058
1059struct shutdowntimer
1060{
1061        int active,type; //type: 0=DeepStandby, 1=Standby
1062        long long shutdown_time;
1063};
1064
1065struct dvbdev
1066{
1067        char* dev;
1068        int fd;
1069        uint8_t type;
1070        uint8_t adapter;
1071        uint8_t devnr;
1072        uint8_t felock;
1073        uint8_t deactive;
1074        uint8_t decoder;
1075        struct transponder* felasttransponder;
1076        struct transponder* feakttransponder;
1077        int feunicable;
1078        unsigned int feloffrequency;
1079        int feaktband;
1080        int feaktpolarization;
1081        fe_sec_voltage_t feaktvolt;
1082        fe_sec_tone_mode_t feakttone;
1083        int fedmxsource;
1084        char* feaktnr;
1085        char* feshortname;
1086        char* fehyprid;
1087        struct dvb_frontend_info* feinfo;
1088        struct caslot* caslot;
1089        struct dvbdev *next;
1090};
1091
1092//there are a copytransponder and createtransponder function
1093//if you change this struct you must change the function
1094struct transponder
1095{
1096        uint64_t id;
1097        uint8_t fetype;
1098        uint8_t polarization;
1099        uint8_t modulation;
1100        uint8_t fec;
1101        uint8_t pilot;
1102        uint8_t rolloff;
1103        uint8_t inversion;
1104        uint8_t system;
1105        uint8_t flag;
1106        // 0 = unknown
1107        // 1 = tunable
1108        // 2 = not tunable
1109        uint8_t tunablestatus;
1110        int orbitalpos;
1111        unsigned int frequency;
1112        unsigned int symbolrate;
1113        int encoding;
1114        time_t lastepg;
1115        struct transponder *next;
1116};
1117
1118struct provider
1119{
1120        int providerid;
1121        char* name;
1122        int flag;
1123        struct provider *prev;
1124        struct provider *next;
1125};
1126
1127struct subtitle
1128{
1129        char* name;
1130        int16_t subtype;
1131        int16_t pid;
1132        int16_t type;
1133        int16_t id1;
1134        int16_t id2;
1135        struct subtitle* next;
1136};
1137
1138struct esinfo
1139{
1140        int streamtype;
1141        int pid;
1142        struct esinfo* next;
1143};
1144
1145struct cadesc
1146{
1147        int pid;
1148        int len;
1149        int systemid;
1150        int reserved;
1151        int capid;
1152        char* privat;
1153        struct cadesc* next;
1154};
1155
1156struct pmt
1157{
1158        int programnumber;
1159        int versionnumber;
1160        int currentnextindicator;
1161};
1162
1163struct audiotrack
1164{
1165        char* name;
1166        uint8_t audiocodec;
1167        int16_t audiopid;
1168        int16_t rdspid;
1169        struct audiotrack* next;
1170};
1171
1172struct linkedchannel
1173{
1174        uint64_t transponderid;
1175        int serviceid;
1176        time_t starttime;
1177        time_t endtime;
1178        struct linkedchannel* next;
1179};
1180
1181//there are a createchannel function
1182//if you change this struct you must change the function
1183struct channel
1184{
1185        char* name;
1186        uint64_t transponderid;
1187        int providerid;
1188        int serviceid;
1189        int servicetype;
1190        uint8_t flag;
1191        uint8_t crypt;
1192        int8_t videocodec;
1193        int8_t audiocodec;
1194        int16_t videopid;
1195        int16_t audiopid;
1196        int16_t ac3audiopid;
1197        int16_t txtpid;
1198        int16_t pcrpid;
1199        int16_t pmtpid;
1200        int16_t aitpid;
1201        uint8_t protect;
1202        char* hbbtvurl;
1203        struct transponder *transponder;
1204        struct provider *provider;
1205        struct audiotrack *audiotrack;
1206        struct subtitle *subtitle;
1207        struct linkedchannel *linkedchannel;
1208        struct pmt *pmt;
1209        struct cadesc *cadesc;
1210        struct esinfo *esinfo;
1211        struct epg *epg;
1212        struct channel *prev;
1213        struct channel *next;
1214};
1215
1216struct sat
1217{
1218        char* name;
1219        int orbitalpos;
1220        int flag;
1221        int fetype;
1222        int scan;
1223        struct sat *prev;
1224        struct sat *next;
1225};
1226
1227struct service
1228{
1229        int type;
1230        char* channellist;
1231        struct dvbdev *fedev;
1232        struct dvbdev *dmxaudiodev;
1233        struct dvbdev *dmxvideodev;
1234        struct dvbdev *dmxpcrdev;
1235        struct dvbdev *dmxsubtitledev;
1236        struct dvbdev *audiodev;
1237        struct dvbdev *videodev;
1238        struct dvbdev *encoderdev;
1239        struct transponder *transponder;
1240        struct channel *channel;
1241        unsigned char *pmtbuf;
1242        int pmtlen;
1243        int recdmxstart;
1244        int recdstfd;
1245        int recsrcfd;
1246        time_t recendtime;
1247        char* rectimestamp;
1248        size_t reclastsync;
1249        off64_t rectotal;
1250        int reccount;
1251        int tssize;
1252        char* recname;
1253        unsigned long long lenpts;
1254        unsigned long long startpts;
1255        unsigned long long endpts;
1256        unsigned long long bitrate;
1257        off64_t endoffile;
1258        struct service *next;
1259};
1260
1261struct caservice
1262{
1263        struct service* service;
1264        struct channel* channel;
1265        int count;
1266        int camsockfd;
1267        struct caslot* caslot;
1268        int camanager;
1269        char* capmt;
1270        int capmtlen;
1271        int cmdpos;
1272};
1273
1274struct stimerthread
1275{
1276        int delay;
1277        int count;
1278        int notfirst;
1279        pthread_attr_t attr;
1280        pthread_t thread;
1281        int status;
1282        int aktion;
1283        //bit 0: 1 = stop allwas on titan end
1284        int flag;
1285        void* param1;
1286        void* param2;
1287        void* (*func)(struct stimerthread*, void*, void*);
1288        struct stimerthread* next;
1289};
1290
1291struct hddparm
1292{
1293        char* device;
1294        int read;
1295        int write;
1296        int sleeptime;
1297        int notchanged;
1298};
1299
1300struct marker
1301{
1302        off64_t pos;
1303        off64_t time;
1304        char* timetext;
1305        struct marker* prev;
1306        struct marker* next;
1307};
1308
1309struct status
1310{
1311        int longkeycode[MAXLONGKEY];
1312        //aktivate extra featers
1313        int expertmodus;
1314        //http user:passwd
1315        char* httpauth;
1316        //set to 1 if channellist or channelnr open
1317        int channelswitch;
1318        //deaktivates child protect if greater then akttime
1319        time_t protecttime;
1320        char* boxtype;
1321        char* realboxtype;
1322        pthread_t mainthread;
1323        //videosize from stream
1324        video_size_t videosize;
1325        time_t videosizevalid;
1326        //radius for rounded border
1327        int borderradius;
1328        int picbordersize;
1329        int titlelinesize;
1330        //0 border
1331        //1 fullbar
1332        int listboxselecttype;
1333        //0 camd.socket
1334        //1 pmt.tmp
1335        int pmtmode;
1336        //timer for del old epg entrys
1337        time_t deloldepg;
1338        //write epg periodic to medium
1339        time_t writeperiodicepg;
1340        //0 dektiv
1341        //1 only scan
1342        //2 only whitlist
1343        //3 scan and whitelist
1344        int epglistmode;
1345        // 1 manual
1346        // 2 from standby
1347        int startmode;
1348        jmp_buf longjumpbuf;
1349        pthread_mutex_t drawingmutex;
1350        pthread_mutex_t rectimermutex;
1351        pthread_mutex_t servicemutex;
1352        pthread_mutex_t epgmutex;
1353        pthread_mutex_t channelmutex;
1354        pthread_mutex_t timerthreadmutex;
1355        pthread_mutex_t audiotrackmutex;
1356        pthread_mutex_t subtitlemutex;
1357        pthread_mutex_t linkedchannelmutex;
1358        pthread_mutex_t dmxdevmutex;
1359        pthread_mutex_t rcmutex;
1360        pthread_mutex_t queuemutex;
1361        pthread_mutex_t clistmutex;
1362        pthread_mutex_t hddmutex;
1363        pthread_mutex_t tsseekmutex;
1364        pthread_mutex_t accelfbmutex;
1365        pthread_mutex_t mediadbmutex;
1366        pthread_mutex_t oldentrymutex;
1367        pthread_mutex_t newslettermutex;
1368        pthread_mutex_t tithekmutex;
1369        pthread_mutex_t inetworkmutex;
1370        pthread_mutex_t textboxmutex;
1371        pthread_mutex_t setaktresmutex;
1372        pthread_mutex_t waitrcmutex;
1373        // mutex for VFD handling
1374        pthread_mutex_t vfdmutex;
1375        // mutex for OLED handling
1376        pthread_mutex_t oledmutex;
1377        off64_t recsplitsize;
1378        char* gateway;
1379        char* dnsserver1;
1380        char* dnsserver2;
1381        int fasttextrender;
1382        // 1 release all menus
1383        int menurelease;
1384        int play;
1385        int pause;
1386        int playspeed;
1387        int slowspeed;
1388        int prefillbuffer;
1389        int playpic;
1390#ifdef EPLAYER4
1391        int prefillbuffercount;
1392        int bufferpercent;
1393        int cleaninfobar;
1394//      gint avgInRate;
1395//      gint avgOutRate;
1396//      gint64 bufferingLeft;
1397        gint64 pts;
1398#endif
1399        int random;
1400        int repeat;
1401        int epgdays;
1402        int spinnertime;
1403        int spinnerspeed;
1404        int hangtime;
1405        int timeupdatecount;
1406        int markmodus;
1407        // 1 from main prog
1408        // 2 from a thread
1409        int standby;
1410        char* tmp;
1411        // rc filedescriptor
1412        int fdrc;
1413        // rc filedescriptor for tuxtxt
1414        int fdrctxt;
1415        int writeconfig;
1416        int writeownconfig;
1417        int writercconfig;
1418        int writeskinconfig;
1419        int writechannel;
1420        int writetransponder;
1421        int writeprovider;
1422        int writemainbouquet;
1423        int writebouquet;
1424        int writemainplaylist;
1425        int writeplaylist;
1426        int writesat;
1427        int writerectimer;
1428        int writeepgscanlist;
1429        int writemostzap;
1430        int writemediadb;
1431        int writelastsubtitle;
1432        int writechannelslot;
1433        // 1 mute is aktiv
1434        int mute;
1435        // 1 spinner is aktiv
1436        int spinner;
1437        // 1 infobar is aktiv
1438        // 2 infobar is aktiv (with wait befor show)
1439        // 3 infobar is aktiv (no autohide)
1440        int infobar;
1441        // with infobar to display
1442        int infobarnr;
1443        // 0 is for mute screen
1444        struct skin *drawallways[1];
1445        char* drawallwaysbg[1];
1446        int usedirectfb;
1447        // count how long last rcwait (shows spinner if to long)
1448        time_t sec;
1449        // if set to a value != 0, rcwait returns this number
1450        int rckey;
1451        struct skin* skinerr;
1452        pthread_attr_t timerthreadattr;
1453        pthread_t timerthread;
1454        int timerthreadstatus;
1455        int timerthreadaktion;
1456        pthread_attr_t subthreadattr;
1457        pthread_t subthread;
1458        int subthreadstatus;
1459        int subthreadaktion;
1460        int subthreadpid;
1461        int subthreadid1;
1462        int subthreadid2;
1463        // epg thread pointer
1464        struct stimerthread* epgthread;
1465        // epgscanlist thread pointer
1466        struct stimerthread* epgscanlistthread;
1467        // httpd thread pointer
1468        struct stimerthread* httpthread;
1469        // rguid thread pointer
1470        struct stimerthread* rguithread;
1471        // mediadb thread pointer
1472        struct stimerthread* mediadbthread;
1473        // newsletter thread pointer
1474        struct stimerthread* newsletterthread;
1475        // thumb thread pointer
1476        struct stimerthread* thumbthread;
1477        // rectimer thread
1478        struct stimerthread* rectimerthread;
1479        // rguid sock filedescriptor for rguid
1480        int rguidfd;
1481        struct service* aktservice;
1482        struct service* lastservice;
1483        struct service* pipservice;
1484        struct channel* markedchannel;
1485        //if we are in a epg screen, this is the showen channel
1486        struct channel* epgchannel;
1487        char* configfile;
1488        // for bouquet channel numbering
1489        int bouquetnr[MAXSERVICETYPE];
1490        int servicetype;
1491        struct shutdowntimer *sd_timer;
1492        // akt pos in channel cache
1493        int channelcachepos;
1494        // aktivate/deaktivate auto updatevfd
1495        int updatevfd;
1496        // count for recording
1497        int recording;
1498        // count for streaming
1499        int streaming;
1500        // pvr allowed = 1, disable = 0
1501        int pvr;
1502        // timeshift running = 1, ending = 2
1503        int timeshift;
1504        // 0 = normal, 1 = permanent timeshift
1505        int timeshifttype;
1506        // position in timeshiftfile to seek
1507        off64_t timeshiftpos;
1508        // ask if timeshift is running and switch channel
1509        int asktimeshift;
1510        // ts playing running = 1
1511        int playing;
1512        // if set to a skin (screenpointer) only this screen has rc
1513        struct skin* rcowner;
1514        struct skin* rcstandby;
1515        // timerstuktur fuer autores
1516        struct stimerthread* restimer;
1517        // spindown USB/HDD
1518        struct hddparm hdd[3];
1519        struct stimerthread* addhddall;
1520        // save old rotor position
1521        int rotoroldorbitalpos;
1522        // security check
1523        int security;
1524        // set to 1 if tvpic size is changed
1525        int tvpic;
1526        // timestamp for rc action
1527        time_t lastrcaction;
1528        // show timeline in channellist for each channel
1529        int showchanneltimeline;
1530        // see player.h for details
1531        int playercan;
1532                //Code von infobar.h aktiv = 1
1533        int infobaraktiv;
1534        //Name der Datei die abgespielt wird
1535        char* playfile;
1536        //Code MC aktiv = 1
1537        int mcaktiv;
1538        //greater 0 aktivate screen animation
1539        int screenanim;
1540        int screenanimspeed;
1541        //for auto increase audio vol
1542        int volautochange;
1543        int volautochangevalue;
1544        //for powerofftimer
1545        time_t fixpowerofftime;
1546        //for write FB in File
1547        int write_png;
1548        int write_jpg;
1549        //holds oversize value for blitter
1550        int leftoffset;
1551        int rightoffset;
1552        int topoffset;
1553        int bottomoffset;
1554        //background picture for all screens
1555        char* bgpic;
1556        //time for next picmem timeout check
1557        time_t picmemtimeout;
1558        time_t defpicmemtimeout;
1559        //show not tunable channel hidden (0)) or deaktive (1) in channellist
1560        int channellistview;
1561        //for blockmove in channellist
1562        int moveblockcount;
1563        //name ob file who played from webig
1564        char* webplayfile;
1565        //status of mediadbthread
1566        int mediadbthreadstatus;
1567        //for save mediadb in scan
1568        time_t mediadbsavetime;
1569        //colors / pic for selection
1570        long markcol;
1571        long filelistselectcol;
1572        long listboxselectcol;
1573        char* selectpic;
1574        //check if cam can decrypt channel
1575        int checkcamdecrypt;
1576        //don't send privat part of cadescriptor in capmt
1577        int caskipprivat;
1578        //send all caids or only caids cam can
1579        int casendallcaids;
1580        //show hidden files in filelist
1581        int showhiddenfiles;
1582        //mediadb
1583        int mediadbfiles;
1584        //show infobar on program change
1585        int infobarprogram;
1586        //for auto increase audio vol (mute)
1587        int volmute;
1588        int secondzap;
1589        //pointer to marker for recordings
1590        struct marker* playmarker;
1591        int autosubtitle;
1592        //save timeshift start time
1593        time_t timeshiftstart;
1594        int crosscontrol;
1595        int autochangechannelname;
1596        //tuxtext is running
1597        int tuxtxt;
1598        //on some fat32 hdd it takes very long to get free size
1599        int showrecfreesize;
1600        int firstunicablewait;
1601        //path for imdbfolder
1602        char* imdbfolderpath;
1603        int virtualzap;
1604        int fontsizeadjust;
1605        //count for drawing screen
1606        unsigned int drawscreencount;
1607        int autoseek;
1608        //skip all rc input events older than this value in millisec
1609        int rcskipms;
1610        //Workaround da ansonsten DVR4 nicht funktioniert (Treiberproblem)
1611        int setdvr0;
1612#ifdef MIPSEL
1613        //cec mipsel
1614        int cec_fixedAddress;
1615        int hdmiFd;
1616        int webencode;
1617#endif
1618        //pip Einstellungen
1619        int pipzap;
1620        // guest
1621        int whilecount;
1622        int sleepcount;
1623        int stats;
1624        char* url;
1625        //externer plugin Aufruf
1626        char* extplugin;
1627        //node oled blinken
1628        int skinblink;
1629        //BCM accel interface
1630        int bcm;
1631        //Volume
1632        int volume;
1633        int screenshot;
1634        // cacc
1635        int certchecked;
1636        int certok;
1637        int liveslot;
1638        // dynamic default skin infobar
1639        int getepgaktstart;
1640        int getepgaktend;
1641        int getepgakttitle;
1642        int getepgakttimeremaining;
1643        int getepgnextstart;
1644        int getepgnextend;
1645        int getepgnexttitle;
1646        int getepgnexttimeremaining;
1647        // downmix switch in audio menu (audiotrack.h)
1648        int downmix;
1649        // channels for recording
1650        struct channel* recchnode[9];
1651        // frontdev filedescriptor
1652        int fdrc1;
1653} status;
1654
1655struct fb
1656{
1657        int dev;
1658        char *name;
1659        int fd;
1660        unsigned char *fb;
1661        unsigned long *fblong;
1662        int width;
1663        int height;
1664        int pitch;
1665        unsigned long fixfbsize;
1666        unsigned long varfbsize;
1667        int colbytes;
1668        unsigned long data_phys;
1669        struct fb *next;
1670};
1671
1672struct rc
1673{
1674        int key;
1675        void (*rcfunc)(struct skin*, struct skin*, int screencalc, int filelistview, int flag);
1676        struct skin *screen;
1677        struct skin *screennode;
1678        struct skin *owner;
1679        struct rc *next;
1680};
1681
1682struct clist
1683{
1684        char *key;
1685        char *value;
1686        char *def;
1687        char *tmp;
1688        struct clist *next;
1689};
1690
1691struct bouquet
1692{
1693        int nr;
1694        int serviceid;
1695        uint64_t transponderid;
1696        struct channel *channel;
1697        struct bouquet *prev;
1698        struct bouquet *next;
1699};
1700
1701struct channelslot
1702{
1703        int slot;
1704        int serviceid;
1705        uint64_t transponderid;
1706        struct channelslot *next;
1707};
1708
1709struct mainbouquet
1710{
1711        char *name;
1712        int type;
1713        char *filename;
1714        struct bouquet *bouquet;
1715        struct mainbouquet *prev;
1716        struct mainbouquet *next;
1717};
1718
1719struct pic
1720{
1721        char* name;
1722        unsigned char* picbuf;
1723        // < 0 when picbuf is normal mem (hw jpg)
1724        int memfd;
1725        unsigned long width;
1726        unsigned long height;
1727        unsigned long rowbytes;
1728        int channels;
1729  int timeout;
1730  time_t lastaccess;
1731        int del;
1732        struct pic* next;
1733};
1734
1735struct font
1736{
1737        char *name;
1738        FT_Error error;
1739        FTC_Manager manager;
1740        FTC_SBitCache cache;
1741        FTC_ImageTypeRec desc;
1742        FT_Face face;
1743        FT_UInt prev_glyphindex;
1744        FT_Bool use_kerning;
1745        struct font *next;
1746};
1747
1748//structure for write fb to File
1749struct writeFBfile
1750{
1751        unsigned char* ActBuf;
1752        unsigned char* buf1;
1753        unsigned char* buf2;
1754} writeFBfile;
1755
1756struct eit
1757{
1758        u_char table_id                               /*:8*/;
1759        u_char section_length_hi                      :4;
1760        u_char                                        :3;
1761        u_char section_syntax_indicator               :1;
1762        u_char section_length_lo                      /*:8*/;
1763        u_char service_id_hi                          /*:8*/;
1764        u_char service_id_lo                          /*:8*/;
1765        u_char current_next_indicator                 :1;
1766        u_char version_number                         :5;
1767        u_char                                        :2;
1768        u_char section_number                         /*:8*/;
1769        u_char last_section_number                    /*:8*/;
1770        u_char transport_stream_id_hi                 /*:8*/;
1771        u_char transport_stream_id_lo                 /*:8*/;
1772        u_char original_network_id_hi                 /*:8*/;
1773        u_char original_network_id_lo                 /*:8*/;
1774        u_char segment_last_section_number            /*:8*/;
1775        u_char segment_last_table_id                  /*:8*/;
1776        u_char data[]; /* struct eitevent */
1777};
1778#define EITLEN sizeof(struct eit)
1779#define GETEITSECLEN(x) HILO(((struct eit*)(x))->section_length)
1780
1781struct eitevent
1782{
1783        u_char event_id_hi                            /*:8*/;
1784        u_char event_id_lo                            /*:8*/;
1785        u_char mjd_hi                                 /*:8*/;
1786        u_char mjd_lo                                 /*:8*/;
1787        u_char start_time_h                           /*:8*/;
1788        u_char start_time_m                           /*:8*/;
1789        u_char start_time_s                           /*:8*/;
1790        u_char duration_h                             /*:8*/;
1791        u_char duration_m                             /*:8*/;
1792        u_char duration_s                             /*:8*/;
1793        u_char descriptors_loop_length_hi             :4;
1794        u_char free_ca_mode                           :1;
1795        u_char running_status                         :3;
1796        u_char descriptors_loop_length_lo             /*:8*/;
1797        u_char data[];
1798};
1799#define EITEVENTLEN sizeof(struct eitevent)
1800#define GETEITDESCLEN(x) HILO(((struct eitevent *)x)->descriptors_loop_length)
1801
1802struct eitshortevent
1803{
1804        u_char descriptor_tag                         /*:8*/;
1805        u_char descriptor_length                      /*:8*/;
1806        u_char lang_code1                             /*:8*/;
1807        u_char lang_code2                             /*:8*/;
1808        u_char lang_code3                             /*:8*/;
1809        u_char event_name_length                      /*:8*/;
1810        u_char data[];
1811};
1812#define EITSHORTEVENTLEN sizeof(struct eitshortevent)
1813
1814struct eitlongevent
1815{
1816        u_char descriptor_tag                         /*:8*/;
1817        u_char descriptor_length                      /*:8*/;
1818        u_char last_descriptor_number                 :4;
1819        u_char descriptor_number                      :4;
1820        u_char lang_code1                             /*:8*/;
1821        u_char lang_code2                             /*:8*/;
1822        u_char lang_code3                             /*:8*/;
1823        u_char length_of_items                        /*:8*/;
1824        u_char data[]; /* struct eitlongeventitem */
1825};
1826#define EITLONGEVENTLEN sizeof(struct eitlongevent)
1827
1828struct eitlongeventitem
1829{
1830        u_char item_description_length               /*:8*/;
1831        u_char data[];
1832};
1833#define EITLONGEVENTITEMLEN sizeof(struct eitlongeventitem)
1834
1835struct eitlinkage
1836{
1837        u_char descriptor_tag                 /*:8*/;
1838        u_char descriptor_length              /*:8*/;
1839        u_char transport_stream_id_hi         /*:8*/;
1840        u_char transport_stream_id_lo         /*:8*/;
1841        u_char original_network_id_hi         /*:8*/;
1842        u_char original_network_id_lo         /*:8*/;
1843        u_char service_id_hi                  /*:8*/;
1844        u_char service_id_lo                  /*:8*/;
1845        u_char linkage_type                   /*:8*/;
1846};
1847#define EITLLINKAGELEN sizeof(struct eitlinkage)
1848
1849struct parentalrating
1850{
1851        u_char descriptor_tag                 /*:8*/;
1852        u_char descriptor_length              /*:8*/;
1853        u_char data[]; //struct parental_rating_item
1854};
1855#define PARENTALRATINGLEN sizeof(struct parentalrating)
1856
1857struct parentalratingitem
1858{
1859        u_char lang_code1                    /*:8*/;
1860        u_char lang_code2                    /*:8*/;
1861        u_char lang_code3                    /*:8*/;
1862        u_char rating                        /*:8*/;
1863};
1864#define PARENTALRATINGITEMLEN sizeof(struct parentalratingitem)
1865
1866struct rst //table id 0x71
1867{
1868        u_char table_id                     /*:8*/;
1869        u_char section_syntax_indicator         :1;
1870        u_char reserved_1                       :1;
1871        u_char reserved_2                       :2;
1872        u_int section_length                   :12;
1873};
1874#define RSTLEN sizeof(struct rst)
1875
1876struct rstitem
1877{
1878        u_char transponder_stream_id_hi     /*:8*/;
1879        u_char transponder_stream_id_lo     /*:8*/;
1880        u_char original_network_id_hi       /*:8*/;
1881        u_char original_network_id_lo       /*:8*/;
1882        u_char service_id_hi                /*:8*/;
1883        u_char service_id_lo                /*:8*/;
1884        u_char event_id_hi                  /*:8*/;
1885        u_char event_id_lo                  /*:8*/;
1886        u_char reserved_1                       :5;
1887        u_char running_status                   :3;
1888};
1889#define RSTITEMLEN sizeof(struct rstitem)
1890
1891struct mhwchannel
1892{
1893        u_char  network_id_hi;
1894        u_char  network_id_lo;
1895        u_char  transponder_id_hi;
1896        u_char  transponder_id_lo;
1897        u_char  channel_id_hi;
1898        u_char  channel_id_lo;
1899        u_char  name[16];
1900};
1901#define MHWCHANNELLEN sizeof(struct mhwchannel)
1902
1903struct mhwtitle
1904{
1905        u_char table_id                       :8;
1906        u_char section_length_hi              :4;
1907        u_char                                :2;
1908        u_char dummy                          :1;
1909        u_char section_syntax_indicator       :1;
1910        u_char section_length_lo              :8;
1911        u_char channel_id                     :8;
1912        u_char theme_id                       :8;
1913        u_char hours                                  :5;
1914        u_char day                            :3;
1915        u_char summary_available              :1;
1916        u_char                                      :1;
1917        u_char minutes                        :6;
1918        u_char                                :8;
1919        u_char                                :8;
1920        u_char duration_hi                    :8;
1921        u_char duration_lo                    :8;
1922        u_char title                          [23];
1923        u_char ppv_id_hi                      :8;
1924        u_char ppv_id_mh                      :8;
1925        u_char ppv_id_ml                      :8;
1926        u_char ppv_id_lo                      :8;
1927        u_char program_id_hi                  :8;
1928        u_char program_id_mh                  :8;
1929        u_char program_id_ml                  :8;
1930        u_char program_id_lo                  :8;
1931        u_char                                :8;
1932        u_char                                :8;
1933        u_char                                :8;
1934        u_char                                :8;
1935};
1936#define MHWTITLELEN sizeof(struct mhwtitle)
1937
1938struct mhwsummary
1939{
1940        u_char table_id                       :8;
1941        u_char section_length_hi              :4;
1942        u_char                                :2;
1943        u_char dummy                          :1;
1944        u_char section_syntax_indicator       :1;
1945        u_char section_length_lo              :8;
1946        u_char program_id_hi                  :8;
1947        u_char program_id_mh                  :8;
1948        u_char program_id_ml                  :8;
1949        u_char program_id_lo                  :8;
1950        u_char                                :8;
1951        u_char                                :8;
1952        u_char                                :8;
1953        u_char nb_replays                     :8;
1954};
1955#define MHWSUMMARYLEN sizeof(struct mhwsummary)
1956
1957struct mhw2channel
1958{
1959        u_char network_id_hi;
1960        u_char network_id_lo;
1961        u_char transponder_id_hi;
1962        u_char transponder_id_lo;
1963        u_char channel_id_hi;
1964        u_char channel_id_lo;
1965        u_char                                :8;
1966        u_char                                :8;
1967};
1968
1969struct extepgcache
1970{
1971        long id;
1972        struct epg* epgnode;
1973        struct extepgcache* next;
1974};
1975
1976struct extepgchannel
1977{
1978        long id;
1979        int serviceid;
1980        uint64_t transponderid;
1981        struct extepgchannel* next;
1982};
1983
1984struct extepgconfig
1985{
1986        uint64_t transponderid;
1987        int type;
1988        char* file;
1989        int channelpid;
1990        int titlepid[8];
1991        int summarypid[8];
1992        struct extepgconfig* next;
1993};
1994
1995struct blacklist
1996{
1997  char* file;
1998  struct splitstr* splitstr;
1999  int count;
2000};
2001
2002typedef struct sci_modes
2003{
2004        int emv2000;
2005        int dma;
2006        int man_act;
2007        int rw_mode;
2008} scimodes;
2009
2010typedef struct sci_parameters
2011{
2012        u_char T;
2013        unsigned long fs;
2014        unsigned long ETU;
2015        unsigned long WWT;
2016        unsigned long CWT;
2017        unsigned long BWT;
2018        unsigned long EGT;
2019        unsigned long clock_stop_polarity;
2020        u_char check;
2021        u_char P;
2022        u_char I;
2023        u_char U;
2024} sciparameters;
2025
2026struct update
2027{
2028        char* auth;
2029        char* type;
2030        char* skinname;
2031        char* filemask;
2032        char* filepath;
2033        int imgtype;
2034};
2035
2036#ifdef EPLAYER4
2037typedef enum { stUnknown, stPlainText, stSSA, stASS, stSRT, stVOB, stPGS } subtype_t;
2038typedef enum {atUnknown, atMPEG, atMP3, atAC3, atDTS, atAAC, atPCM, atOGG, atFLAC, atWMA} audiotype_t;
2039typedef struct _CustomData {
2040//typedef struct CustomData {
2041  GstElement *playbin2;   /* Our one and only element */
2042   
2043  gint n_video;          /* Number of embedded video streams */
2044  gint n_audio;          /* Number of embedded audio streams */
2045  gint n_text;           /* Number of embedded subtitle streams */
2046   
2047  gint current_video;    /* Currently playing video stream */
2048  gint current_audio;    /* Currently playing audio stream */
2049  gint current_text;     /* Currently playing subtitle stream */
2050
2051  gboolean is_live;
2052  GstElement *pipeline;
2053  GMainLoop *loop;
2054} CustomData;
2055
2056typedef enum {
2057        GST_PLAY_FLAG_VIDEO = (1 << 0),
2058        GST_PLAY_FLAG_AUDIO = (1 << 1),
2059        GST_PLAY_FLAG_TEXT = (1 << 2),
2060        GST_PLAY_FLAG_NATIVE_VIDEO = (1 << 3)
2061} GstPlayFlags;
2062#endif
2063
2064#ifdef MIPSEL
2065//fuer cec Mipsel
2066
2067#ifdef DREAMBOX
2068struct cec_message
2069{
2070        unsigned char address;
2071        unsigned char data[16];
2072        unsigned char length;
2073        unsigned char flag;
2074}__attribute__((packed));
2075struct cec_rx_message
2076{
2077        unsigned char address;
2078        unsigned char destination;
2079        unsigned char data[16];
2080        unsigned char length;
2081}__attribute__((packed));
2082
2083
2084#else
2085struct cec_message
2086{
2087unsigned char address;
2088unsigned char length;
2089unsigned char data[256];
2090}__attribute__((packed));
2091#endif
2092
2093unsigned char cec_physicalAddress[2];
2094unsigned char cec_logicalAddress;
2095unsigned char cec_deviceType;
2096
2097#endif
2098
2099// cacc
2100/* CI+ certificates */
2101
2102struct cert_ctx {
2103        X509_STORE *store;
2104
2105        /* Host */
2106        X509 *cust_cert;
2107        X509 *device_cert;
2108
2109        /* Module */
2110        X509 *ci_cust_cert;
2111        X509 *ci_device_cert;
2112};
2113
2114#ifdef MIPSEL
2115enum ca_descr_data_type {
2116        CA_DATA_IV,
2117        CA_DATA_KEY,
2118};
2119
2120enum ca_descr_parity {
2121        CA_PARITY_EVEN,
2122        CA_PARITY_ODD,
2123};
2124
2125struct ca_descr_data {
2126        unsigned int index;
2127        enum ca_descr_parity parity;
2128        enum ca_descr_data_type data_type;
2129        unsigned int length;
2130        unsigned char *data;
2131};
2132
2133#endif
2134
2135#ifdef SH4NEW
2136enum ca_descr_data_type {
2137        CA_DATA_IV,
2138        CA_DATA_KEY,
2139};
2140
2141enum ca_descr_parity {
2142        CA_PARITY_EVEN,
2143        CA_PARITY_ODD,
2144};
2145
2146struct ca_descr_data {
2147        unsigned int index;
2148        enum ca_descr_parity parity;
2149        enum ca_descr_data_type data_type;
2150        unsigned int length;
2151        unsigned char *data;
2152};
2153
2154#endif
2155
2156struct aes_xcbc_mac_ctx {
2157        uint8_t K[3][16];
2158        uint8_t IV[16];
2159        AES_KEY key;
2160        int buflen;
2161};
2162
2163uint32_t datatype_sizes[MAX_ELEMENTS] = {
2164        0, 50, 0, 0, 0, 8, 8, 0,
2165        0, 0, 0, 0, 32, 256, 256, 0,
2166        0, 256, 256, 32, 8, 8, 32, 32,
2167        0, 8, 2, 32, 1, 32, 1, 0,
2168        32
2169};
2170
2171struct element {
2172        uint8_t *data;
2173        uint32_t size;
2174        /* buffer valid */
2175        int valid;
2176};
2177
2178struct cc_ctrl_data {
2179        /* parent */
2180        struct caslot* slot;
2181
2182        /* ci+ credentials */
2183        struct element elements[MAX_ELEMENTS];
2184
2185        /* DHSK */
2186        uint8_t dhsk[256];
2187
2188        /* KS_host */
2189        uint8_t ks_host[32];
2190
2191        /* derived keys */
2192        uint8_t sek[16];
2193        uint8_t sak[16];
2194
2195        /* AKH checks - module performs 5 tries to get correct AKH */
2196        unsigned int akh_index;
2197
2198        /* authentication data */
2199        uint8_t dh_exp[256];
2200
2201        /* certificates */
2202        struct cert_ctx *cert_ctx;
2203
2204        /* private key of device-cert */
2205        RSA *rsa_device_key;
2206};
2207
2208#endif
Note: See TracBrowser for help on using the repository browser.