comparison stream/tvi_vbi.h @ 23510:a6c619ee9d30

Teletext support for tv:// (v4l and v4l2 only) modified patch from Otvos Attila oattila at chello dot hu Module uses zvbi library for all low-level VBI operations (like I/O with vbi device, converting vbi pages into usefull vbi_page stuctures, rendering them into RGB32 images). All teletext related stuff (except properties, slave commands and rendering osd in text mode or RGB32 rendered teletext pages in spu mode) is implemented in tvi_vbi.c New properties: teletext_page - switching between pages teletext_mode - switch between on/off/opaque/transparent modes teletext_format - (currently read-only) allows to get format info (black/white,gray,text) teletext_half_page - trivial zooming (displaying top/bottom half of teletext page) New slave commands: teletext_add_dec - user interface for jumping to any page by editing page number interactively teletext_go_link - goes though links, specified on current page
author voroshil
date Sun, 10 Jun 2007 00:06:12 +0000
parents
children
comparison
equal deleted inserted replaced
23509:53d57a0ebe13 23510:a6c619ee9d30
1 #ifndef __TVI_VBI_H_
2 #define __TVI_VBI_H_
3
4 #include "libzvbi.h"
5 #include "libmpcodecs/img_format.h"
6 #include "libmpcodecs/mp_image.h"
7 #include "tv.h"
8
9 #define VBI_MAX_SUBPAGES 64 ///< max sub pages number
10 #define VBI_TXT_PAGE_SIZE 42*25*2 ///< max text page size
11 #define VBI_MAX_LINE_SIZE 42 ///< max line size in text page
12
13 #define VBI_TFORMAT_TEXT 0 ///< text mode
14 #define VBI_TFORMAT_BW 1 ///< back&white mode
15 #define VBI_TFORMAT_GRAY 2 ///< grayscale mode
16 #define VBI_TFORMAT_COLOR 3 ///< color mode (require color_spu patch!)
17
18 #define VBI_NO_TELETEXT "No teletext"
19
20 #define VBI_TRANSPARENT_COLOR 40 ///< transparent color id
21 #define VBI_TIME_LINEPOS 13 ///< time line pos in page header
22
23 typedef struct {
24 int on; ///< teletext on/off
25
26 char* device; ///< capture device
27 unsigned int services; ///< services
28 vbi_capture* capture; ///< vbi_capture
29 int capture_fd; ///< capture fd (now not used)
30 vbi_decoder* decoder; ///< vbi_decoder
31 char* errstr; ///< error string
32 pthread_t grabber_thread; ///< grab thread
33 pthread_mutex_t buffer_mutex;
34 pthread_mutex_t update_mutex;
35 int eof; ///< end grab
36 int tpage; ///< tpage
37 int pgno; ///< seek page number
38 int subno; ///< seek subpage
39 int curr_pgno; ///< current page number
40 int curr_subno; ///< current subpage
41 uint32_t pagenumdec; ///< set page num with dec
42
43 vbi_page** cache;
44 vbi_page *page; ///< vbi_page
45 int valid_page; ///< valid page flag
46 char* txtpage; ///< decoded vbi_page to text
47 vbi_char theader[VBI_MAX_LINE_SIZE]; ///< vbi header
48 char header[VBI_MAX_LINE_SIZE]; ///< text header
49
50 int tformat; ///< 0:text, 1:bw, 2:gray, 3:color
51 vbi_pixfmt fmt; ///< image format (only VBI_PIXFMT_RGBA32_LE supported)
52 void* canvas; ///< stored image data
53 int csize; ///< stored image size
54 int canvas_size; ///< image buffer size
55 int reveal; ///< reveal (now not used)
56 int flash_on; ///< flash_on (now not used)
57 int alpha; ///< opacity mode
58 int foreground; ///< foreground black in bw mode
59 int half; ///< 0:half mode off, 1:top half page, 2:bottom half page
60 int redraw; ///< is redraw last image
61 int columns; ///< page size: coloumns
62 int rows; ///< page size: rows
63 int spudec_proc; ///< render image request
64
65 char* network_name; ///< network name
66 char* network_id; ///< network id
67 } priv_vbi_t;
68
69 /// teletext subsystem initialization
70 priv_vbi_t* teletext_init(void);
71 /// teletext subsystem uninitialization
72 void teletext_uninit(priv_vbi_t* priv_vbi);
73 /// ioctl for
74 int teletext_control(priv_vbi_t* priv_vbi, int cmd, void *args);
75 #endif