annotate sub/sub.h @ 33793:a1a4df3986f8

build: Rely on Libav/FFmpeg build system to run clean targets. This saves some maintenance work going forward.
author diego
date Tue, 12 Jul 2011 14:12:41 +0000
parents 732cd2afae10
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
32467
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
1 /*
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
2 * This file is part of MPlayer.
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
3 *
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
4 * MPlayer is free software; you can redistribute it and/or modify
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
5 * it under the terms of the GNU General Public License as published by
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
6 * the Free Software Foundation; either version 2 of the License, or
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
7 * (at your option) any later version.
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
8 *
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
9 * MPlayer is distributed in the hope that it will be useful,
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
12 * GNU General Public License for more details.
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
13 *
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
14 * You should have received a copy of the GNU General Public License along
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
15 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
17 */
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
18
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
19 #ifndef MPLAYER_SUB_H
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
20 #define MPLAYER_SUB_H
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
21
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
22 typedef struct mp_osd_bbox_s {
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
23 int x1,y1,x2,y2;
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
24 } mp_osd_bbox_t;
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
25
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
26 #define OSDTYPE_OSD 1
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
27 #define OSDTYPE_SUBTITLE 2
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
28 #define OSDTYPE_PROGBAR 3
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
29 #define OSDTYPE_SPU 4
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
30 #define OSDTYPE_DVDNAV 5
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
31 #define OSDTYPE_TELETEXT 6
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
32
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
33 #define OSDFLAG_VISIBLE 1
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
34 #define OSDFLAG_CHANGED 2
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
35 #define OSDFLAG_BBOX 4
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
36 #define OSDFLAG_OLD_BBOX 8
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
37 #define OSDFLAG_FORCE_UPDATE 16
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
38
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
39 #define MAX_UCS 1600
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
40 #define MAX_UCSLINES 16
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
41
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
42 typedef struct mp_osd_obj_s {
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
43 struct mp_osd_obj_s* next;
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
44 unsigned char type;
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
45 unsigned char alignment; // 2 bits: x;y percentages, 2 bits: x;y relative to parent; 2 bits: alignment left/right/center
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
46 unsigned short flags;
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
47 int x,y;
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
48 int dxs,dys;
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
49 mp_osd_bbox_t bbox; // bounding box
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
50 mp_osd_bbox_t old_bbox; // the renderer will save bbox here
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
51 union {
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
52 struct {
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
53 void* sub; // value of vo_sub at last update
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
54 int utbl[MAX_UCS+1]; // subtitle text
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
55 int xtbl[MAX_UCSLINES]; // x positions
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
56 int lines; // no. of lines
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
57 } subtitle;
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
58 struct {
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
59 int elems;
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
60 } progbar;
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
61 } params;
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
62 int stride;
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
63
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
64 int allocated;
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
65 unsigned char *alpha_buffer;
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
66 unsigned char *bitmap_buffer;
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
67 } mp_osd_obj_t;
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
68
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
69
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
70 #include "subreader.h"
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
71
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
72 extern sub_data* subdata; //currently used subtitles
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
73 extern subtitle* vo_sub;
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
74
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
75 extern unsigned char* vo_osd_text;
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
76
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
77 extern void* vo_osd_teletext_page;
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
78 extern int vo_osd_teletext_half;
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
79 extern int vo_osd_teletext_mode;
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
80 extern int vo_osd_teletext_format;
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
81
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
82 extern int vo_osd_progbar_type;
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
83 extern int vo_osd_progbar_value; // 0..255
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
84
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
85 extern mp_osd_obj_t *vo_osd_list;
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
86
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
87 extern void* vo_spudec;
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
88 extern void* vo_vobsub;
32724
732cd2afae10 Replace hacky vobsub loading with a new clean one.
cboesch
parents: 32467
diff changeset
89 extern char *vobsub_name;
32467
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
90
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
91 #define OSD_PLAY 0x01
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
92 #define OSD_PAUSE 0x02
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
93 #define OSD_STOP 0x03
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
94 #define OSD_REW 0x04
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
95 #define OSD_FFW 0x05
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
96 #define OSD_CLOCK 0x06
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
97 #define OSD_CONTRAST 0x07
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
98 #define OSD_SATURATION 0x08
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
99 #define OSD_VOLUME 0x09
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
100 #define OSD_BRIGHTNESS 0x0A
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
101 #define OSD_HUE 0x0B
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
102 #define OSD_BALANCE 0x0C
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
103 #define OSD_PANSCAN 0x50
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
104
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
105 #define OSD_PB_START 0x10
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
106 #define OSD_PB_0 0x11
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
107 #define OSD_PB_END 0x12
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
108 #define OSD_PB_1 0x13
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
109
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
110 /* now in textform */
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
111 extern char * sub_osd_names[];
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
112 extern char * sub_osd_names_short[];
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
113
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
114 extern int sub_unicode;
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
115 extern int sub_utf8;
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
116
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
117 extern int sub_pos;
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
118 extern int sub_width_p;
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
119 extern int sub_alignment;
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
120 extern int sub_justify;
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
121 extern int sub_visibility;
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
122 extern int sub_bg_color; /* subtitles background color */
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
123 extern int sub_bg_alpha;
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
124 extern int spu_alignment;
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
125 extern int spu_aamode;
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
126 extern float spu_gaussvar;
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
127
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
128 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));
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
129 void vo_draw_text_ext(int dxs, int dys, int left_border, int top_border,
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
130 int right_border, int bottom_border, int orig_w, int orig_h,
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
131 void (*draw_alpha)(int x0, int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride));
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
132 void vo_remove_text(int dxs,int dys,void (*remove)(int x0,int y0, int w,int h));
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
133
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
134 void vo_init_osd(void);
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
135 int vo_update_osd(int dxs,int dys);
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
136 int vo_osd_changed(int new_value);
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
137 int vo_osd_check_range_update(int,int,int,int);
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
138 void free_osd_list(void);
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
139
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
140 extern int vo_osd_changed_flag;
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
141
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
142 unsigned utf8_get_char(const char **str);
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
143
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
144 #ifdef CONFIG_DVDNAV
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
145 #include <inttypes.h>
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
146 void osd_set_nav_box (uint16_t sx, uint16_t sy, uint16_t ex, uint16_t ey);
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
147 #endif
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
148
fbe5c829c69b Move libvo/sub.[ch] from libvo to sub.
cigaes
parents:
diff changeset
149 #endif /* MPLAYER_SUB_H */