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.
22 typedef struct mp_osd_bbox_s
{
27 #define OSDTYPE_SUBTITLE 2
28 #define OSDTYPE_PROGBAR 3
30 #define OSDTYPE_DVDNAV 5
31 #define OSDTYPE_TELETEXT 6
33 #define OSDFLAG_VISIBLE 1
34 #define OSDFLAG_CHANGED 2
35 #define OSDFLAG_BBOX 4
36 #define OSDFLAG_OLD_BBOX 8
37 #define OSDFLAG_FORCE_UPDATE 16
40 #define MAX_UCSLINES 16
42 typedef struct mp_osd_obj_s
{
43 struct mp_osd_obj_s
* next
;
45 unsigned char alignment
; // 2 bits: x;y percentages, 2 bits: x;y relative to parent; 2 bits: alignment left/right/center
49 mp_osd_bbox_t bbox
; // bounding box
50 mp_osd_bbox_t old_bbox
; // the renderer will save bbox here
53 void* sub
; // value of vo_sub at last update
54 int utbl
[MAX_UCS
+1]; // subtitle text
55 int xtbl
[MAX_UCSLINES
]; // x positions
56 int lines
; // no. of lines
65 unsigned char *alpha_buffer
;
66 unsigned char *bitmap_buffer
;
70 unsigned char osd_text
[128];
71 struct font_desc
*sub_font
;
74 #include "subreader.h"
76 extern sub_data
* subdata
; //currently used subtitles
77 extern subtitle
* vo_sub
;
79 extern void* vo_osd_teletext_page
;
80 extern int vo_osd_teletext_half
;
81 extern int vo_osd_teletext_mode
;
82 extern int vo_osd_teletext_format
;
84 extern int vo_osd_progbar_type
;
85 extern int vo_osd_progbar_value
; // 0..255
87 extern void* vo_spudec
;
88 extern void* vo_vobsub
;
91 #define OSD_PAUSE 0x02
95 #define OSD_CLOCK 0x06
96 #define OSD_CONTRAST 0x07
97 #define OSD_SATURATION 0x08
98 #define OSD_VOLUME 0x09
99 #define OSD_BRIGHTNESS 0x0A
101 #define OSD_BALANCE 0x0C
102 #define OSD_PANSCAN 0x50
104 #define OSD_PB_START 0x10
105 #define OSD_PB_0 0x11
106 #define OSD_PB_END 0x12
107 #define OSD_PB_1 0x13
109 /* now in textform */
110 extern char * const sub_osd_names
[];
111 extern char * const sub_osd_names_short
[];
113 extern int sub_unicode
;
118 extern int sub_width_p
;
119 extern int sub_alignment
;
120 extern int sub_visibility
;
121 extern int sub_bg_color
; /* subtitles background color */
122 extern int sub_bg_alpha
;
123 extern int spu_alignment
;
124 extern int spu_aamode
;
125 extern float spu_gaussvar
;
127 void osd_draw_text(struct osd_state
*osd
, int dxs
, int dys
,
128 void (*draw_alpha
)(void *ctx
, int x0
, int y0
, int w
, int h
,
129 unsigned char* src
, unsigned char *srca
,
132 void osd_draw_text_ext(struct osd_state
*osd
, int dxs
, int dys
,
133 int left_border
, int top_border
, int right_border
,
134 int bottom_border
, int orig_w
, int orig_h
,
135 void (*draw_alpha
)(void *ctx
, int x0
, int y0
, int w
,
136 int h
, unsigned char* src
,
140 void osd_remove_text(struct osd_state
*osd
, int dxs
, int dys
,
141 void (*remove
)(int x0
, int y0
, int w
, int h
));
143 struct osd_state
*osd_create(void);
144 int osd_update(struct osd_state
*osd
, int dxs
, int dys
);
145 int vo_osd_changed(int new_value
);
146 int vo_osd_check_range_update(int,int,int,int);
147 void osd_free(struct osd_state
*osd
);
149 extern int vo_osd_changed_flag
;
151 unsigned utf8_get_char(const char **str
);
154 #include <inttypes.h>
155 void osd_set_nav_box (uint16_t sx
, uint16_t sy
, uint16_t ex
, uint16_t ey
);
160 #define vo_remove_text(...) osd_remove_text(global_osd, __VA_ARGS__)
163 #endif /* MPLAYER_SUB_H */