source: titan/titan/struct.h @ 18302

Last change on this file since 18302 was 18302, checked in by nit, 11 years ago

[titan] add unicable assistent

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