aboutsummaryrefslogtreecommitdiffstats
path: root/dvb-c/fi-TTV
blob: 310719cf04acdc1bd23a7c92e72dafd3bf0669a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# TTV
# freq sr fec mod
[CHANNEL]
	DELIVERY_SYSTEM = DVBC/ANNEX_A
	FREQUENCY = 418000000
	SYMBOL_RATE = 6900000
	INNER_FEC = NONE
	MODULATION = QAM/128
	INVERSION = AUTO

[CHANNEL]
	DELIVERY_SYSTEM = DVBC/ANNEX_A
	FREQUENCY = 346000000
	SYMBOL_RATE = 6900000
	INNER_FEC = NONE
	MODULATION = QAM/128
	INVERSION = AUTO
-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#ifndef VBI_H
#define VBI_H

#include "vt.h"
#include "dllist.h"
#include "cache.h"
#include "lang.h"

#define PLL_ADJUST 4

struct raw_page
{
    struct vt_page page[1];
    struct enhance enh[1];
};

struct vbi
{
    int fd;
    struct cache *cache;
    struct dl_head clients[1];
    // page assembly
    struct raw_page rpage[8]; // one for each magazin
    struct raw_page *ppage; // points to page of previous pkt0
    // DVB stuff
    unsigned int ttpid;
    u_int16_t sid;
};

struct vbi_client
{
    struct dl_node node[1];
    void (*handler)(void *data, struct vt_event *ev);
    void *data;
};

struct vbi *vbi_open(char *vbi_dev_name, struct cache *ca,
	const char *channel, char *outfile, u_int16_t sid, int ttpid);
void vbi_close(struct vbi *vbi);
void vbi_reset(struct vbi *vbi);
int vbi_add_handler(struct vbi *vbi, void *handler, void *data);
void vbi_del_handler(struct vbi *vbi, void *handler, void *data);
struct vt_page *vbi_query_page(struct vbi *vbi, int pgno, int subno);

struct vbi *open_null_vbi(struct cache *ca);
void send_errmsg(struct vbi *vbi, char *errmsg, ...);
#endif
b.h> #include <stdio.h> #include <string.h> #include "debug.h" #include "evaluator.h" #include "plugin.h" #include "cfg.h" #ifdef WITH_DMALLOC #include <dmalloc.h> #endif static void load_variables (void) { char *section = "Variables"; char *list, *l, *p; char *expression; void *tree; RESULT result = {0, 0, 0, NULL}; list=cfg_list(section); l=list; while (l!=NULL) { while (*l=='|') l++; if ((p=strchr(l, '|'))!=NULL) *p='\0'; if (strchr(l, '.')!=NULL || strchr(l, ':') !=0) { error ("ignoring variable '%s' from %s: structures not allowed", l, cfg_source()); } else { expression=cfg_get_raw (section, l, ""); if (expression!=NULL && *expression!='\0') { tree = NULL; if (Compile(expression, &tree) == 0 && Eval(tree, &result)==0) { debug ("Variable %s = '%s' (%f)", l, R2S(&result), R2N(&result)); SetVariable (l, &result); DelResult (&result); } else { error ("error evaluating variable '%s' from %s", list, cfg_source()); } DelTree (tree); } } l=p?p+1:NULL; } free (list); } static void my_cfg (RESULT *result, int argc, RESULT *argv[]) { int i, len; char *value; char *buffer; // calculate key length len=0; for (i=0; i<argc; i++) { len+=strlen(R2S(argv[i]))+1; } // allocate key buffer buffer=malloc(len+1); // prepare key buffer *buffer='\0'; for (i=0; i<argc; i++) { strcat (buffer, "."); strcat (buffer, R2S(argv[i])); } // buffer starts with '.', so cut off first char value=cfg_get("", buffer+1, ""); // store result SetResult(&result, R_STRING, value); // free buffer again free (buffer); free(value); } int plugin_init_cfg (void) { // load "Variables" section from cfg load_variables(); // register plugin AddFunction ("cfg", -1, my_cfg); return 0; } void plugin_exit_cfg(void) { }