source: titan/titan/struct.h @ 39693

Last change on this file since 39693 was 39693, checked in by obi, 7 years ago

enable exteplayer3

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