source: titan/titan/struct.h @ 15297

Last change on this file since 15297 was 15282, checked in by nit, 12 years ago

fix

File size: 28.0 KB
Line 
1#ifndef STRUCT_H
2#define STRUCT_H
3
4#define _GNU_SOURCE
5
6#ifdef SIMULATE
7#include <mcheck.h>
8#endif
9
10#include <stdio.h>
11#include <stdlib.h>
12#include <stdint.h>
13#include <string.h>
14#include <libgen.h>
15#include <fcntl.h>
16#include <ctype.h>
17#include <linux/fb.h>
18#include <sys/ioctl.h>
19#include <sys/mman.h>
20#include <png.h>
21#include <jpeglib.h>
22#include <libintl.h>
23#include <locale.h>
24#include <math.h>
25#include <linux/input.h>
26#include <sys/wait.h>
27#include <time.h>
28#include <dirent.h>
29#include <fnmatch.h>
30#include <dlfcn.h>
31#include <pthread.h>
32#include <linux/dvb/frontend.h>
33#include <linux/dvb/dmx.h>
34#include <linux/dvb/audio.h>
35#include <linux/dvb/video.h>
36#include <sys/vfs.h>
37#include <inttypes.h>
38#include <sys/socket.h>
39#include <sys/un.h>
40#include <unistd.h>
41#include <zlib.h>
42#include <net/if.h>
43#include <netinet/in.h>
44#include <arpa/inet.h>
45#include <netdb.h>
46#include <errno.h>
47#include <linux/dvb/version.h>
48#include <setjmp.h>
49#include <sys/mount.h>
50#include <execinfo.h>
51#include <ifaddrs.h>
52#include <linux/dvb/ca.h>
53#include <poll.h>
54#include <sys/utsname.h>
55
56#define IPKG_LIB
57#include "libipkg/config.h"
58#include "libipkg/libipkg.h"
59#include "libipkg/args.h"
60#include "libipkg/ipkg_cmd.h"
61
62//for freetype
63#include <ft2build.h>
64#include FT_FREETYPE_H
65#include FT_CACHE_H
66
67//for eplayer
68#ifdef EPLAYER3
69#include <common.h>
70#include <subtitle.h>
71#endif
72
73#ifdef EPLAYER4
74#include <gst/gst.h>
75#include <gst/pbutils/missing-plugins.h>
76#endif
77
78#ifdef DVDPLAYER
79#include <ddvdlib.h>
80#endif
81
82#define OVERSION "1.12"
83#define PROGNAME "titan"
84#define COPYRIGHT "NIT"
85#define CRONTRIBUT "obi, black, dvboxer, oxygen, gost"
86
87#define _(x) gettext(x)
88#define MINMALLOC 4096
89#define SCROLLBARWIDTH 15
90#define SCROLLBARBORDERSIZE 1
91#define FONTPOSYOFFSET -3
92#define FB "fb0"
93#define FB1 "fb1"
94#define SKINFB "skinfb"
95#define ACCELFB "accelfb"
96#define CONFIGFILE PROGNAME".cfg"
97#define KILLPROG "killall -9 "PROGNAME
98#define REBOOT "init 6"
99#define FILELISTDELMARK 255
100#define PLUGINDELMARK 254
101#define MAXDVBADAPTER 2
102#define MAXFRONTENDDEV 4
103#define MAXDEMUXDEV 4
104#define MAXDEMUXDEVOPEN 10
105#define MAXAUDIODEV 4
106#define MAXVIDEODEV 4
107#define MAXCIDEV 4
108#define MAXCADEV 4
109#define MAXDVRDEV 4
110#define RCTIMEOUT 999999
111#define RCTHREADSTANDBY 999998
112#define MAXSERVICETYPE 10
113#define CHANNELCACHEMAX 1000
114#define TRANSPONDERCACHEMAX 500
115#define MAXHTTPDCONN 20
116#define MAXHTMLLINE 300
117#define MAXRGUIDCONN 1
118#define LISTHASHSIZE 27
119#define MAXCASESSION 16
120#define MAXCASERVICE 20
121#define MAXLONGKEY 10
122#define MAXSAT 64
123#define EPGSCANLOG "/tmp/epgscan.log"
124#define MAXCHANNELHISTORY 6
125
126#define HTTPAUTH "aXBrLUdaRmg6RkhaVkJHaG56ZnZFaEZERlRHenVpZjU2NzZ6aGpHVFVHQk5Iam0="
127
128//CA Defines
129#define T_SB 0x80               //sb (h<--m)
130#define T_RCV 0x81              //receive (h-->m)
131#define T_CREATE_T_C 0x82       //create transport connection (h-->m)
132#define T_C_T_C_REPLY 0x83      //ctc reply (h<--m)
133#define T_DELETE_T_C 0x84       //delete tc (h<->m)
134#define T_D_T_C_REPLY 0x85      //dtc reply (h<->m)
135#define T_REQUEST_T_C 0x86      //request transport connection (h<--m)
136#define T_NEW_T_C 0x87          //new tc - reply to t_request (h-->m)
137#define T_T_C_ERROR 0x77        //error creating tc (h-->m)
138#define T_DATA_LAST 0xA0        //convey data from higher (h<->m)
139#define T_DATA_MORE 0xA1        //convey data from higher (h<->m)
140
141// VFD icons supported (more or less) on all boxes:
142typedef 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;
143
144#define OMIN(a,b) (a < b ? a : b)
145#define OMAX(a,b) (a > b ? a : b)
146
147#define bcdtoint(i) ((((i & 0xf0) >> 4) * 10) + (i & 0x0f))
148
149#define alpha_composite(composite, fg, alpha, bg) { \
150unsigned short temp = ((unsigned short)(fg)*(unsigned short)(alpha) +   \
151(unsigned short)(bg)*(unsigned short)(255 - (unsigned short)(alpha)) +  \
152(unsigned short)128);  \
153(composite) = (unsigned char)((temp + (temp >> 8)) >> 8); }
154
155enum {LEFT=20000, CENTER, RIGHT, TEXTCENTER, TEXTRIGHT};
156enum {TOP=20000, MIDDLE, BOTTOM, TEXTMIDDLE, TEXTBOTTOM};
157enum {BOTTOMLEFT, BOTTOMRIGHT, TOPLEFT, TOPRIGHT};
158enum {LEFTRIGHT=1, TOPBOTTOM, LEFTMIDDLE, TOPMIDDLE};
159enum {NO, YES, AUTONO, AUTOYES};
160enum {UNDEF=0, LISTBOX=1, TEXTBOX=2, CHOICEBOX=4, INPUTBOX=8, INPUTBOXNUM=16, FILELIST=32, PROGRESSBAR=64, MENU=128, MULTIPROGRESSBAR=256, GRID=512, GRIDBR=1024};
161enum {FRONTENDDEV, DEMUXDEV, VIDEODEV, AUDIODEV, CADEV, CIDEV, FRONTENDDEVDUMMY, DVRDEV};
162enum {TV, RADIO};
163enum {RECDIRECT, RECTIMER, RECTIMESHIFT, RECSTREAM, RECPLAY};
164enum {AC3 = 0, MPEGA = 1, DTS = 2, LPCM = 6, AAC = 8, AACHE = 9};
165enum {MPEGV = 0, MPEG4V = 4, H264 = 1, VC1 = 10};
166enum {ALLCHANNEL, SATCHANNEL, PROVIDERCHANNEL, AZCHANNEL, BOUQUETCHANNEL, SATLIST, PROVIDERLIST, AZLIST, MAINBOUQUETLIST};
167enum {NOMODE, MVMODE, RMMODE, CPMODE, PROTECTMODE, EDITMODE};
168enum {NOTHING, CHANNEL, STILLPIC, RECORDDIRECT, RECORDTIMER, RECORDTIMESHIFT, RECORDSTREAM, TMPOTHER, RECORDPLAY};
169enum {START, PAUSE, STOP};
170enum {DEACTIVE, ACTIVE, INPAUSE, ERROR};
171enum {FUNCTEXT, FUNCPIC, FUNCPROGRESS};
172enum {CASESSIONCREATE, CASESSIONBUSY, CASESSIONDEL, CASESSIONSTART, CASESSIONFINAL, CARESFIRSTENQUIRY, CARESCHANGE, CARESENQUIRY, CADATETIMESEND, CAMMIIDLE, CAMMIDISPLAYREPLAY, CAMMIFAKEOK};
173
174struct menulist
175{
176        char* name;
177        char* text;
178        char* pic;
179        char* param;
180        char* param1;
181        int deaktiv;
182        int defaultentry;
183        struct menulist* next;
184};
185
186struct channelhistory
187{
188        struct channel* chnode;
189        char* channellist;
190};
191
192struct queue
193{
194        //0-99 for ca module
195        //101 for thumb thread
196        int type;
197        int flag;
198        int len;
199        void* data;
200        void* data1;
201        struct queue* prev;
202        struct queue* next;
203};
204
205struct casession
206{
207        int inuse;
208        int sessionnr;
209        int action;
210        int state;
211        int mmimanager;
212        int camanager;
213        int datetimemanager;
214        int appmanager;
215        int resmanager;
216        char* mmititle;
217        char* mmisubtitle;
218        char* mmitext;
219        char* mmibottom;
220};
221
222struct caslot
223{
224        struct casession casession[MAXCASESSION];
225        int connid;
226        int poll;
227        int status;
228        int rlen;
229        unsigned char* rbuf;
230        char* name;
231        int fastrun;
232        char* caids;
233};
234
235struct hdd
236{
237        char* device;
238        int partition;
239        unsigned long size;
240        char* filesystem;
241        char* label;
242        char* uuid;
243        char* vendor;
244        char* model;
245        int removable;
246        int read;
247        int write;
248        int sleeptime;
249        int notchanged;
250        struct hdd* prev;
251        struct hdd* next;
252};
253
254struct scaninfo
255{
256        struct dvbdev* fenode;
257        struct transponder* tpnode;
258        struct skin* scanscreen;
259        struct skin* listbox;
260        int threadend;
261        int scantype;
262        int fetype;
263        int orbitalpos;
264        int timeout;
265        int onlyfree;
266        int networkscan;
267        int clear;
268        int blindscan;
269        char* satname;
270        int tpcount;
271        int tpmax;
272        int tvcount;
273        int newtvcount;
274        int radiocount;
275        int newradiocount;
276        int datacount;
277        int newdatacount;
278        int blindcount;
279        int newblindcount;
280        int blindmax;
281} scaninfo;
282
283struct screensaver
284{
285        int type;
286        int speed;
287        int newposx;
288        int newposy;
289        int flag;
290        struct skin* screen;
291        struct skin* screennode;
292        struct skin* filelist;
293        struct skin* aktnode;
294        struct pic* pic;
295        char* value;
296        char* path;
297};
298
299struct playlist
300{
301        char* file;
302        struct playlist* prev;
303        struct playlist* next;
304};
305
306struct mainplaylist
307{
308        char* name;
309        char* filename;
310        struct playlist* playlist;
311        struct mainplaylist* prev;
312        struct mainplaylist* next;
313};
314
315struct epgrecord
316{
317        time_t begin;
318        time_t end;
319        int posx;
320        int size;
321        struct epgrecord* prev;
322        struct epgrecord* next;
323};
324
325struct download
326{
327        char* host;
328        char* page;
329        int port;
330        char* filename;
331        char* auth;
332        int connfd;
333        int proz;
334        unsigned int maxkb;
335        unsigned int aktkb;
336        int ret;
337};
338
339struct epgscanlist
340{
341        int serviceid;
342        unsigned long transponderid;
343        time_t scantime;
344        struct epgscanlist* prev;
345        struct epgscanlist* next;
346};
347
348struct rgba
349{
350        char r;
351        char g;
352        char b;
353        char a;
354};
355
356struct subclutentry
357{
358        unsigned char Y, Cr, Cb, T;
359        unsigned char valid;
360};
361
362struct subclut
363{
364        unsigned char clutid;
365        unsigned char clutversionnumber;
366        struct subclutentry entries2bit[4];
367        struct subclutentry entries4bit[16];
368        struct subclutentry entries8bit[256];
369        struct subclut *next;
370};
371
372struct subpagereg
373{
374        int regid;
375        int reghorizontaladdress;
376        int regverticaladdress;
377        int scaleposx, scaleposy;
378        struct subpagereg *next;
379};
380
381struct subregobj
382{
383        int objid;
384        int objtype;
385        int objproviderflag;
386        int objhorizontalpos;
387        int objverticalpos;
388        // not supported right now...
389        int foregroundpixel;
390        int backgroundpixel;
391        struct subregobj *next;
392};
393
394struct subreg
395{
396        int regid;
397        int versionnumber;
398        int height, width;
399        int scaleheight, scalewidth;
400        int depth;
401        unsigned char *buf;
402        struct rgba *palette;
403        int clutid;
404        int committed;
405        struct subregobj *objects;
406        struct subreg *next;
407};
408
409struct subpage
410{
411        int pageid;
412        time_t pagetimeout;
413        int pageversionnumber;
414        int state;
415        int pcssize;
416        struct subpagereg *pageregions;
417        struct subreg *regions;
418        struct subclut *cluts;
419        struct subpage *next;
420};
421
422struct bitstream
423{
424        unsigned char *data;
425        int size;
426        int avail;
427        int consumed;
428};
429
430//there are a copyrectimer function
431//if you change the struct you must change this funktion
432struct rectimer
433{
434        char* name;
435        char* timestamp;
436        time_t begin;
437        time_t end;
438        int repeate;
439        int afterevent;
440        char* pincode;
441        int disabled;
442        int justplay;
443        char* recpath;
444        int servicetype;
445        char* channellist;
446        int serviceid;
447        //0 = nothing
448        //1 = running
449        //2 = end
450        //3 = error
451        int status;
452        char* errstr;
453        struct service* servicenode;
454        unsigned long transponderid;
455        struct rectimer *prev;
456        struct rectimer *next;
457};
458
459struct inetwork
460{
461        char* device;
462        char* ip;
463        char* netmask;
464        char* mac;
465        char* broadcast;
466        int dhcp;
467        int found;
468        //flag 1 = used in titan
469        int flag;
470        struct inetwork *prev;
471        struct inetwork *next;
472};
473
474struct rcmap
475{
476        char* name;
477        int key;
478        int newkey;
479        struct rcmap* next;
480};
481
482struct splitstr
483{
484        char* part;
485};
486
487struct channelcache
488{
489        int serviceid;
490        unsigned long transponderid;
491        struct channel* chnode;
492        struct channelcache* next;
493};
494
495struct transpondercache
496{
497        unsigned long transponderid;
498        struct transponder* tpnode;
499        struct transpondercache* next;
500};
501
502struct filelist
503{
504        int type;
505        char* name;
506        char* shortname;
507        char* path;
508        char* imdbpath;
509        off64_t size;
510        time_t date;
511};
512
513struct skin
514{
515        char* name;
516        unsigned int type;
517        uint8_t wrap;
518        uint8_t bordersize;
519        uint8_t scrollbar;
520        uint16_t halign;
521        uint16_t valign;
522        int16_t posx;
523        int16_t posy;
524        int16_t width;
525        int16_t height;
526        long bordercol;
527        long deaktivcol;
528        long shadowcol;
529        uint8_t shadowsize;
530        uint8_t shadowpos;
531        uint8_t fontsize;
532        uint8_t fontsize2;
533        long fontcol;
534        long fontcol2;
535        char* font;
536        int16_t zorder;
537        int16_t titlealign;
538        char* title;
539        char* text;
540        char* text2;
541        long bgcol;
542        long bgcol2;
543        long titlebgcol;
544        long titlebgcol2;
545        long progresscol;
546        char* selectpic;
547        char* pic;
548        int16_t picwidth;
549        int16_t picheight;
550        uint16_t hspace;
551        uint16_t vspace;
552        char* (*skinfunc)(struct skin*, void*, void*);
553        char* param1;
554        char* param2;
555        char* parent;
556        char* input;
557        char* mask;
558        uint16_t textposx;
559        uint16_t textposx2;
560        int16_t gradient;
561        int16_t titlegradient;
562        uint8_t transparent;
563        uint8_t hidden;
564        uint8_t funcrettype;
565        int8_t charspace;
566        int8_t bordertype;
567        int16_t borderradius;
568        uint16_t bgspace;
569
570        uint8_t titlesize;
571        struct filelist* filelist;
572        struct skin* parentpointer;
573        char* ret;
574        char* choiceboxvalue;
575        unsigned int linecount;
576        unsigned int pagecount;
577        unsigned int poscount;
578        unsigned int gridcol;
579        int aktpage;
580        int aktline;
581        uint8_t scrollbarbordersize;
582        uint8_t prozposx;
583        uint8_t prozposy;
584        uint8_t prozwidth;
585        uint8_t prozheight;
586        uint8_t picprozwidth;
587        uint8_t del;
588        uint8_t picprozheight;
589        int16_t scrollbarheight;
590        int16_t progresssize;
591        int16_t scrollbarwidth;
592        int16_t scrollbarpos;
593        int16_t rposx;
594        int16_t rposy;
595        int16_t rwidth;
596        int16_t rheight;
597        int16_t rpicwidth;
598        int16_t rpicheight;
599        int16_t iposx;
600        int16_t iposy;
601        int16_t iwidth;
602        int16_t iheight;
603        char* handle;
604        char* handle1;
605        struct epgrecord* epgrecord;
606        char* pluginhandle;
607        uint8_t locked;
608        //bit 0: 1 = node is drawed
609        uint8_t flag;
610        struct skin *select;
611        struct skin *child;
612        struct skin *prev;
613        struct skin *next;
614};
615
616struct epg
617{
618        int eventid;
619        int version;
620        time_t starttime;
621        time_t endtime;
622        char* title;
623        char* subtitle;
624        char* desc;
625        int desclen;
626        int desccomplen;
627        int parentalrating;
628        struct epg* prev;
629        struct epg* next;
630};
631
632struct shutdowntimer
633{
634        int active,type; //type: 0=DeepStandby, 1=Standby
635        long long shutdown_time;
636};
637
638struct dvbdev
639{
640        char* dev;
641        int fd;
642        uint8_t type;
643        uint8_t adapter;
644        uint8_t devnr;
645        uint8_t felock;
646        struct transponder* felasttransponder;
647        struct transponder* feakttransponder;
648        int feunicable;
649        unsigned int feloffrequency;
650        int feaktband;
651        int feaktpolarization;
652        fe_sec_voltage_t feaktvolt;
653        fe_sec_tone_mode_t feakttone;
654        int fedmxsource;
655        char* feaktnr;
656        char* feshortname;
657        struct dvb_frontend_info* feinfo;
658        struct caslot* caslot;
659        struct dvbdev *next;
660};
661
662//there are a copytransponder and createtransponder function
663//if you change this struct you must change the function
664struct transponder
665{
666        unsigned long id;
667        uint8_t fetype;
668        uint8_t polarization;
669        uint8_t modulation;
670        uint8_t fec;
671        uint8_t pilot;
672        uint8_t rolloff;
673        uint8_t inversion;
674        uint8_t system;
675        uint8_t flag;
676        // 0 = unknown
677        // 1 = tunable
678        // 2 = not tunable
679        uint8_t tunablestatus;
680        int orbitalpos;
681        unsigned int frequency;
682        unsigned int symbolrate;
683        int encoding;
684        struct transponder *next;
685};
686
687struct provider
688{
689        int providerid;
690        char* name;
691        int flag;
692        struct provider *prev;
693        struct provider *next;
694};
695
696struct subtitle
697{
698        char* name;
699        int16_t pid;
700        int16_t type;
701        int16_t id1;
702        int16_t id2;
703        struct subtitle* next;
704};
705
706struct esinfo
707{
708        int streamtype;
709        int pid;
710        struct esinfo* next;
711};
712
713struct cadesc
714{
715        int len;
716        int systemid;
717        int reserved;
718        int pid;
719        char* privat;
720        struct cadesc* next;
721};
722
723struct pmt
724{
725        int programnumber;
726        int versionnumber;
727        int currentnextindicator;
728};
729
730struct audiotrack
731{
732        char* name;
733        uint8_t audiocodec;
734        int16_t audiopid;
735        struct audiotrack* next;
736};
737
738struct linkedchannel
739{
740        unsigned long transponderid;
741        int serviceid;
742        struct linkedchannel* next;
743};
744
745//there are a createchannel function
746//if you change this struct you must change the function
747struct channel
748{
749        char* name;
750        unsigned long transponderid;
751        int providerid;
752        int serviceid;
753        int servicetype;
754        uint8_t flag;
755        uint8_t crypt;
756        int8_t videocodec;
757        int8_t audiocodec;
758        int16_t videopid;
759        int16_t audiopid;
760        int16_t ac3audiopid;
761        int16_t txtpid;
762        int16_t pcrpid;
763        int16_t pmtpid;
764        uint8_t protect;
765        struct transponder *transponder;
766        struct provider *provider;
767        struct audiotrack *audiotrack;
768        struct subtitle *subtitle;
769        struct linkedchannel *linkedchannel;
770        struct pmt *pmt;
771        struct cadesc *cadesc;
772        struct esinfo *esinfo;
773        struct epg *epg;
774        struct channel *prev;
775        struct channel *next;
776};
777
778struct sat
779{
780        char* name;
781        int orbitalpos;
782        int flag;
783        int fetype;
784        int scan;
785        struct sat *prev;
786        struct sat *next;
787};
788
789struct service
790{
791        int type;
792        char* channellist;
793        struct dvbdev *fedev;
794        struct dvbdev *dmxaudiodev;
795        struct dvbdev *dmxvideodev;
796        struct dvbdev *dmxpcrdev;
797        struct dvbdev *dmxsubtitledev;
798        struct dvbdev *audiodev;
799        struct dvbdev *videodev;
800        struct transponder *transponder;
801        struct channel *channel;
802        unsigned char *pmtbuf;
803        int pmtlen;
804        int recdmxstart;
805        int recdstfd;
806        int recsrcfd;
807        time_t recendtime;
808        size_t reclastsync;
809        off64_t rectotal;
810        int reccount;
811        int tssize;
812        char* recname;
813        struct service *next;
814};
815
816struct caservice
817{
818        struct service* service;
819        struct channel* channel;
820        int count;
821        int camsockfd;
822        struct caslot* caslot;
823        int camanager;
824};
825
826struct stimerthread
827{
828        int delay;
829        int count;
830        int notfirst;
831        pthread_attr_t attr;
832        pthread_t thread;
833        int status;
834        int aktion;
835        //bit 0: 1 = stop allwas on titan end
836        int flag;
837        void* param1;
838        void* param2;
839        void* (*func)(struct stimerthread*, void*, void*);
840        struct stimerthread* next;
841};
842
843struct hddparm
844{
845        char* device;
846        int read;
847        int write;
848        int sleeptime;
849        int notchanged;
850};
851
852struct status
853{
854        int longkeycode[MAXLONGKEY];
855        //aktivate extra featers
856        int expertmodus;
857        //http user:passwd
858        char* httpauth;
859        //set to 1 if channellist or channelnr open
860        int channelswitch;
861        //deaktivates child protect if greater then akttime
862        time_t protecttime;
863        char* boxtype;
864        pthread_t mainthread;
865        //videosize from stream
866        video_size_t videosize;
867        time_t videosizevalid;
868        //radius for rounded border
869        int borderradius;
870        int picbordersize;
871        int titlelinesize;
872        //0 border
873        //1 fullbar
874        int listboxselecttype;
875        //0 camd.socket
876        //1 pmt.tmp
877        int pmtmode;
878        //timer for del old epg entrys
879        time_t deloldepg;
880        //0 dektiv
881        //1 only scan
882        //2 only whitlist
883        //3 scan and whitelist
884        int epglistmode;
885        // 1 manual
886        // 2 from standby
887        int startmode;
888        jmp_buf longjumpbuf;
889        pthread_mutex_t drawingmutex;
890        pthread_mutex_t rectimermutex;
891        pthread_mutex_t servicemutex;
892        pthread_mutex_t epgmutex;
893        pthread_mutex_t channelmutex;
894        pthread_mutex_t timerthreadmutex;
895        pthread_mutex_t audiotrackmutex;
896        pthread_mutex_t subtitlemutex;
897        pthread_mutex_t linkedchannelmutex;
898        pthread_mutex_t dmxdevmutex;
899        pthread_mutex_t rcmutex;
900        pthread_mutex_t queuemutex;
901        pthread_mutex_t clistmutex;
902        pthread_mutex_t hddmutex;
903        pthread_mutex_t tsseekmutex;
904        pthread_mutex_t accelfbmutex;
905        // mutex for VFD handling
906        pthread_mutex_t vfdmutex;
907        off64_t recsplitsize;
908        char* gateway;
909        char* dnsserver1;
910        char* dnsserver2;
911        int fasttextrender;
912        // 1 release all menus
913        int menurelease;
914        int play;
915        int pause;
916        int playspeed;
917        int random;
918        int repeat;
919        int epgdays;
920        int spinnertime;
921        int spinnerspeed;
922        int hangtime;
923        int timeupdatecount;
924        int markmodus;
925        // 1 from main prog
926        // 2 from a thread
927        int standby;
928        char* tmp;
929        // rc filedescriptor
930        int fdrc;
931        // rc filedescriptor for simulating keypress (fifo)
932        int fdrcsim;
933        int writeconfig;
934        int writeownconfig;
935        int writercconfig;
936        int writeskinconfig;
937        int writechannel;
938        int writetransponder;
939        int writeprovider;
940        int writemainbouquet;
941        int writebouquet;
942        int writemainplaylist;
943        int writeplaylist;
944        int writesat;
945        int writerectimer;
946        int writeepgscanlist;
947        // 1 mute is aktiv
948        int mute;
949        // 1 spinner is aktiv
950        int spinner;
951        // 1 infobar is aktiv
952        // 2 infobar is aktiv (with wait befor show)
953        // 3 infobar is aktiv (no autohide)
954        int infobar;
955        // with infobar to display
956        int infobarnr;
957        // 0 is for mute screen
958        struct skin *drawallways[1];
959        char* drawallwaysbg[1];
960        int usedirectfb;
961        // count how long last rcwait (shows spinner if to long)
962        time_t sec;
963        // if set to a value != 0, rcwait returns this number
964        int rckey;
965        struct skin* skinerr;
966        // 0 calc and draw
967        // 1 calc only without hidden nodes
968        // 2 calc only with hidden nodes
969        int screencalc;
970        // 0 deaktiv
971        // 1 struct filelist filled
972        // 2 struct filelist and show filesize
973        // 3 struct filelist and show filedate
974        int filelistextend;
975        pthread_attr_t timerthreadattr;
976        pthread_t timerthread;
977        int timerthreadstatus;
978        int timerthreadaktion;
979        pthread_attr_t subthreadattr;
980        pthread_t subthread;
981        int subthreadstatus;
982        int subthreadaktion;
983        int subthreadpid;
984        // epg thread pointer
985        struct stimerthread* epgthread;
986        // epgscanlist thread pointer
987        struct stimerthread* epgscanlistthread;
988        // httpd thread pointer
989        struct stimerthread* httpthread;
990        // rguid thread pointer
991        struct stimerthread* rguithread;
992        // rguid sock filedescriptor for rguid
993        int rguidfd;
994        struct service* aktservice;
995        struct service* lastservice;
996        struct channel* markedchannel;
997        //if we are in a epg screen, this is the showen channel
998        struct channel* epgchannel;
999        char* configfile;
1000        // for bouquet channel numbering
1001        int bouquetnr[MAXSERVICETYPE];
1002        int servicetype;
1003        struct shutdowntimer *sd_timer;
1004        // akt pos in channel cache
1005        int channelcachepos;
1006        // aktivate/deaktivate auto updatevfd
1007        int updatevfd;
1008        // count for recording
1009        int recording;
1010        // count for streaming
1011        int streaming;
1012        // timeshift running = 1
1013        int timeshift;
1014        // ts playing running = 1
1015        int playing;
1016        // timeshift seeking <> 0
1017        int timeshiftseek;
1018        // if set to a skin (screenpointer) only this screen has rc
1019        struct skin* rcowner;
1020        // timerstuktur fuer autores
1021        struct stimerthread* restimer;
1022        // spindown USB/HDD
1023        struct hddparm hdd[3];
1024        struct stimerthread* addhddall;
1025        // save old rotor position
1026        int rotoroldorbitalpos;
1027        // security check
1028        int security;
1029        // set to 1 if tvpic size is changed
1030        int tvpic;
1031        // timestamp for rc action
1032        time_t lastrcaction;
1033        // show timeline in channellist for each channel
1034        int showchanneltimeline;
1035        // see player.h for details
1036        int playercan;
1037                //Code von infobar.h aktiv = 1
1038        int infobaraktiv;
1039        //Name der Datei die abgespielt wird
1040        char* playfile;
1041        //Code MC aktiv = 1
1042        int mcaktiv;
1043        //greater 0 aktivate screen animation
1044        int screenanim;
1045        int screenanimspeed;
1046        //for auto increase audio vol
1047        int volautochange;
1048        int volautochangevalue;
1049        //for powerofftimer
1050        time_t fixpowerofftime;
1051        //for write FB in File
1052        int write_png;
1053        int write_jpg;
1054        //holds oversize value for blitter
1055        int leftoffset;
1056        int rightoffset;
1057        int topoffset;
1058        int bottomoffset;
1059        //background picture for all screens
1060        char* bgpic;
1061        //should thumb thread start
1062        int createthumb;
1063} status;
1064
1065struct fb
1066{
1067        int dev;
1068        char *name;
1069        int fd;
1070        unsigned char *fb;
1071        unsigned long *fblong;
1072        int width;
1073        int height;
1074        int pitch;
1075        unsigned long fixfbsize;
1076        unsigned long varfbsize;
1077        int colbytes;
1078        struct fb *next;
1079};
1080
1081struct rc
1082{
1083        int key;
1084        void (*rcfunc)(struct skin*, struct skin*, int flag);
1085        struct skin *screen;
1086        struct skin *screennode;
1087        struct skin *owner;
1088        struct rc *next;
1089};
1090
1091struct clist
1092{
1093        char *key;
1094        char *value;
1095        char *def;
1096        char *tmp;
1097        struct clist *next;
1098};
1099
1100struct bouquet
1101{
1102        int nr;
1103        int serviceid;
1104        unsigned long transponderid;
1105        struct channel *channel;
1106        struct bouquet *prev;
1107        struct bouquet *next;
1108};
1109
1110struct mainbouquet
1111{
1112        char *name;
1113        int type;
1114        char *filename;
1115        struct bouquet *bouquet;
1116        struct mainbouquet *prev;
1117        struct mainbouquet *next;
1118};
1119
1120struct pic
1121{
1122        char* name;
1123        unsigned char* picbuf;
1124        // < 0 when picbuf is normal mem (hw jpg)
1125        int memfd;
1126        unsigned long width;
1127        unsigned long height;
1128        unsigned long rowbytes;
1129        int channels;
1130        int del;
1131        struct pic* next;
1132};
1133
1134struct font
1135{
1136        char *name;
1137        FT_Error error;
1138        FTC_Manager manager;
1139        FTC_SBitCache cache;
1140        FTC_ImageTypeRec desc;
1141        FT_Face face;
1142        FT_UInt prev_glyphindex;
1143        FT_Bool use_kerning;
1144        struct font *next;
1145};
1146
1147//structure for write fb to File
1148struct writeFBfile
1149{
1150        unsigned char* ActBuf;
1151        unsigned char* buf1;
1152        unsigned char* buf2;
1153} writeFBfile;
1154       
1155       
1156#define HILO(x) (x##_hi << 8 | x##_lo)
1157
1158/*
1159#define HILO2(x) (x##1 << 8 | x##2)
1160#define HILO3(x) (x##1 << 16 | x##2 << 8 | x##3)
1161#define HILO4(x) (x##4 << 24 | x##2 << 16 | x##3 << 8 | x##4)
1162
1163#define MjdToEpochTime(x) ((HILO(x)-40587)*86400)
1164#define BcdTimeToSeconds(x) ((3600 * ((10*((x##_h & 0xF0)>>4)) + (x##_h & 0xF))) + \
1165                             (60 * ((10*((x##_m & 0xF0)>>4)) + (x##_m & 0xF))) + \
1166                             ((10*((x##_s & 0xF0)>>4)) + (x##_s & 0xF)))
1167#define BcdTimeToMinutes(x) ((60 * ((10*((x##_h & 0xF0)>>4)) + (x##_h & 0xF))) + \
1168                             (((10*((x##_m & 0xF0)>>4)) + (x##_m & 0xF))))
1169#define BcdCharToInt(x) (10*((x & 0xF0)>>4) + (x & 0xF))
1170#define CheckBcdChar(x) ((((x & 0xF0)>>4) <= 9) && \
1171                         ((x & 0x0F) <= 9))
1172#define CheckBcdSignedChar(x) ((((x & 0xF0)>>4) >= 0) && (((x & 0xF0)>>4) <= 9) && \
1173                         ((x & 0x0F) >= 0) && ((x & 0x0F) <= 9))
1174
1175#define GetSectionLength(x) HILO(((si_tab_t *)(x))->section_length)
1176#define GetServiceId(x) HILO(((eit_t *)(x))->service_id)
1177#define GetLastTableId(x) ((eit_t *)(x))->segment_last_table_id
1178#define GetSegmentLastSectionNumber(x) ((eit_t *)(x))->segment_last_section_number
1179#define GetPrivateDataSpecifier(x) HILO4(((descr_private_data_specifier_t *)x)->private_data_specifier)
1180*/
1181
1182struct eit
1183{
1184        u_char table_id                               /*:8*/;
1185        u_char section_length_hi                      :4;
1186        u_char                                        :3;
1187        u_char section_syntax_indicator               :1;
1188        u_char section_length_lo                      /*:8*/;
1189        u_char service_id_hi                          /*:8*/;
1190        u_char service_id_lo                          /*:8*/;
1191        u_char current_next_indicator                 :1;
1192        u_char version_number                         :5;
1193        u_char                                        :2;
1194        u_char section_number                         /*:8*/;
1195        u_char last_section_number                    /*:8*/;
1196        u_char transport_stream_id_hi                 /*:8*/;
1197        u_char transport_stream_id_lo                 /*:8*/;
1198        u_char original_network_id_hi                 /*:8*/;
1199        u_char original_network_id_lo                 /*:8*/;
1200        u_char segment_last_section_number            /*:8*/;
1201        u_char segment_last_table_id                  /*:8*/;
1202        u_char data[]; /* struct eitevent */
1203};
1204#define EITLEN sizeof(struct eit)
1205#define GETEITSECLEN(x) HILO(((struct eit*)(x))->section_length)
1206
1207struct eitevent
1208{
1209        u_char event_id_hi                            /*:8*/;
1210        u_char event_id_lo                            /*:8*/;
1211        u_char mjd_hi                                 /*:8*/;
1212        u_char mjd_lo                                 /*:8*/;
1213        u_char start_time_h                           /*:8*/;
1214        u_char start_time_m                           /*:8*/;
1215        u_char start_time_s                           /*:8*/;
1216        u_char duration_h                             /*:8*/;
1217        u_char duration_m                             /*:8*/;
1218        u_char duration_s                             /*:8*/;
1219        u_char descriptors_loop_length_hi             :4;
1220        u_char free_ca_mode                           :1;
1221        u_char running_status                         :3;
1222        u_char descriptors_loop_length_lo             /*:8*/;
1223        u_char data[];
1224};
1225#define EITEVENTLEN sizeof(struct eitevent)
1226#define GETEITDESCLEN(x) HILO(((struct eitevent *)x)->descriptors_loop_length)
1227
1228struct eitshortevent
1229{
1230        u_char descriptor_tag                         /*:8*/;
1231        u_char descriptor_length                      /*:8*/;
1232        u_char lang_code1                             /*:8*/;
1233        u_char lang_code2                             /*:8*/;
1234        u_char lang_code3                             /*:8*/;
1235        u_char event_name_length                      /*:8*/;
1236        u_char data[];
1237};
1238#define EITSHORTEVENTLEN sizeof(struct eitshortevent)
1239
1240struct eitlongevent
1241{
1242        u_char descriptor_tag                         /*:8*/;
1243        u_char descriptor_length                      /*:8*/;
1244        u_char last_descriptor_number                 :4;
1245        u_char descriptor_number                      :4;
1246        u_char lang_code1                             /*:8*/;
1247        u_char lang_code2                             /*:8*/;
1248        u_char lang_code3                             /*:8*/;
1249        u_char length_of_items                        /*:8*/;
1250        u_char data[]; /* struct eitlongeventitem */
1251};
1252#define EITLONGEVENTLEN sizeof(struct eitlongevent)
1253
1254struct eitlongeventitem
1255{
1256        u_char item_description_length               /*:8*/;
1257        u_char data[];
1258};
1259#define EITLONGEVENTITEMLEN sizeof(struct eitlongeventitem)
1260
1261struct eitlinkage
1262{
1263        u_char descriptor_tag                 /*:8*/;
1264        u_char descriptor_length              /*:8*/;
1265        u_char transport_stream_id_hi         /*:8*/;
1266        u_char transport_stream_id_lo         /*:8*/;
1267        u_char original_network_id_hi         /*:8*/;
1268        u_char original_network_id_lo         /*:8*/;
1269        u_char service_id_hi                  /*:8*/;
1270        u_char service_id_lo                  /*:8*/;
1271        u_char linkage_type                   /*:8*/;
1272};
1273#define EITLLINKAGELEN sizeof(struct eitlinkage)
1274
1275struct parentalrating
1276{
1277        u_char descriptor_tag                 /*:8*/;
1278        u_char descriptor_length              /*:8*/;
1279        u_char data[]; //struct parental_rating_item
1280};
1281#define PARENTALRATINGLEN sizeof(struct parentalrating)
1282
1283struct parentalratingitem
1284{
1285        u_char lang_code1                    /*:8*/;
1286        u_char lang_code2                    /*:8*/;
1287        u_char lang_code3                    /*:8*/;
1288        u_char rating                        /*:8*/;
1289};
1290#define PARENTALRATINGITEMLEN sizeof(struct parentalratingitem)
1291
1292struct rst //table id 0x71
1293{
1294        u_char table_id                     /*:8*/;
1295        u_char section_syntax_indicator         :1;
1296        u_char reserved_1                       :1;
1297        u_char reserved_2                       :2;
1298        u_int section_length                   :12;
1299};
1300#define RSTLEN sizeof(struct rst)
1301
1302struct rstitem
1303{
1304        u_char transponder_stream_id_hi     /*:8*/;
1305        u_char transponder_stream_id_lo     /*:8*/;
1306        u_char original_network_id_hi       /*:8*/;
1307        u_char original_network_id_lo       /*:8*/;
1308        u_char service_id_hi                /*:8*/;
1309        u_char service_id_lo                /*:8*/;
1310        u_char event_id_hi                  /*:8*/;
1311        u_char event_id_lo                  /*:8*/;
1312        u_char reserved_1                       :5;
1313        u_char running_status                   :3;
1314};
1315#define RSTITEMLEN sizeof(struct rstitem)
1316
1317#endif
Note: See TracBrowser for help on using the repository browser.