32467
|
1 /*
|
|
2 * This file is part of MPlayer.
|
|
3 *
|
|
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.
|
|
8 *
|
|
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.
|
|
13 *
|
|
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.
|
|
17 */
|
|
18
|
|
19 #ifndef MPLAYER_SUB_H
|
|
20 #define MPLAYER_SUB_H
|
|
21
|
|
22 typedef struct mp_osd_bbox_s {
|
|
23 int x1,y1,x2,y2;
|
|
24 } mp_osd_bbox_t;
|
|
25
|
|
26 #define OSDTYPE_OSD 1
|
|
27 #define OSDTYPE_SUBTITLE 2
|
|
28 #define OSDTYPE_PROGBAR 3
|
|
29 #define OSDTYPE_SPU 4
|
|
30 #define OSDTYPE_DVDNAV 5
|
|
31 #define OSDTYPE_TELETEXT 6
|
|
32
|
|
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
|
|
38
|
|
39 #define MAX_UCS 1600
|
|
40 #define MAX_UCSLINES 16
|
|
41
|
|
42 typedef struct mp_osd_obj_s {
|
|
43 struct mp_osd_obj_s* next;
|
|
44 unsigned char type;
|
|
45 unsigned char alignment; // 2 bits: x;y percentages, 2 bits: x;y relative to parent; 2 bits: alignment left/right/center
|
|
46 unsigned short flags;
|
|
47 int x,y;
|
|
48 int dxs,dys;
|
|
49 mp_osd_bbox_t bbox; // bounding box
|
|
50 mp_osd_bbox_t old_bbox; // the renderer will save bbox here
|
|
51 union {
|
|
52 struct {
|
|
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
|
|
57 } subtitle;
|
|
58 struct {
|
|
59 int elems;
|
|
60 } progbar;
|
|
61 } params;
|
|
62 int stride;
|
|
63
|
|
64 int allocated;
|
|
65 unsigned char *alpha_buffer;
|
|
66 unsigned char *bitmap_buffer;
|
|
67 } mp_osd_obj_t;
|
|
68
|
|
69
|
|
70 #include "subreader.h"
|
|
71
|
|
72 extern sub_data* subdata; //currently used subtitles
|
|
73 extern subtitle* vo_sub;
|
|
74
|
|
75 extern unsigned char* vo_osd_text;
|
|
76
|
|
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
|
|
82 extern int vo_osd_progbar_type;
|
|
83 extern int vo_osd_progbar_value; // 0..255
|
|
84
|
|
85 extern mp_osd_obj_t *vo_osd_list;
|
|
86
|
|
87 extern void* vo_spudec;
|
|
88 extern void* vo_vobsub;
|
|
89
|
|
90 #define OSD_PLAY 0x01
|
|
91 #define OSD_PAUSE 0x02
|
|
92 #define OSD_STOP 0x03
|
|
93 #define OSD_REW 0x04
|
|
94 #define OSD_FFW 0x05
|
|
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
|
|
100 #define OSD_HUE 0x0B
|
|
101 #define OSD_BALANCE 0x0C
|
|
102 #define OSD_PANSCAN 0x50
|
|
103
|
|
104 #define OSD_PB_START 0x10
|
|
105 #define OSD_PB_0 0x11
|
|
106 #define OSD_PB_END 0x12
|
|
107 #define OSD_PB_1 0x13
|
|
108
|
|
109 /* now in textform */
|
|
110 extern char * sub_osd_names[];
|
|
111 extern char * sub_osd_names_short[];
|
|
112
|
|
113 extern int sub_unicode;
|
|
114 extern int sub_utf8;
|
|
115
|
|
116 extern int sub_pos;
|
|
117 extern int sub_width_p;
|
|
118 extern int sub_alignment;
|
|
119 extern int sub_justify;
|
|
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;
|
|
126
|
|
127 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));
|
|
128 void vo_draw_text_ext(int dxs, int dys, int left_border, int top_border,
|
|
129 int right_border, int bottom_border, int orig_w, int orig_h,
|
|
130 void (*draw_alpha)(int x0, int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride));
|
|
131 void vo_remove_text(int dxs,int dys,void (*remove)(int x0,int y0, int w,int h));
|
|
132
|
|
133 void vo_init_osd(void);
|
|
134 int vo_update_osd(int dxs,int dys);
|
|
135 int vo_osd_changed(int new_value);
|
|
136 int vo_osd_check_range_update(int,int,int,int);
|
|
137 void free_osd_list(void);
|
|
138
|
|
139 extern int vo_osd_changed_flag;
|
|
140
|
|
141 unsigned utf8_get_char(const char **str);
|
|
142
|
|
143 #ifdef CONFIG_DVDNAV
|
|
144 #include <inttypes.h>
|
|
145 void osd_set_nav_box (uint16_t sx, uint16_t sy, uint16_t ex, uint16_t ey);
|
|
146 #endif
|
|
147
|
|
148 #endif /* MPLAYER_SUB_H */
|