source: titan/titan/struct.h @ 42970

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

update

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