source: titan/titan/struct.h @ 41032

Last change on this file since 41032 was 41032, checked in by gost, 6 years ago

[titan] fbc tuner first step

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