source: titan/titan/struct.h @ 40595

Last change on this file since 40595 was 40595, checked in by gost, 7 years ago

[titan] mipsel fix cacc

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