source: titan/titan/struct.h @ 15568

Last change on this file since 15568 was 15546, checked in by obi, 12 years ago

[titan] change version to 1.13

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