source: titan/titan/struct.h @ 39797

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

[titan] long press pip shows record channel

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