source: titan/titan/struct.h @ 11985

Last change on this file since 11985 was 11985, checked in by gost, 12 years ago

[titan] add timestamp to rectimer

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