Mercurial > mplayer.hg
annotate libvo/sub.h @ 31012:9d2d41352b0d
Revert obscure hack that disables the malloc.h check on certain BSD platforms.
It's unclear what disabling the result of the check is good for and why it is
necessary. Just avoiding a warning is not a good enough reason. Furthermore
this hack introduces problems on 64 bit (k)FreeBSD, as reported in Debian bug
#578622, which indicates it might never have been a good idea at all.
author | diego |
---|---|
date | Wed, 21 Apr 2010 12:43:16 +0000 |
parents | 7681eab10aea |
children | 169013ed9718 |
rev | line source |
---|---|
28446
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28255
diff
changeset
|
1 /* |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28255
diff
changeset
|
2 * This file is part of MPlayer. |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28255
diff
changeset
|
3 * |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28255
diff
changeset
|
4 * MPlayer is free software; you can redistribute it and/or modify |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28255
diff
changeset
|
5 * it under the terms of the GNU General Public License as published by |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28255
diff
changeset
|
6 * the Free Software Foundation; either version 2 of the License, or |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28255
diff
changeset
|
7 * (at your option) any later version. |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28255
diff
changeset
|
8 * |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28255
diff
changeset
|
9 * MPlayer is distributed in the hope that it will be useful, |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28255
diff
changeset
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28255
diff
changeset
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28255
diff
changeset
|
12 * GNU General Public License for more details. |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28255
diff
changeset
|
13 * |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28255
diff
changeset
|
14 * You should have received a copy of the GNU General Public License along |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28255
diff
changeset
|
15 * with MPlayer; if not, write to the Free Software Foundation, Inc., |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28255
diff
changeset
|
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
7681eab10aea
Add standard license headers, unify header formatting.
diego
parents:
28255
diff
changeset
|
17 */ |
616 | 18 |
23689
3f0d00abc073
Do not use leading underscores in multiple inclusion guards, they are reserved.
diego
parents:
23606
diff
changeset
|
19 #ifndef MPLAYER_SUB_H |
3f0d00abc073
Do not use leading underscores in multiple inclusion guards, they are reserved.
diego
parents:
23606
diff
changeset
|
20 #define MPLAYER_SUB_H |
616 | 21 |
5638
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
22 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
|
23 int x1,y1,x2,y2; |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
24 } mp_osd_bbox_t; |
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 OSDTYPE_OSD 1 |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
27 #define OSDTYPE_SUBTITLE 2 |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
28 #define OSDTYPE_PROGBAR 3 |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
29 #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
|
30 #define OSDTYPE_DVDNAV 5 |
23903 | 31 #define OSDTYPE_TELETEXT 6 |
5638
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
32 |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
33 #define OSDFLAG_VISIBLE 1 |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
34 #define OSDFLAG_CHANGED 2 |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
35 #define OSDFLAG_BBOX 4 |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
36 #define OSDFLAG_OLD_BBOX 8 |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
37 #define OSDFLAG_FORCE_UPDATE 16 |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
38 |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
39 #define MAX_UCS 1600 |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
40 #define MAX_UCSLINES 16 |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
41 |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
42 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
|
43 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
|
44 unsigned char type; |
11000 | 45 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
|
46 unsigned short flags; |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
47 int x,y; |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
48 int dxs,dys; |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
49 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
|
50 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
|
51 union { |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
52 struct { |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
53 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
|
54 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
|
55 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
|
56 int lines; // no. of lines |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
57 } subtitle; |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
58 struct { |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
59 int elems; |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
60 } progbar; |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
61 } params; |
7121
6abc330b5b32
subtitle/osd cache - pre-render text to a buffer with alpha and bitmap separated
arpi
parents:
6304
diff
changeset
|
62 int stride; |
6abc330b5b32
subtitle/osd cache - pre-render text to a buffer with alpha and bitmap separated
arpi
parents:
6304
diff
changeset
|
63 |
6abc330b5b32
subtitle/osd cache - pre-render text to a buffer with alpha and bitmap separated
arpi
parents:
6304
diff
changeset
|
64 int allocated; |
6abc330b5b32
subtitle/osd cache - pre-render text to a buffer with alpha and bitmap separated
arpi
parents:
6304
diff
changeset
|
65 unsigned char *alpha_buffer; |
6abc330b5b32
subtitle/osd cache - pre-render text to a buffer with alpha and bitmap separated
arpi
parents:
6304
diff
changeset
|
66 unsigned char *bitmap_buffer; |
5638
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
67 } mp_osd_obj_t; |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
68 |
86663f1b9b00
new osd code, use osd objs to follow changes and do minimal updates
arpi
parents:
5294
diff
changeset
|
69 |
13787
e047e70a9767
Handle "xxx.h" vs "../xxx.h" include paths in a consistent way.
diego
parents:
11000
diff
changeset
|
70 #include "subreader.h" |
218 | 71 |
21370
b806ccbc6398
Remove some of the worst "headers include headers which include
reimar
parents:
21220
diff
changeset
|
72 extern sub_data* subdata; //currently used subtitles |
b806ccbc6398
Remove some of the worst "headers include headers which include
reimar
parents:
21220
diff
changeset
|
73 extern subtitle* vo_sub; |
b806ccbc6398
Remove some of the worst "headers include headers which include
reimar
parents:
21220
diff
changeset
|
74 |
218 | 75 extern unsigned char* vo_osd_text; |
76 | |
23903 | 77 extern void* vo_osd_teletext_page; |
78 extern int vo_osd_teletext_half; | |
79 extern int vo_osd_teletext_mode; | |
80 extern int vo_osd_teletext_format; | |
81 | |
218 | 82 extern int vo_osd_progbar_type; |
83 extern int vo_osd_progbar_value; // 0..255 | |
84 | |
3034
24d3dca4e813
DVD sub patch by Kim Minh Kaplan <kmkaplan@selfoffice.com>
arpi
parents:
2498
diff
changeset
|
85 extern void* vo_spudec; |
4080 | 86 extern void* vo_vobsub; |
3034
24d3dca4e813
DVD sub patch by Kim Minh Kaplan <kmkaplan@selfoffice.com>
arpi
parents:
2498
diff
changeset
|
87 |
218 | 88 #define OSD_PLAY 0x01 |
89 #define OSD_PAUSE 0x02 | |
90 #define OSD_STOP 0x03 | |
91 #define OSD_REW 0x04 | |
92 #define OSD_FFW 0x05 | |
93 #define OSD_CLOCK 0x06 | |
94 #define OSD_CONTRAST 0x07 | |
95 #define OSD_SATURATION 0x08 | |
96 #define OSD_VOLUME 0x09 | |
97 #define OSD_BRIGHTNESS 0x0A | |
98 #define OSD_HUE 0x0B | |
23568 | 99 #define OSD_BALANCE 0x0C |
6304
ee65527096c2
pan&scan support with -vo xv by ?? <mplayer@svennevid.net>
arpi
parents:
6110
diff
changeset
|
100 #define OSD_PANSCAN 0x50 |
218 | 101 |
102 #define OSD_PB_START 0x10 | |
103 #define OSD_PB_0 0x11 | |
104 #define OSD_PB_END 0x12 | |
105 #define OSD_PB_1 0x13 | |
106 | |
1552 | 107 /* now in textform */ |
24046 | 108 extern char * sub_osd_names[]; |
109 extern char * sub_osd_names_short[]; | |
1552 | 110 |
5669
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5645
diff
changeset
|
111 extern int sub_unicode; |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5645
diff
changeset
|
112 extern int sub_utf8; |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5645
diff
changeset
|
113 |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5645
diff
changeset
|
114 extern char *sub_cp; |
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5645
diff
changeset
|
115 extern int sub_pos; |
8583 | 116 extern int sub_width_p; |
8534
922ce27eb683
This patch adds support for vertical subtitle alignment
arpi
parents:
8361
diff
changeset
|
117 extern int sub_alignment; |
7628
d6608342591d
This patch adds the functionality to disable/enable subtitles while playing
arpi
parents:
7121
diff
changeset
|
118 extern int sub_visibility; |
8617
6ffbe7608013
Me: -sub-bg-* would be nicer. "Background" is usually shortened as "bg", not "bkg".
rathann
parents:
8601
diff
changeset
|
119 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
|
120 extern int sub_bg_alpha; |
9077
d430529c5b4b
Improvements to spudec (DVD/VobSub) subtitle code:
rfelker
parents:
8617
diff
changeset
|
121 extern int spu_alignment; |
d430529c5b4b
Improvements to spudec (DVD/VobSub) subtitle code:
rfelker
parents:
8617
diff
changeset
|
122 extern int spu_aamode; |
d430529c5b4b
Improvements to spudec (DVD/VobSub) subtitle code:
rfelker
parents:
8617
diff
changeset
|
123 extern float spu_gaussvar; |
5669
391931fa79a6
enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents:
5645
diff
changeset
|
124 |
28051 | 125 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)); |
28255
aeefca2deed3
Change vo_draw_text to a vo_draw_text_ext function which draws DVD navigation
reimar
parents:
28051
diff
changeset
|
126 void vo_draw_text_ext(int dxs, int dys, int left_border, int top_border, |
aeefca2deed3
Change vo_draw_text to a vo_draw_text_ext function which draws DVD navigation
reimar
parents:
28051
diff
changeset
|
127 int right_border, int bottom_border, int orig_w, int orig_h, |
aeefca2deed3
Change vo_draw_text to a vo_draw_text_ext function which draws DVD navigation
reimar
parents:
28051
diff
changeset
|
128 void (*draw_alpha)(int x0, int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)); |
28051 | 129 void vo_remove_text(int dxs,int dys,void (*remove)(int x0,int y0, int w,int h)); |
218 | 130 |
17566
f580a7755ac5
Patch by Stefan Huehner / stefan % huehner ! org \
rathann
parents:
17100
diff
changeset
|
131 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
|
132 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
|
133 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
|
134 int vo_osd_check_range_update(int,int,int,int); |
17566
f580a7755ac5
Patch by Stefan Huehner / stefan % huehner ! org \
rathann
parents:
17100
diff
changeset
|
135 void free_osd_list(void); |
4807
156482788caf
osd outside movie support for vo_sdl, patch by Fredrik Kuivinen
atmos4
parents:
4080
diff
changeset
|
136 |
5642
eb0cb6185e6c
osd: ok, now it's possible to do partial draw/clear of the buffer only if changed
arpi
parents:
5638
diff
changeset
|
137 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
|
138 |
21582
239f2c145b2f
Mark utf8_get_char parameter as const and fix a compiler warning
reimar
parents:
21370
diff
changeset
|
139 unsigned utf8_get_char(const char **str); |
18935 | 140 |
27341
e7c989f7a7c9
Start unifying names of internal preprocessor directives.
diego
parents:
26007
diff
changeset
|
141 #ifdef CONFIG_DVDNAV |
21220 | 142 #include <inttypes.h> |
21219 | 143 void osd_set_nav_box (uint16_t sx, uint16_t sy, uint16_t ex, uint16_t ey); |
144 #endif | |
145 | |
25535
3baf6a2283da
Add explanatory comments to the #endif part of multiple inclusion guards.
diego
parents:
24046
diff
changeset
|
146 #endif /* MPLAYER_SUB_H */ |