source: titan/titan/struct.h @ 42368

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

[titan] test unicable2

File size: 44.7 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.89"
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 8
153#ifndef MIPSEL
154#define MAXDVRDEV 4
155#define MAXDEMUXDEV 4
156#else
157#define MAXDVRDEV 9
158#define MAXDEMUXDEV 9
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        unsigned int feloffrequency_uni;
1088        int feaktband;
1089        int feaktpolarization;
1090        fe_sec_voltage_t feaktvolt;
1091        fe_sec_tone_mode_t feakttone;
1092        int fedmxsource;
1093        char* feaktnr;
1094        char* feshortname;
1095        char* fehyprid;
1096        struct dvb_frontend_info* feinfo;
1097        struct caslot* caslot;
1098        struct dvbdev *next;
1099};
1100
1101//there are a copytransponder and createtransponder function
1102//if you change this struct you must change the function
1103struct transponder
1104{
1105        uint64_t id;
1106        uint8_t fetype;
1107        uint8_t polarization;
1108        uint8_t modulation;
1109        uint8_t fec;
1110        uint8_t pilot;
1111        uint8_t rolloff;
1112        uint8_t inversion;
1113        uint8_t system;
1114        uint8_t flag;
1115        // 0 = unknown
1116        // 1 = tunable
1117        // 2 = not tunable
1118        uint8_t tunablestatus;
1119        int orbitalpos;
1120        unsigned int frequency;
1121        unsigned int symbolrate;
1122        int encoding;
1123        time_t lastepg;
1124        struct transponder *next;
1125};
1126
1127struct provider
1128{
1129        int providerid;
1130        char* name;
1131        int flag;
1132        struct provider *prev;
1133        struct provider *next;
1134};
1135
1136struct subtitle
1137{
1138        char* name;
1139        int16_t subtype;
1140        int16_t pid;
1141        int16_t type;
1142        int16_t id1;
1143        int16_t id2;
1144        struct subtitle* next;
1145};
1146
1147struct esinfo
1148{
1149        int streamtype;
1150        int pid;
1151        struct esinfo* next;
1152};
1153
1154struct cadesc
1155{
1156        int pid;
1157        int len;
1158        int systemid;
1159        int reserved;
1160        int capid;
1161        char* privat;
1162        struct cadesc* next;
1163};
1164
1165struct pmt
1166{
1167        int programnumber;
1168        int versionnumber;
1169        int currentnextindicator;
1170};
1171
1172struct audiotrack
1173{
1174        char* name;
1175        uint8_t audiocodec;
1176        int16_t audiopid;
1177        int16_t rdspid;
1178        struct audiotrack* next;
1179};
1180
1181struct linkedchannel
1182{
1183        uint64_t transponderid;
1184        int serviceid;
1185        time_t starttime;
1186        time_t endtime;
1187        struct linkedchannel* next;
1188};
1189
1190//there are a createchannel function
1191//if you change this struct you must change the function
1192struct channel
1193{
1194        char* name;
1195        uint64_t transponderid;
1196        int providerid;
1197        int serviceid;
1198        int servicetype;
1199        uint8_t flag;
1200        uint8_t crypt;
1201        int8_t videocodec;
1202        int8_t audiocodec;
1203        int16_t videopid;
1204        int16_t audiopid;
1205        int16_t ac3audiopid;
1206        int16_t txtpid;
1207        int16_t pcrpid;
1208        int16_t pmtpid;
1209        int16_t aitpid;
1210        uint8_t protect;
1211        char* hbbtvurl;
1212        struct transponder *transponder;
1213        struct provider *provider;
1214        struct audiotrack *audiotrack;
1215        struct subtitle *subtitle;
1216        struct linkedchannel *linkedchannel;
1217        struct pmt *pmt;
1218        struct cadesc *cadesc;
1219        struct esinfo *esinfo;
1220        struct epg *epg;
1221        struct channel *prev;
1222        struct channel *next;
1223};
1224
1225struct sat
1226{
1227        char* name;
1228        int orbitalpos;
1229        int flag;
1230        int fetype;
1231        int scan;
1232        struct sat *prev;
1233        struct sat *next;
1234};
1235
1236struct service
1237{
1238        int type;
1239        char* channellist;
1240        struct dvbdev *fedev;
1241        struct dvbdev *dmxaudiodev;
1242        struct dvbdev *dmxvideodev;
1243        struct dvbdev *dmxpcrdev;
1244        struct dvbdev *dmxsubtitledev;
1245        struct dvbdev *audiodev;
1246        struct dvbdev *videodev;
1247        struct dvbdev *encoderdev;
1248        struct transponder *transponder;
1249        struct channel *channel;
1250        unsigned char *pmtbuf;
1251        int pmtlen;
1252        int recdmxstart;
1253        int recdstfd;
1254        int recsrcfd;
1255        time_t recendtime;
1256        char* rectimestamp;
1257        size_t reclastsync;
1258        off64_t rectotal;
1259        int reccount;
1260        int tssize;
1261        char* recname;
1262        unsigned long long lenpts;
1263        unsigned long long startpts;
1264        unsigned long long endpts;
1265        unsigned long long bitrate;
1266        off64_t endoffile;
1267        struct service *next;
1268};
1269
1270struct caservice
1271{
1272        struct service* service;
1273        struct channel* channel;
1274        int count;
1275        int camsockfd;
1276        struct caslot* caslot;
1277        int camanager;
1278        char* capmt;
1279        int capmtlen;
1280        int cmdpos;
1281};
1282
1283struct stimerthread
1284{
1285        int delay;
1286        int count;
1287        int notfirst;
1288        pthread_attr_t attr;
1289        pthread_t thread;
1290        int status;
1291        int aktion;
1292        //bit 0: 1 = stop allwas on titan end
1293        int flag;
1294        void* param1;
1295        void* param2;
1296        void* (*func)(struct stimerthread*, void*, void*);
1297        struct stimerthread* next;
1298};
1299
1300struct hddparm
1301{
1302        char* device;
1303        int read;
1304        int write;
1305        int sleeptime;
1306        int notchanged;
1307};
1308
1309struct marker
1310{
1311        off64_t pos;
1312        off64_t time;
1313        char* timetext;
1314        struct marker* prev;
1315        struct marker* next;
1316};
1317
1318struct status
1319{
1320        int longkeycode[MAXLONGKEY];
1321        //aktivate extra featers
1322        int expertmodus;
1323        //http user:passwd
1324        char* httpauth;
1325        //set to 1 if channellist or channelnr open
1326        int channelswitch;
1327        //deaktivates child protect if greater then akttime
1328        time_t protecttime;
1329        char* boxtype;
1330        char* realboxtype;
1331        pthread_t mainthread;
1332        //videosize from stream
1333        video_size_t videosize;
1334        time_t videosizevalid;
1335        //radius for rounded border
1336        int borderradius;
1337        int picbordersize;
1338        int titlelinesize;
1339        //0 border
1340        //1 fullbar
1341        int listboxselecttype;
1342        //0 camd.socket
1343        //1 pmt.tmp
1344        int pmtmode;
1345        //timer for del old epg entrys
1346        time_t deloldepg;
1347        //write epg periodic to medium
1348        time_t writeperiodicepg;
1349        //0 dektiv
1350        //1 only scan
1351        //2 only whitlist
1352        //3 scan and whitelist
1353        int epglistmode;
1354        // 1 manual
1355        // 2 from standby
1356        int startmode;
1357        jmp_buf longjumpbuf;
1358        pthread_mutex_t drawingmutex;
1359        pthread_mutex_t rectimermutex;
1360        pthread_mutex_t servicemutex;
1361        pthread_mutex_t epgmutex;
1362        pthread_mutex_t channelmutex;
1363        pthread_mutex_t timerthreadmutex;
1364        pthread_mutex_t audiotrackmutex;
1365        pthread_mutex_t subtitlemutex;
1366        pthread_mutex_t linkedchannelmutex;
1367        pthread_mutex_t dmxdevmutex;
1368        pthread_mutex_t rcmutex;
1369        pthread_mutex_t queuemutex;
1370        pthread_mutex_t clistmutex;
1371        pthread_mutex_t hddmutex;
1372        pthread_mutex_t tsseekmutex;
1373        pthread_mutex_t accelfbmutex;
1374        pthread_mutex_t mediadbmutex;
1375        pthread_mutex_t oldentrymutex;
1376        pthread_mutex_t newslettermutex;
1377        pthread_mutex_t tithekmutex;
1378        pthread_mutex_t inetworkmutex;
1379        pthread_mutex_t textboxmutex;
1380        pthread_mutex_t setaktresmutex;
1381        pthread_mutex_t waitrcmutex;
1382        // mutex for VFD handling
1383        pthread_mutex_t vfdmutex;
1384        // mutex for OLED handling
1385        pthread_mutex_t oledmutex;
1386                // mutex for cec handling
1387        pthread_mutex_t cecmutex;
1388        off64_t recsplitsize;
1389        char* gateway;
1390        char* dnsserver1;
1391        char* dnsserver2;
1392        int fasttextrender;
1393        // 1 release all menus
1394        int menurelease;
1395        int play;
1396        int pause;
1397        int playspeed;
1398        int slowspeed;
1399        int prefillbuffer;
1400        int playpic;
1401#ifdef EPLAYER4
1402        int prefillbuffercount;
1403        int bufferpercent;
1404        int cleaninfobar;
1405//      gint avgInRate;
1406//      gint avgOutRate;
1407//      gint64 bufferingLeft;
1408        gint64 pts;
1409#endif
1410        int random;
1411        int repeat;
1412        int epgdays;
1413        int spinnertime;
1414        int spinnerspeed;
1415        int hangtime;
1416        int timeupdatecount;
1417        int markmodus;
1418        // 1 from main prog
1419        // 2 from a thread
1420        int standby;
1421        char* tmp;
1422        // rc filedescriptor
1423        int fdrc;
1424        // rc filedescriptor for tuxtxt
1425        int fdrctxt;
1426        int writeconfig;
1427        int writeownconfig;
1428        int writercconfig;
1429        int writeskinconfig;
1430        int writechannel;
1431        int writetransponder;
1432        int writeprovider;
1433        int writemainbouquet;
1434        int writebouquet;
1435        int writemainplaylist;
1436        int writeplaylist;
1437        int writesat;
1438        int writerectimer;
1439        int writeepgscanlist;
1440        int writemostzap;
1441        int writemediadb;
1442        int writelastsubtitle;
1443        int writechannelslot;
1444        // 1 mute is aktiv
1445        int mute;
1446        // 1 spinner is aktiv
1447        int spinner;
1448        // 1 infobar is aktiv
1449        // 2 infobar is aktiv (with wait befor show)
1450        // 3 infobar is aktiv (no autohide)
1451        int infobar;
1452        // with infobar to display
1453        int infobarnr;
1454        // 0 is for mute screen
1455        struct skin *drawallways[1];
1456        char* drawallwaysbg[1];
1457        int usedirectfb;
1458        // count how long last rcwait (shows spinner if to long)
1459        time_t sec;
1460        // if set to a value != 0, rcwait returns this number
1461        int rckey;
1462        struct skin* skinerr;
1463        pthread_attr_t timerthreadattr;
1464        pthread_t timerthread;
1465        int timerthreadstatus;
1466        int timerthreadaktion;
1467        pthread_attr_t subthreadattr;
1468        pthread_t subthread;
1469        int subthreadstatus;
1470        int subthreadaktion;
1471        int subthreadpid;
1472        int subthreadid1;
1473        int subthreadid2;
1474        // epg thread pointer
1475        struct stimerthread* epgthread;
1476        // epgscanlist thread pointer
1477        struct stimerthread* epgscanlistthread;
1478        // httpd thread pointer
1479        struct stimerthread* httpthread;
1480        // rguid thread pointer
1481        struct stimerthread* rguithread;
1482        // mediadb thread pointer
1483        struct stimerthread* mediadbthread;
1484        // newsletter thread pointer
1485        struct stimerthread* newsletterthread;
1486        // thumb thread pointer
1487        struct stimerthread* thumbthread;
1488        // rectimer thread
1489        struct stimerthread* rectimerthread;
1490        // rguid sock filedescriptor for rguid
1491        int rguidfd;
1492        struct service* aktservice;
1493        struct service* lastservice;
1494        struct service* pipservice;
1495        struct channel* markedchannel;
1496        //if we are in a epg screen, this is the showen channel
1497        struct channel* epgchannel;
1498        char* configfile;
1499        // for bouquet channel numbering
1500        int bouquetnr[MAXSERVICETYPE];
1501        int servicetype;
1502        struct shutdowntimer *sd_timer;
1503        // akt pos in channel cache
1504        int channelcachepos;
1505        // aktivate/deaktivate auto updatevfd
1506        int updatevfd;
1507        // count for recording
1508        int recording;
1509        // count for streaming
1510        int streaming;
1511        // pvr allowed = 1, disable = 0
1512        int pvr;
1513        // timeshift running = 1, ending = 2
1514        int timeshift;
1515        // 0 = normal, 1 = permanent timeshift
1516        int timeshifttype;
1517        // position in timeshiftfile to seek
1518        off64_t timeshiftpos;
1519        // ask if timeshift is running and switch channel
1520        int asktimeshift;
1521        // ts playing running = 1
1522        int playing;
1523        // if set to a skin (screenpointer) only this screen has rc
1524        struct skin* rcowner;
1525        struct skin* rcstandby;
1526        // timerstuktur fuer autores
1527        struct stimerthread* restimer;
1528        // spindown USB/HDD
1529        struct hddparm hdd[3];
1530        struct stimerthread* addhddall;
1531        // save old rotor position
1532        int rotoroldorbitalpos;
1533        // security check
1534        int security;
1535        // set to 1 if tvpic size is changed
1536        int tvpic;
1537        // timestamp for rc action
1538        time_t lastrcaction;
1539        // show timeline in channellist for each channel
1540        int showchanneltimeline;
1541        // see player.h for details
1542        int playercan;
1543                //Code von infobar.h aktiv = 1
1544        int infobaraktiv;
1545        //Name der Datei die abgespielt wird
1546        char* playfile;
1547        //Code MC aktiv = 1
1548        int mcaktiv;
1549        //greater 0 aktivate screen animation
1550        int screenanim;
1551        int screenanimspeed;
1552        //for auto increase audio vol
1553        int volautochange;
1554        int volautochangevalue;
1555        //for powerofftimer
1556        time_t fixpowerofftime;
1557        //for write FB in File
1558        int write_png;
1559        int write_jpg;
1560        //holds oversize value for blitter
1561        int leftoffset;
1562        int rightoffset;
1563        int topoffset;
1564        int bottomoffset;
1565        //background picture for all screens
1566        char* bgpic;
1567        //time for next picmem timeout check
1568        time_t picmemtimeout;
1569        time_t defpicmemtimeout;
1570        //show not tunable channel hidden (0)) or deaktive (1) in channellist
1571        int channellistview;
1572        //for blockmove in channellist
1573        int moveblockcount;
1574        //name ob file who played from webig
1575        char* webplayfile;
1576        //status of mediadbthread
1577        int mediadbthreadstatus;
1578        //for save mediadb in scan
1579        time_t mediadbsavetime;
1580        //colors / pic for selection
1581        long markcol;
1582        long filelistselectcol;
1583        long listboxselectcol;
1584        char* selectpic;
1585        //check if cam can decrypt channel
1586        int checkcamdecrypt;
1587        //don't send privat part of cadescriptor in capmt
1588        int caskipprivat;
1589        //send all caids or only caids cam can
1590        int casendallcaids;
1591        //show hidden files in filelist
1592        int showhiddenfiles;
1593        //mediadb
1594        int mediadbfiles;
1595        //show infobar on program change
1596        int infobarprogram;
1597        //for auto increase audio vol (mute)
1598        int volmute;
1599        int secondzap;
1600        //pointer to marker for recordings
1601        struct marker* playmarker;
1602        int autosubtitle;
1603        //save timeshift start time
1604        time_t timeshiftstart;
1605        int crosscontrol;
1606        int autochangechannelname;
1607        //tuxtext is running
1608        int tuxtxt;
1609        //on some fat32 hdd it takes very long to get free size
1610        int showrecfreesize;
1611        int firstunicablewait;
1612        //path for imdbfolder
1613        char* imdbfolderpath;
1614        int virtualzap;
1615        int fontsizeadjust;
1616        //count for drawing screen
1617        unsigned int drawscreencount;
1618        int autoseek;
1619        //skip all rc input events older than this value in millisec
1620        int rcskipms;
1621        //Workaround da ansonsten DVR4 nicht funktioniert (Treiberproblem)
1622        int setdvr0;
1623#ifdef MIPSEL
1624        //cec mipsel
1625        int cec_fixedAddress;
1626        int hdmiFd;
1627        int webencode;
1628#endif
1629        //pip Einstellungen
1630        int pipzap;
1631        // guest
1632        int whilecount;
1633        int sleepcount;
1634        int stats;
1635        char* url;
1636        //externer plugin Aufruf
1637        char* extplugin;
1638        //node oled blinken
1639        int skinblink;
1640        //BCM accel interface
1641        int bcm;
1642        //Volume
1643        int volume;
1644        int screenshot;
1645        // cacc
1646        int certchecked;
1647        int certok;
1648        int liveslot;
1649        // dynamic default skin infobar
1650        int getepgaktstart;
1651        int getepgaktend;
1652        int getepgakttitle;
1653        int getepgakttimeremaining;
1654        int getepgnextstart;
1655        int getepgnextend;
1656        int getepgnexttitle;
1657        int getepgnexttimeremaining;
1658        // downmix switch in audio menu (audiotrack.h)
1659        int downmix;
1660        // channels for recording
1661        struct channel* recchnode[9];
1662        // frontdev filedescriptor
1663        int fdrc1;
1664        // Anzah VideoDevs
1665        int videodevs;
1666} status;
1667
1668struct fb
1669{
1670        int dev;
1671        char *name;
1672        int fd;
1673        unsigned char *fb;
1674        unsigned long *fblong;
1675        int width;
1676        int height;
1677        int pitch;
1678        unsigned long fixfbsize;
1679        unsigned long varfbsize;
1680        int colbytes;
1681        unsigned long data_phys;
1682        struct fb *next;
1683};
1684
1685struct rc
1686{
1687        int key;
1688        void (*rcfunc)(struct skin*, struct skin*, int screencalc, int filelistview, int flag);
1689        struct skin *screen;
1690        struct skin *screennode;
1691        struct skin *owner;
1692        struct rc *next;
1693};
1694
1695struct clist
1696{
1697        char *key;
1698        char *value;
1699        char *def;
1700        char *tmp;
1701        struct clist *next;
1702};
1703
1704struct bouquet
1705{
1706        int nr;
1707        int serviceid;
1708        uint64_t transponderid;
1709        struct channel *channel;
1710        struct bouquet *prev;
1711        struct bouquet *next;
1712};
1713
1714struct channelslot
1715{
1716        int slot;
1717        int serviceid;
1718        uint64_t transponderid;
1719        struct channelslot *next;
1720};
1721
1722struct mainbouquet
1723{
1724        char *name;
1725        int type;
1726        char *filename;
1727        struct bouquet *bouquet;
1728        struct mainbouquet *prev;
1729        struct mainbouquet *next;
1730};
1731
1732struct pic
1733{
1734        char* name;
1735        unsigned char* picbuf;
1736        // < 0 when picbuf is normal mem (hw jpg)
1737        int memfd;
1738        unsigned long width;
1739        unsigned long height;
1740        unsigned long rowbytes;
1741        int channels;
1742  int timeout;
1743  time_t lastaccess;
1744        int del;
1745        struct pic* next;
1746};
1747
1748struct font
1749{
1750        char *name;
1751        FT_Error error;
1752        FTC_Manager manager;
1753        FTC_SBitCache cache;
1754        FTC_ImageTypeRec desc;
1755        FT_Face face;
1756        FT_UInt prev_glyphindex;
1757        FT_Bool use_kerning;
1758        struct font *next;
1759};
1760
1761//structure for write fb to File
1762struct writeFBfile
1763{
1764        unsigned char* ActBuf;
1765        unsigned char* buf1;
1766        unsigned char* buf2;
1767} writeFBfile;
1768
1769struct eit
1770{
1771        u_char table_id                               /*:8*/;
1772        u_char section_length_hi                      :4;
1773        u_char                                        :3;
1774        u_char section_syntax_indicator               :1;
1775        u_char section_length_lo                      /*:8*/;
1776        u_char service_id_hi                          /*:8*/;
1777        u_char service_id_lo                          /*:8*/;
1778        u_char current_next_indicator                 :1;
1779        u_char version_number                         :5;
1780        u_char                                        :2;
1781        u_char section_number                         /*:8*/;
1782        u_char last_section_number                    /*:8*/;
1783        u_char transport_stream_id_hi                 /*:8*/;
1784        u_char transport_stream_id_lo                 /*:8*/;
1785        u_char original_network_id_hi                 /*:8*/;
1786        u_char original_network_id_lo                 /*:8*/;
1787        u_char segment_last_section_number            /*:8*/;
1788        u_char segment_last_table_id                  /*:8*/;
1789        u_char data[]; /* struct eitevent */
1790};
1791#define EITLEN sizeof(struct eit)
1792#define GETEITSECLEN(x) HILO(((struct eit*)(x))->section_length)
1793
1794struct eitevent
1795{
1796        u_char event_id_hi                            /*:8*/;
1797        u_char event_id_lo                            /*:8*/;
1798        u_char mjd_hi                                 /*:8*/;
1799        u_char mjd_lo                                 /*:8*/;
1800        u_char start_time_h                           /*:8*/;
1801        u_char start_time_m                           /*:8*/;
1802        u_char start_time_s                           /*:8*/;
1803        u_char duration_h                             /*:8*/;
1804        u_char duration_m                             /*:8*/;
1805        u_char duration_s                             /*:8*/;
1806        u_char descriptors_loop_length_hi             :4;
1807        u_char free_ca_mode                           :1;
1808        u_char running_status                         :3;
1809        u_char descriptors_loop_length_lo             /*:8*/;
1810        u_char data[];
1811};
1812#define EITEVENTLEN sizeof(struct eitevent)
1813#define GETEITDESCLEN(x) HILO(((struct eitevent *)x)->descriptors_loop_length)
1814
1815struct eitshortevent
1816{
1817        u_char descriptor_tag                         /*:8*/;
1818        u_char descriptor_length                      /*:8*/;
1819        u_char lang_code1                             /*:8*/;
1820        u_char lang_code2                             /*:8*/;
1821        u_char lang_code3                             /*:8*/;
1822        u_char event_name_length                      /*:8*/;
1823        u_char data[];
1824};
1825#define EITSHORTEVENTLEN sizeof(struct eitshortevent)
1826
1827struct eitlongevent
1828{
1829        u_char descriptor_tag                         /*:8*/;
1830        u_char descriptor_length                      /*:8*/;
1831        u_char last_descriptor_number                 :4;
1832        u_char descriptor_number                      :4;
1833        u_char lang_code1                             /*:8*/;
1834        u_char lang_code2                             /*:8*/;
1835        u_char lang_code3                             /*:8*/;
1836        u_char length_of_items                        /*:8*/;
1837        u_char data[]; /* struct eitlongeventitem */
1838};
1839#define EITLONGEVENTLEN sizeof(struct eitlongevent)
1840
1841struct eitlongeventitem
1842{
1843        u_char item_description_length               /*:8*/;
1844        u_char data[];
1845};
1846#define EITLONGEVENTITEMLEN sizeof(struct eitlongeventitem)
1847
1848struct eitlinkage
1849{
1850        u_char descriptor_tag                 /*:8*/;
1851        u_char descriptor_length              /*:8*/;
1852        u_char transport_stream_id_hi         /*:8*/;
1853        u_char transport_stream_id_lo         /*:8*/;
1854        u_char original_network_id_hi         /*:8*/;
1855        u_char original_network_id_lo         /*:8*/;
1856        u_char service_id_hi                  /*:8*/;
1857        u_char service_id_lo                  /*:8*/;
1858        u_char linkage_type                   /*:8*/;
1859};
1860#define EITLLINKAGELEN sizeof(struct eitlinkage)
1861
1862struct parentalrating
1863{
1864        u_char descriptor_tag                 /*:8*/;
1865        u_char descriptor_length              /*:8*/;
1866        u_char data[]; //struct parental_rating_item
1867};
1868#define PARENTALRATINGLEN sizeof(struct parentalrating)
1869
1870struct parentalratingitem
1871{
1872        u_char lang_code1                    /*:8*/;
1873        u_char lang_code2                    /*:8*/;
1874        u_char lang_code3                    /*:8*/;
1875        u_char rating                        /*:8*/;
1876};
1877#define PARENTALRATINGITEMLEN sizeof(struct parentalratingitem)
1878
1879struct rst //table id 0x71
1880{
1881        u_char table_id                     /*:8*/;
1882        u_char section_syntax_indicator         :1;
1883        u_char reserved_1                       :1;
1884        u_char reserved_2                       :2;
1885        u_int section_length                   :12;
1886};
1887#define RSTLEN sizeof(struct rst)
1888
1889struct rstitem
1890{
1891        u_char transponder_stream_id_hi     /*:8*/;
1892        u_char transponder_stream_id_lo     /*:8*/;
1893        u_char original_network_id_hi       /*:8*/;
1894        u_char original_network_id_lo       /*:8*/;
1895        u_char service_id_hi                /*:8*/;
1896        u_char service_id_lo                /*:8*/;
1897        u_char event_id_hi                  /*:8*/;
1898        u_char event_id_lo                  /*:8*/;
1899        u_char reserved_1                       :5;
1900        u_char running_status                   :3;
1901};
1902#define RSTITEMLEN sizeof(struct rstitem)
1903
1904struct mhwchannel
1905{
1906        u_char  network_id_hi;
1907        u_char  network_id_lo;
1908        u_char  transponder_id_hi;
1909        u_char  transponder_id_lo;
1910        u_char  channel_id_hi;
1911        u_char  channel_id_lo;
1912        u_char  name[16];
1913};
1914#define MHWCHANNELLEN sizeof(struct mhwchannel)
1915
1916struct mhwtitle
1917{
1918        u_char table_id                       :8;
1919        u_char section_length_hi              :4;
1920        u_char                                :2;
1921        u_char dummy                          :1;
1922        u_char section_syntax_indicator       :1;
1923        u_char section_length_lo              :8;
1924        u_char channel_id                     :8;
1925        u_char theme_id                       :8;
1926        u_char hours                                  :5;
1927        u_char day                            :3;
1928        u_char summary_available              :1;
1929        u_char                                      :1;
1930        u_char minutes                        :6;
1931        u_char                                :8;
1932        u_char                                :8;
1933        u_char duration_hi                    :8;
1934        u_char duration_lo                    :8;
1935        u_char title                          [23];
1936        u_char ppv_id_hi                      :8;
1937        u_char ppv_id_mh                      :8;
1938        u_char ppv_id_ml                      :8;
1939        u_char ppv_id_lo                      :8;
1940        u_char program_id_hi                  :8;
1941        u_char program_id_mh                  :8;
1942        u_char program_id_ml                  :8;
1943        u_char program_id_lo                  :8;
1944        u_char                                :8;
1945        u_char                                :8;
1946        u_char                                :8;
1947        u_char                                :8;
1948};
1949#define MHWTITLELEN sizeof(struct mhwtitle)
1950
1951struct mhwsummary
1952{
1953        u_char table_id                       :8;
1954        u_char section_length_hi              :4;
1955        u_char                                :2;
1956        u_char dummy                          :1;
1957        u_char section_syntax_indicator       :1;
1958        u_char section_length_lo              :8;
1959        u_char program_id_hi                  :8;
1960        u_char program_id_mh                  :8;
1961        u_char program_id_ml                  :8;
1962        u_char program_id_lo                  :8;
1963        u_char                                :8;
1964        u_char                                :8;
1965        u_char                                :8;
1966        u_char nb_replays                     :8;
1967};
1968#define MHWSUMMARYLEN sizeof(struct mhwsummary)
1969
1970struct mhw2channel
1971{
1972        u_char network_id_hi;
1973        u_char network_id_lo;
1974        u_char transponder_id_hi;
1975        u_char transponder_id_lo;
1976        u_char channel_id_hi;
1977        u_char channel_id_lo;
1978        u_char                                :8;
1979        u_char                                :8;
1980};
1981
1982struct extepgcache
1983{
1984        long id;
1985        struct epg* epgnode;
1986        struct extepgcache* next;
1987};
1988
1989struct extepgchannel
1990{
1991        long id;
1992        int serviceid;
1993        uint64_t transponderid;
1994        struct extepgchannel* next;
1995};
1996
1997struct extepgconfig
1998{
1999        uint64_t transponderid;
2000        int type;
2001        char* file;
2002        int channelpid;
2003        int titlepid[8];
2004        int summarypid[8];
2005        struct extepgconfig* next;
2006};
2007
2008struct blacklist
2009{
2010  char* file;
2011  struct splitstr* splitstr;
2012  int count;
2013};
2014
2015typedef struct sci_modes
2016{
2017        int emv2000;
2018        int dma;
2019        int man_act;
2020        int rw_mode;
2021} scimodes;
2022
2023typedef struct sci_parameters
2024{
2025        u_char T;
2026        unsigned long fs;
2027        unsigned long ETU;
2028        unsigned long WWT;
2029        unsigned long CWT;
2030        unsigned long BWT;
2031        unsigned long EGT;
2032        unsigned long clock_stop_polarity;
2033        u_char check;
2034        u_char P;
2035        u_char I;
2036        u_char U;
2037} sciparameters;
2038
2039struct update
2040{
2041        char* auth;
2042        char* type;
2043        char* skinname;
2044        char* filemask;
2045        char* filepath;
2046        int imgtype;
2047};
2048
2049struct musicdat
2050{
2051        char* dummy;
2052        char* thumb;
2053        char* title;
2054        char* album;
2055        char* realname;
2056        char* actors;
2057        char* genre;
2058        char* year;
2059        int   act;
2060} musicdat;
2061
2062#ifdef EPLAYER4
2063typedef enum { stUnknown, stPlainText, stSSA, stASS, stSRT, stVOB, stPGS } subtype_t;
2064typedef enum {atUnknown, atMPEG, atMP3, atAC3, atDTS, atAAC, atPCM, atOGG, atFLAC, atWMA} audiotype_t;
2065typedef struct _CustomData {
2066//typedef struct CustomData {
2067  GstElement *playbin2;   /* Our one and only element */
2068   
2069  gint n_video;          /* Number of embedded video streams */
2070  gint n_audio;          /* Number of embedded audio streams */
2071  gint n_text;           /* Number of embedded subtitle streams */
2072   
2073  gint current_video;    /* Currently playing video stream */
2074  gint current_audio;    /* Currently playing audio stream */
2075  gint current_text;     /* Currently playing subtitle stream */
2076
2077  gboolean is_live;
2078  GstElement *pipeline;
2079  GMainLoop *loop;
2080} CustomData;
2081
2082typedef enum {
2083        GST_PLAY_FLAG_VIDEO = (1 << 0),
2084        GST_PLAY_FLAG_AUDIO = (1 << 1),
2085        GST_PLAY_FLAG_TEXT = (1 << 2),
2086        GST_PLAY_FLAG_NATIVE_VIDEO = (1 << 3)
2087} GstPlayFlags;
2088#endif
2089
2090#ifdef MIPSEL
2091//fuer cec Mipsel
2092
2093#ifdef DREAMBOX
2094struct cec_message
2095{
2096        unsigned char address;
2097        unsigned char data[16];
2098        unsigned char length;
2099        unsigned char flag;
2100}__attribute__((packed));
2101struct cec_rx_message
2102{
2103        unsigned char address;
2104        unsigned char destination;
2105        unsigned char data[16];
2106        unsigned char length;
2107}__attribute__((packed));
2108
2109
2110#else
2111struct cec_message
2112{
2113unsigned char address;
2114unsigned char length;
2115unsigned char data[256];
2116}__attribute__((packed));
2117struct cec_rx_message
2118{
2119        unsigned char address;
2120        unsigned char destination;
2121        unsigned char data[16];
2122        unsigned char length;
2123}__attribute__((packed));
2124#endif
2125
2126unsigned char cec_physicalAddress[2];
2127unsigned char cec_logicalAddress;
2128unsigned char cec_deviceType;
2129
2130#endif
2131
2132// cacc
2133/* CI+ certificates */
2134
2135struct cert_ctx {
2136        X509_STORE *store;
2137
2138        /* Host */
2139        X509 *cust_cert;
2140        X509 *device_cert;
2141
2142        /* Module */
2143        X509 *ci_cust_cert;
2144        X509 *ci_device_cert;
2145};
2146
2147#ifdef MIPSEL
2148enum ca_descr_data_type {
2149        CA_DATA_IV,
2150        CA_DATA_KEY,
2151};
2152
2153enum ca_descr_parity {
2154        CA_PARITY_EVEN,
2155        CA_PARITY_ODD,
2156};
2157
2158struct ca_descr_data {
2159        unsigned int index;
2160        enum ca_descr_parity parity;
2161        enum ca_descr_data_type data_type;
2162        unsigned int length;
2163        unsigned char *data;
2164};
2165
2166#endif
2167
2168#ifdef SH4NEW
2169enum ca_descr_data_type {
2170        CA_DATA_IV,
2171        CA_DATA_KEY,
2172};
2173
2174enum ca_descr_parity {
2175        CA_PARITY_EVEN,
2176        CA_PARITY_ODD,
2177};
2178
2179struct ca_descr_data {
2180        unsigned int index;
2181        enum ca_descr_parity parity;
2182        enum ca_descr_data_type data_type;
2183        unsigned int length;
2184        unsigned char *data;
2185};
2186
2187#endif
2188
2189struct aes_xcbc_mac_ctx {
2190        uint8_t K[3][16];
2191        uint8_t IV[16];
2192        AES_KEY key;
2193        int buflen;
2194};
2195
2196uint32_t datatype_sizes[MAX_ELEMENTS] = {
2197        0, 50, 0, 0, 0, 8, 8, 0,
2198        0, 0, 0, 0, 32, 256, 256, 0,
2199        0, 256, 256, 32, 8, 8, 32, 32,
2200        0, 8, 2, 32, 1, 32, 1, 0,
2201        32
2202};
2203
2204struct element {
2205        uint8_t *data;
2206        uint32_t size;
2207        /* buffer valid */
2208        int valid;
2209};
2210
2211struct cc_ctrl_data {
2212        /* parent */
2213        struct caslot* slot;
2214
2215        /* ci+ credentials */
2216        struct element elements[MAX_ELEMENTS];
2217
2218        /* DHSK */
2219        uint8_t dhsk[256];
2220
2221        /* KS_host */
2222        uint8_t ks_host[32];
2223
2224        /* derived keys */
2225        uint8_t sek[16];
2226        uint8_t sak[16];
2227
2228        /* AKH checks - module performs 5 tries to get correct AKH */
2229        unsigned int akh_index;
2230
2231        /* authentication data */
2232        uint8_t dh_exp[256];
2233
2234        /* certificates */
2235        struct cert_ctx *cert_ctx;
2236
2237        /* private key of device-cert */
2238        RSA *rsa_device_key;
2239};
2240
2241#endif
Note: See TracBrowser for help on using the repository browser.