source: titan/titan/struct.h @ 38490

Last change on this file since 38490 was 38153, checked in by obi, 8 years ago

[mipsel] add gst191 pre buffer work

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