source: titan/titan/struct.h @ 43450

Last change on this file since 43450 was 43367, checked in by obi, 5 years ago

test

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