Mercurial > mplayer.hg
comparison stream/tv.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 | f6b20f40a854 |
children | 21c28c2645fe |
comparison
equal
deleted
inserted
replaced
23509:53d57a0ebe13 | 23510:a6c619ee9d30 |
---|---|
41 #if defined(HAVE_ALSA9) || defined(HAVE_ALSA1X) | 41 #if defined(HAVE_ALSA9) || defined(HAVE_ALSA1X) |
42 extern int tv_param_alsa; | 42 extern int tv_param_alsa; |
43 #endif | 43 #endif |
44 extern char* tv_param_adevice; | 44 extern char* tv_param_adevice; |
45 #endif | 45 #endif |
46 #ifdef HAVE_TV_TELETEXT | |
47 extern char* tv_param_tdevice; ///< teletext vbi device | |
48 extern char* tv_param_tformat; ///< format: text,bw,gray,color | |
49 extern int tv_param_tpage; ///< page number | |
50 #endif | |
46 extern int tv_param_brightness; | 51 extern int tv_param_brightness; |
47 extern int tv_param_contrast; | 52 extern int tv_param_contrast; |
48 extern int tv_param_hue; | 53 extern int tv_param_hue; |
49 extern int tv_param_saturation; | 54 extern int tv_param_saturation; |
50 | 55 |
70 } tvi_functions_t; | 75 } tvi_functions_t; |
71 | 76 |
72 typedef struct tvi_handle_s { | 77 typedef struct tvi_handle_s { |
73 tvi_functions_t *functions; | 78 tvi_functions_t *functions; |
74 void *priv; | 79 void *priv; |
80 #ifdef HAVE_TV_TELETEXT | |
81 void *priv_vbi; | |
82 #endif | |
75 int seq; | 83 int seq; |
76 | 84 |
77 /* specific */ | 85 /* specific */ |
78 int norm; | 86 int norm; |
79 int chanlist; | 87 int chanlist; |
87 char name[20]; | 95 char name[20]; |
88 int freq; | 96 int freq; |
89 struct tv_channels_s *next; | 97 struct tv_channels_s *next; |
90 struct tv_channels_s *prev; | 98 struct tv_channels_s *prev; |
91 } tv_channels_t; | 99 } tv_channels_t; |
100 | |
101 #ifdef HAVE_TV_TELETEXT | |
102 typedef struct tv_teletext_img_s { | |
103 void* canvas; | |
104 int tformat; | |
105 int columns; | |
106 int rows; | |
107 int height; | |
108 int width; | |
109 int half; | |
110 } tv_teletext_img_t; | |
111 #endif | |
92 | 112 |
93 extern tv_channels_t *tv_channel_list; | 113 extern tv_channels_t *tv_channel_list; |
94 extern tv_channels_t *tv_channel_current, *tv_channel_last; | 114 extern tv_channels_t *tv_channel_current, *tv_channel_last; |
95 extern char *tv_channel_last_real; | 115 extern char *tv_channel_last_real; |
96 | 116 |
151 /* SPECIFIC controls */ | 171 /* SPECIFIC controls */ |
152 #define TVI_CONTROL_SPC_GET_INPUT 0x401 /* set input channel (tv,s-video,composite..) */ | 172 #define TVI_CONTROL_SPC_GET_INPUT 0x401 /* set input channel (tv,s-video,composite..) */ |
153 #define TVI_CONTROL_SPC_SET_INPUT 0x402 /* set input channel (tv,s-video,composite..) */ | 173 #define TVI_CONTROL_SPC_SET_INPUT 0x402 /* set input channel (tv,s-video,composite..) */ |
154 #define TVI_CONTROL_SPC_GET_NORMID 0x403 /* get normid from norm name */ | 174 #define TVI_CONTROL_SPC_GET_NORMID 0x403 /* get normid from norm name */ |
155 | 175 |
176 /* TELETEXT controls */ | |
177 #define TVI_CONTROL_VBI_SET_MODE 0x501 ///< on/off grab teletext | |
178 #define TVI_CONTROL_VBI_GET_MODE 0x502 ///< get current mode teletext | |
179 #define TVI_CONTROL_VBI_STEP_MODE 0x503 ///< step teletext mode | |
180 | |
181 #define TVI_CONTROL_VBI_SET_PAGE 0x504 ///< set grab teletext page number | |
182 #define TVI_CONTROL_VBI_STEP_PAGE 0x505 ///< step grab teletext page number | |
183 #define TVI_CONTROL_VBI_GET_PAGE 0x506 ///< get grabbed teletext page | |
184 | |
185 #define TVI_CONTROL_VBI_SET_FORMAT 0x507 ///< set teletext format | |
186 #define TVI_CONTROL_VBI_STEP_FORMAT 0x508 ///< step teletext format | |
187 #define TVI_CONTROL_VBI_GET_FORMAT 0x509 ///< get eletext format | |
188 | |
189 #define TVI_CONTROL_VBI_GET_HALF_PAGE 0x50a ///< get current half page | |
190 #define TVI_CONTROL_VBI_STEP_HALF_PAGE 0x50b ///< switch half page | |
191 #define TVI_CONTROL_VBI_SET_HALF_PAGE 0x50c ///< switch half page | |
192 | |
193 #define TVI_CONTROL_VBI_ADD_DEC 0x50d ///< add page number with dec | |
194 #define TVI_CONTROL_VBI_GO_LINK 0x50e ///< go link (1..6) | |
195 #define TVI_CONTROL_VBI_GET_TXTPAGE 0x50f ///< get grabbed text teletext page | |
196 #define TVI_CONTROL_VBI_GET_IMGPAGE 0x510 ///< get grabbed image teletext page | |
197 #define TVI_CONTROL_VBI_GET_VBIPAGE 0x511 ///< get vbi_image for grabbed teletext page | |
198 #define TVI_CONTROL_VBI_RESET 0x512 ///< vbi reset | |
199 #define TVI_CONTROL_VBI_START 0x513 ///< vbi start | |
200 | |
156 extern tvi_handle_t *tv_begin(void); | 201 extern tvi_handle_t *tv_begin(void); |
157 extern int tv_init(tvi_handle_t *tvh); | 202 extern int tv_init(tvi_handle_t *tvh); |
158 extern int tv_uninit(tvi_handle_t *tvh); | 203 extern int tv_uninit(tvi_handle_t *tvh); |
159 | 204 |
160 int tv_set_color_options(tvi_handle_t *tvh, int opt, int val); | 205 int tv_set_color_options(tvi_handle_t *tvh, int opt, int val); |
180 int tv_set_freq(tvi_handle_t *tvh, unsigned long freq); | 225 int tv_set_freq(tvi_handle_t *tvh, unsigned long freq); |
181 int tv_get_freq(tvi_handle_t *tvh, unsigned long *freq); | 226 int tv_get_freq(tvi_handle_t *tvh, unsigned long *freq); |
182 int tv_step_freq(tvi_handle_t *tvh, float step_interval); | 227 int tv_step_freq(tvi_handle_t *tvh, float step_interval); |
183 | 228 |
184 int tv_set_norm(tvi_handle_t *tvh, char* norm); | 229 int tv_set_norm(tvi_handle_t *tvh, char* norm); |
230 | |
231 #ifdef HAVE_TV_TELETEXT | |
232 int tv_teletext_control(tvi_handle_t* tvh, int control,void* arg); | |
233 /// add dec to pageno | |
234 int tv_teletext_add_dec(tvi_handle_t *tvh, char *dec); | |
235 /// go link | |
236 int tv_teletext_go_link(tvi_handle_t *tvh, int linkno); | |
237 /// get current vbi_page | |
238 void* tv_get_teletext_vbipage(tvi_handle_t *tvh); | |
239 /// get current page text | |
240 char* tv_get_teletext_txtpage(tvi_handle_t *tvh); | |
241 /// get current page image (RGB32_LB format) | |
242 tv_teletext_img_t* tv_get_teletext_imgpage(tvi_handle_t *tvh); | |
243 #endif | |
185 | 244 |
186 #define TV_NORM_PAL 1 | 245 #define TV_NORM_PAL 1 |
187 #define TV_NORM_NTSC 2 | 246 #define TV_NORM_NTSC 2 |
188 #define TV_NORM_SECAM 3 | 247 #define TV_NORM_SECAM 3 |
189 #define TV_NORM_PALNC 4 | 248 #define TV_NORM_PALNC 4 |