vbi.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #ifndef VBI_H
  2. #define VBI_H
  3. #include "vt.h"
  4. #include "dllist.h"
  5. #include "cache.h"
  6. #include "lang.h"
  7. #define PLL_ADJUST 4
  8. struct raw_page
  9. {
  10. struct vt_page page[1];
  11. struct enhance enh[1];
  12. };
  13. struct vbi
  14. {
  15. int fd;
  16. struct cache *cache;
  17. struct dl_head clients[1];
  18. // page assembly
  19. struct raw_page rpage[8]; // one for each magazin
  20. struct raw_page *ppage; // points to page of previous pkt0
  21. // DVB stuff
  22. unsigned int ttpid;
  23. u_int16_t sid;
  24. };
  25. struct vbi_client
  26. {
  27. struct dl_node node[1];
  28. void (*handler)(void *data, struct vt_event *ev);
  29. void *data;
  30. };
  31. struct vbi *vbi_open(char *vbi_dev_name, struct cache *ca,
  32. const char *channel, char *outfile, u_int16_t sid, int ttpid);
  33. void vbi_close(struct vbi *vbi);
  34. void vbi_reset(struct vbi *vbi);
  35. int vbi_add_handler(struct vbi *vbi, void *handler, void *data);
  36. void vbi_del_handler(struct vbi *vbi, void *handler, void *data);
  37. struct vt_page *vbi_query_page(struct vbi *vbi, int pgno, int subno);
  38. struct vbi *open_null_vbi(struct cache *ca);
  39. void send_errmsg(struct vbi *vbi, char *errmsg, ...);
  40. #endif