Mercurial > mplayer.hg
annotate libvo/sub.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 | 5c909391c555 |
children | 519e42b716aa |
rev | line source |
---|---|
616 | 1 |
2 #ifndef __MPLAYER_SUB_H | |
3 #define __MPLAYER_SUB_H | |
4 | |
23510 | 5 #ifdef HAVE_TV_TELETEXT |
6 #include "libmpcodecs/mp_image.h" | |
7 #endif | |
8 | |
5638
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
9 typedef struct mp_osd_bbox_s { |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
10 int x1,y1,x2,y2; |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
11 } mp_osd_bbox_t; |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
12 |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
13 #define OSDTYPE_OSD 1 |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
14 #define OSDTYPE_SUBTITLE 2 |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
15 #define OSDTYPE_PROGBAR 3 |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
16 #define OSDTYPE_SPU 4 |
21193
a067e7e18b50
support for dvdnav menu buttons overlay as simple alpha boxes (rework from Otvos Attila's series of patches)
ben
parents:
18935
diff
changeset
|
17 #define OSDTYPE_DVDNAV 5 |
23510 | 18 #define OSDTYPE_TELETEXT 6 |
5638
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
19 |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
20 #define OSDFLAG_VISIBLE 1 |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
21 #define OSDFLAG_CHANGED 2 |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
22 #define OSDFLAG_BBOX 4 |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
23 #define OSDFLAG_OLD_BBOX 8 |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
24 #define OSDFLAG_FORCE_UPDATE 16 |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
25 |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
26 #define MAX_UCS 1600 |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
27 #define MAX_UCSLINES 16 |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
28 |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
29 typedef struct mp_osd_obj_s { |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
30 struct mp_osd_obj_s* next; |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
31 unsigned char type; |
11000 | 32 unsigned char alignment; // 2 bits: x;y percentages, 2 bits: x;y relative to parent; 2 bits: alignment left/right/center |
5638
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
33 unsigned short flags; |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
34 int x,y; |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
35 int dxs,dys; |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
36 mp_osd_bbox_t bbox; // bounding box |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
37 mp_osd_bbox_t old_bbox; // the renderer will save bbox here |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
38 union { |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
39 struct { |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
40 void* sub; // value of vo_sub at last update |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
41 int utbl[MAX_UCS+1]; // subtitle text |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
42 int xtbl[MAX_UCSLINES]; // x positions |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
43 int lines; // no. of lines |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
44 } subtitle; |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
45 struct { |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
46 int elems; |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
47 } progbar; |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
48 } params; |
7121
6abc330b5b32
subtitle/osd cache - pre-render text to a buffer with alpha and bitmap separated
arpi
parents:
6304
diff
changeset
|
49 int stride; |
6abc330b5b32
subtitle/osd cache - pre-render text to a buffer with alpha and bitmap separated
arpi
parents:
6304
diff
changeset
|
50 |
6abc330b5b32
subtitle/osd cache - pre-render text to a buffer with alpha and bitmap separated
arpi
parents:
6304
diff
changeset
|
51 int allocated; |
6abc330b5b32
subtitle/osd cache - pre-render text to a buffer with alpha and bitmap separated
arpi
parents:
6304
diff
changeset
|
52 unsigned char *alpha_buffer; |
6abc330b5b32
subtitle/osd cache - pre-render text to a buffer with alpha and bitmap separated
arpi
parents:
6304
diff
changeset
|
53 unsigned char *bitmap_buffer; |
5638
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
54 } mp_osd_obj_t; |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
55 |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
56 |
865 | 57 #if 0 |
58 | |
59 // disable subtitles: | |
60 static inline void vo_draw_text_osd(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)){ | |
61 } | |
62 | |
63 #else | |
64 | |
13787
e047e70a9767
Handle "xxx.h" vs "../xxx.h" include paths in a consistent way.
diego
parents:
11000
diff
changeset
|
65 #include "subreader.h" |
218 | 66 |
21370
b806ccbc6398
Remove some of the worst "headers include headers which include
reimar
parents:
21220
diff
changeset
|
67 extern sub_data* subdata; //currently used subtitles |
b806ccbc6398
Remove some of the worst "headers include headers which include
reimar
parents:
21220
diff
changeset
|
68 extern subtitle* vo_sub; |
b806ccbc6398
Remove some of the worst "headers include headers which include
reimar
parents:
21220
diff
changeset
|
69 |
218 | 70 extern unsigned char* vo_osd_text; |
71 | |
23510 | 72 #ifdef HAVE_TV_TELETEXT |
73 extern unsigned char* vo_osd_teletex_text; | |
74 extern int vo_osd_teletext_flip; | |
75 #endif | |
76 | |
218 | 77 extern int vo_osd_progbar_type; |
78 extern int vo_osd_progbar_value; // 0..255 | |
79 | |
3034
24d3dca4e813
DVD sub patch by Kim Minh Kaplan <kmkaplan@selfoffice.com>
arpi
parents:
2498
diff
changeset
|
80 extern void* vo_spudec; |
4080 | 81 extern void* vo_vobsub; |
3034
24d3dca4e813
DVD sub patch by Kim Minh Kaplan <kmkaplan@selfoffice.com>
arpi
parents:
2498
diff
changeset
|
82 |
218 | 83 #define OSD_PLAY 0x01 |
84 #define OSD_PAUSE 0x02 | |
85 #define OSD_STOP 0x03 | |
86 #define OSD_REW 0x04 | |
87 #define OSD_FFW 0x05 | |
88 #define OSD_CLOCK 0x06 | |
89 #define OSD_CONTRAST 0x07 | |
90 #define OSD_SATURATION 0x08 | |
91 #define OSD_VOLUME 0x09 | |
92 #define OSD_BRIGHTNESS 0x0A | |
93 #define OSD_HUE 0x0B | |
6304
ee65527096c2
pan&scan support with -vo xv by ?? <mplayer@svennevid.net>
arpi
parents:
6110
diff
changeset
|
94 #define OSD_PANSCAN 0x50 |
218 | 95 |
96 #define OSD_PB_START 0x10 | |
97 #define OSD_PB_0 0x11 | |
98 #define OSD_PB_END 0x12 | |
99 #define OSD_PB_1 0x13 | |
100 | |
1552 | 101 /* now in textform */ |
2498 | 102 extern char * __sub_osd_names[]; |
103 extern char * __sub_osd_names_short[]; | |
1552 | 104 |
5669
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5645
diff
changeset
|
105 extern int sub_unicode; |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5645
diff
changeset
|
106 extern int sub_utf8; |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5645
diff
changeset
|
107 |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5645
diff
changeset
|
108 #ifdef USE_ICONV |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5645
diff
changeset
|
109 extern char *sub_cp; |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5645
diff
changeset
|
110 #endif |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5645
diff
changeset
|
111 extern int sub_pos; |
8583 | 112 extern int sub_width_p; |
8534
922ce27eb683
This patch adds support for vertical subtitle alignment
arpi
parents:
8361
diff
changeset
|
113 extern int sub_alignment; |
7628
d6608342591d
This patch adds the functionality to disable/enable subtitles while playing
arpi
parents:
7121
diff
changeset
|
114 extern int sub_visibility; |
8361
2202c00001e3
overlapping subtitles support is now optional, can be disabled (-nooverlapsub)
arpi
parents:
7628
diff
changeset
|
115 extern int suboverlap_enabled; |
8617
6ffbe7608013
Me: -sub-bg-* would be nicer. "Background" is usually shortened as "bg", not "bkg".
rathann
parents:
8601
diff
changeset
|
116 extern int sub_bg_color; /* subtitles background color */ |
6ffbe7608013
Me: -sub-bg-* would be nicer. "Background" is usually shortened as "bg", not "bkg".
rathann
parents:
8601
diff
changeset
|
117 extern int sub_bg_alpha; |
9077
d430529c5b4b
Improvements to spudec (DVD/VobSub) subtitle code:
rfelker
parents:
8617
diff
changeset
|
118 extern int spu_alignment; |
d430529c5b4b
Improvements to spudec (DVD/VobSub) subtitle code:
rfelker
parents:
8617
diff
changeset
|
119 extern int spu_aamode; |
d430529c5b4b
Improvements to spudec (DVD/VobSub) subtitle code:
rfelker
parents:
8617
diff
changeset
|
120 extern float spu_gaussvar; |
5669
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5645
diff
changeset
|
121 |
898 | 122 //extern void vo_draw_text_osd(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)); |
865 | 123 //extern void vo_draw_text_progbar(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)); |
124 //extern void vo_draw_text_sub(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)); | |
898 | 125 extern void vo_draw_text(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)); |
5645 | 126 extern void vo_remove_text(int dxs,int dys,void (*remove)(int x0,int y0, int w,int h)); |
218 | 127 |
17566
f580a7755ac5
Patch by Stefan Huehner / stefan % huehner ! org \
rathann
parents:
17100
diff
changeset
|
128 void vo_init_osd(void); |
5638
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
129 int vo_update_osd(int dxs,int dys); |
4807
156482788caf
osd outside movie support for vo_sdl, patch by Fredrik Kuivinen
atmos4
parents:
4080
diff
changeset
|
130 int vo_osd_changed(int new_value); |
6057
31e465fda59c
various openbsd and general warning fixes - patch by Bj«Órn Sandell <biorn@dce.chalmers.se>
arpi
parents:
5669
diff
changeset
|
131 int vo_osd_check_range_update(int,int,int,int); |
17566
f580a7755ac5
Patch by Stefan Huehner / stefan % huehner ! org \
rathann
parents:
17100
diff
changeset
|
132 void free_osd_list(void); |
4807
156482788caf
osd outside movie support for vo_sdl, patch by Fredrik Kuivinen
atmos4
parents:
4080
diff
changeset
|
133 |
5642
eb0cb6185e6c
osd: ok, now it's possible to do partial draw/clear of the buffer only if changed
arpi
parents:
5638
diff
changeset
|
134 extern int vo_osd_changed_flag; |
eb0cb6185e6c
osd: ok, now it's possible to do partial draw/clear of the buffer only if changed
arpi
parents:
5638
diff
changeset
|
135 |
21582
239f2c145b2f
Mark utf8_get_char parameter as const and fix a compiler warning
reimar
parents:
21370
diff
changeset
|
136 unsigned utf8_get_char(const char **str); |
18935 | 137 |
21219 | 138 #ifdef USE_DVDNAV |
21220 | 139 #include <inttypes.h> |
21219 | 140 void osd_set_nav_box (uint16_t sx, uint16_t sy, uint16_t ex, uint16_t ey); |
141 #endif | |
142 | |
616 | 143 #endif |
865 | 144 #endif |