2 * This file is part of MPlayer.
4 * MPlayer is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * MPlayer is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 typedef struct mp_osd_bbox_s
{
29 #define OSDTYPE_SUBTITLE 2
30 #define OSDTYPE_PROGBAR 3
32 #define OSDTYPE_DVDNAV 5
33 #define OSDTYPE_TELETEXT 6
35 #define OSDFLAG_VISIBLE 1
36 #define OSDFLAG_CHANGED 2
37 #define OSDFLAG_BBOX 4
38 #define OSDFLAG_OLD_BBOX 8
39 #define OSDFLAG_FORCE_UPDATE 16
42 #define MAX_UCSLINES 16
44 typedef struct mp_osd_obj_s
{
45 struct mp_osd_obj_s
* next
;
47 unsigned char alignment
; // 2 bits: x;y percentages, 2 bits: x;y relative to parent; 2 bits: alignment left/right/center
51 mp_osd_bbox_t bbox
; // bounding box
52 mp_osd_bbox_t old_bbox
; // the renderer will save bbox here
55 void* sub
; // value of vo_sub at last update
56 int utbl
[MAX_UCS
+1]; // subtitle text
57 int xtbl
[MAX_UCSLINES
]; // x positions
58 int lines
; // no. of lines
67 unsigned char *alpha_buffer
;
68 unsigned char *bitmap_buffer
;
72 struct ass_library
*ass_library
;
73 // flag to signal reinitialization due to ass-related option changes
74 bool ass_force_reload
;
76 struct font_desc
*sub_font
;
77 struct ass_track
*ass_track
;
79 bool ass_track_changed
;
83 #include "subreader.h"
85 extern subtitle
* vo_sub
;
87 extern void* vo_osd_teletext_page
;
88 extern int vo_osd_teletext_half
;
89 extern int vo_osd_teletext_mode
;
90 extern int vo_osd_teletext_format
;
92 extern int vo_osd_progbar_type
;
93 extern int vo_osd_progbar_value
; // 0..255
95 extern void* vo_spudec
;
96 extern void* vo_vobsub
;
99 #define OSD_PAUSE 0x02
100 #define OSD_STOP 0x03
103 #define OSD_CLOCK 0x06
104 #define OSD_CONTRAST 0x07
105 #define OSD_SATURATION 0x08
106 #define OSD_VOLUME 0x09
107 #define OSD_BRIGHTNESS 0x0A
109 #define OSD_BALANCE 0x0C
110 #define OSD_PANSCAN 0x50
112 #define OSD_PB_START 0x10
113 #define OSD_PB_0 0x11
114 #define OSD_PB_END 0x12
115 #define OSD_PB_1 0x13
117 /* now in textform */
118 extern char * const sub_osd_names
[];
119 extern char * const sub_osd_names_short
[];
121 extern int sub_unicode
;
126 extern int sub_width_p
;
127 extern int sub_alignment
;
128 extern int sub_visibility
;
129 extern int sub_bg_color
; /* subtitles background color */
130 extern int sub_bg_alpha
;
131 extern int spu_alignment
;
132 extern int spu_aamode
;
133 extern float spu_gaussvar
;
135 void osd_draw_text(struct osd_state
*osd
, int dxs
, int dys
,
136 void (*draw_alpha
)(void *ctx
, int x0
, int y0
, int w
, int h
,
137 unsigned char* src
, unsigned char *srca
,
140 void osd_draw_text_ext(struct osd_state
*osd
, int dxs
, int dys
,
141 int left_border
, int top_border
, int right_border
,
142 int bottom_border
, int orig_w
, int orig_h
,
143 void (*draw_alpha
)(void *ctx
, int x0
, int y0
, int w
,
144 int h
, unsigned char* src
,
148 void osd_remove_text(struct osd_state
*osd
, int dxs
, int dys
,
149 void (*remove
)(int x0
, int y0
, int w
, int h
));
151 struct osd_state
*osd_create(void);
152 void osd_set_text(struct osd_state
*osd
, const char *text
);
153 int osd_update(struct osd_state
*osd
, int dxs
, int dys
);
154 int vo_osd_changed(int new_value
);
155 int vo_osd_check_range_update(int,int,int,int);
156 void osd_free(struct osd_state
*osd
);
158 extern int vo_osd_changed_flag
;
160 unsigned utf8_get_char(const char **str
);
163 #include <inttypes.h>
164 void osd_set_nav_box (uint16_t sx
, uint16_t sy
, uint16_t ex
, uint16_t ey
);
169 #define vo_remove_text(...) osd_remove_text(global_osd, __VA_ARGS__)
172 #endif /* MPLAYER_SUB_H */