MythTV  master
Go to the documentation of this file.
1 #ifndef VBI_H
2 #define VBI_H
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
8 #include "vt.h"
9 #include "dllist.h"
10 #include "lang.h"
11 //#include "cache.h"
13 #define PLL_ADJUST 4
15 struct raw_page
16 {
17  struct vt_page page[1];
18  struct enhance enh[1];
19 };
21 struct vbi
22 {
23  int fd;
24  struct cache *cache;
25  struct dl_head clients[1];
26  // raw buffer management
27  int bufsize; // nr of bytes sent by this device
28  int bpl; // bytes per line
29  unsigned int seq;
30  // page assembly
31  struct raw_page rpage[8]; // one for each magazin
32  struct raw_page *ppage; // points to page of previous pkt0
33  // phase correction
34  int pll_fixed; // 0 = auto, 1..2*PLL_ADJUST+1 = fixed
35  int pll_adj;
36  int pll_dir;
37  int pll_cnt;
39  // v4l2 decoder data
40  int bpb; // bytes per bit * 2^16
41  int bp8bl, bp8bh; // bytes per 8-bit low/high
42  int soc, eoc; // start/end of clock run-in
43 };
45 struct vbi_client
46 {
47  struct dl_node node[1];
48  void (*handler)(void *data, struct vt_event *ev);
49  void *data;
50 };
52 struct vbi *vbi_open(const char *vbi_dev_name, struct cache *ca, int fine_tune,
53  int big_buf);
54 void vbi_close(struct vbi *vbi);
55 void vbi_reset(struct vbi *vbi);
56 int vbi_add_handler(struct vbi *vbi, void *handler, void *data);
57 void vbi_del_handler(struct vbi *vbi, void *handler, void *data);
58 struct vt_page *vbi_query_page(struct vbi *vbi, int pgno, int subno);
59 void vbi_pll_reset(struct vbi *vbi, int fine_tune);
61 void vbi_handler(struct vbi *vbi, int fd);
63 #ifdef __cplusplus
64 }
65 #endif
67 #endif
int pll_err
Definition: vbi.h:38
int pll_dir
Definition: vbi.h:36
int pgno
Definition: vt.h:38
int pll_lerr
Definition: vbi.h:38
int vbi_add_handler(struct vbi *vbi, void *handler, void *data)
Definition: vbi.c:443
struct dl_head clients[1]
Definition: vbi.h:25
int eoc
Definition: vbi.h:42
struct cache * cache
Definition: vbi.h:24
Definition: lang.h:13
unsigned int seq
Definition: vbi.h:29
int bp8bh
Definition: vbi.h:41
void * data
Definition: vbi.h:49
Definition: vt.h:36
struct dl_node node[1]
Definition: vbi.h:47
int bufsize
Definition: vbi.h:27
struct vt_page * vbi_query_page(struct vbi *vbi, int pgno, int subno)
Definition: vbi.c:669
int bpl
Definition: vbi.h:28
Definition: dllist.h:14
int bpb
Definition: vbi.h:40
int pll_fixed
Definition: vbi.h:34
struct vt_page page[1]
Definition: vbi.h:17
int pll_adj
Definition: vbi.h:35
Definition: vbi.h:45
void(* handler)(void *data, struct vt_event *ev)
Definition: vbi.h:48
Definition: vt.h:8
int soc
Definition: vbi.h:42
void vbi_close(struct vbi *vbi)
Definition: vbi.c:658
Definition: vbi.h:15
int pll_cnt
Definition: vbi.h:37
Definition: dllist.h:8
void vbi_pll_reset(struct vbi *vbi, int fine_tune)
Definition: vbi.c:145
struct raw_page rpage[8]
Definition: vbi.h:31
void vbi_reset(struct vbi *vbi)
Definition: vbi.c:696
Definition: vbi.h:21
int subno
Definition: vt.h:38
void vbi_del_handler(struct vbi *vbi, void *handler, void *data)
Definition: vbi.c:461
struct enhance enh[1]
Definition: vbi.h:18
int fd
Definition: vbi.h:23
int bp8bl
Definition: vbi.h:41
struct vbi * vbi_open(const char *vbi_dev_name, struct cache *ca, int fine_tune, int big_buf)
Definition: vbi.c:607
struct raw_page * ppage
Definition: vbi.h:32
void vbi_handler(struct vbi *vbi, int fd)
Definition: vbi.c:400