00001 #ifndef VBI_H
00002 #define VBI_H
00003
00004 #ifdef __cplusplus
00005 extern "C" {
00006 #endif
00007
00008 #include "vt.h"
00009 #include "dllist.h"
00010 #include "lang.h"
00011
00012
00013 #define PLL_ADJUST 4
00014
00015 struct raw_page
00016 {
00017 struct vt_page page[1];
00018 struct enhance enh[1];
00019 };
00020
00021 struct vbi
00022 {
00023 int fd;
00024 struct cache *cache;
00025 struct dl_head clients[1];
00026
00027 int bufsize;
00028 int bpl;
00029 unsigned int seq;
00030
00031 struct raw_page rpage[8];
00032 struct raw_page *ppage;
00033
00034 int pll_fixed;
00035 int pll_adj;
00036 int pll_dir;
00037 int pll_cnt;
00038 int pll_err, pll_lerr;
00039
00040 int bpb;
00041 int bp8bl, bp8bh;
00042 int soc, eoc;
00043 };
00044
00045 struct vbi_client
00046 {
00047 struct dl_node node[1];
00048 void (*handler)(void *data, struct vt_event *ev);
00049 void *data;
00050 };
00051
00052 struct vbi *vbi_open(const char *vbi_dev_name, struct cache *ca, int fine_tune,
00053 int big_buf);
00054 void vbi_close(struct vbi *vbi);
00055 void vbi_reset(struct vbi *vbi);
00056 int vbi_add_handler(struct vbi *vbi, void *handler, void *data);
00057 void vbi_del_handler(struct vbi *vbi, void *handler, void *data);
00058 struct vt_page *vbi_query_page(struct vbi *vbi, int pgno, int subno);
00059 void vbi_pll_reset(struct vbi *vbi, int fine_tune);
00060
00061 void vbi_handler(struct vbi *vbi, int fd);
00062
00063 #ifdef __cplusplus
00064 }
00065 #endif
00066
00067 #endif
00068