616
|
1
|
|
2 #ifndef __MPLAYER_SUB_H
|
|
3 #define __MPLAYER_SUB_H
|
|
4
|
5638
|
5 typedef struct mp_osd_bbox_s {
|
|
6 int x1,y1,x2,y2;
|
|
7 } mp_osd_bbox_t;
|
|
8
|
|
9 #define OSDTYPE_OSD 1
|
|
10 #define OSDTYPE_SUBTITLE 2
|
|
11 #define OSDTYPE_PROGBAR 3
|
|
12 #define OSDTYPE_SPU 4
|
|
13
|
|
14 #define OSDFLAG_VISIBLE 1
|
|
15 #define OSDFLAG_CHANGED 2
|
|
16 #define OSDFLAG_BBOX 4
|
|
17 #define OSDFLAG_OLD_BBOX 8
|
|
18 #define OSDFLAG_FORCE_UPDATE 16
|
|
19
|
|
20 #define MAX_UCS 1600
|
|
21 #define MAX_UCSLINES 16
|
|
22
|
|
23 typedef struct mp_osd_obj_s {
|
|
24 struct mp_osd_obj_s* next;
|
|
25 unsigned char type;
|
|
26 unsigned char alignment; // 2 bits: x;y percents, 2 bits: x;y relative to parent; 2 bits: alignment left/right/center
|
|
27 unsigned short flags;
|
|
28 int x,y;
|
|
29 int dxs,dys;
|
|
30 mp_osd_bbox_t bbox; // bounding box
|
|
31 mp_osd_bbox_t old_bbox; // the renderer will save bbox here
|
|
32 union {
|
|
33 struct {
|
|
34 void* sub; // value of vo_sub at last update
|
|
35 int utbl[MAX_UCS+1]; // subtitle text
|
|
36 int xtbl[MAX_UCSLINES]; // x positions
|
|
37 int lines; // no. of lines
|
|
38 } subtitle;
|
|
39 struct {
|
|
40 int elems;
|
|
41 } progbar;
|
|
42 } params;
|
7121
|
43 int stride;
|
|
44
|
|
45 int allocated;
|
|
46 unsigned char *alpha_buffer;
|
|
47 unsigned char *bitmap_buffer;
|
5638
|
48 } mp_osd_obj_t;
|
|
49
|
|
50
|
865
|
51 #if 0
|
|
52
|
|
53 // disable subtitles:
|
|
54 static inline void vo_draw_text_osd(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)){
|
|
55 }
|
|
56
|
|
57 #else
|
|
58
|
616
|
59 #include "../subreader.h"
|
218
|
60
|
|
61 extern unsigned char* vo_osd_text;
|
|
62
|
|
63 extern int vo_osd_progbar_type;
|
|
64 extern int vo_osd_progbar_value; // 0..255
|
|
65
|
254
|
66 extern subtitle* vo_sub;
|
218
|
67
|
3034
|
68 extern void* vo_spudec;
|
4080
|
69 extern void* vo_vobsub;
|
3034
|
70
|
218
|
71 #define OSD_PLAY 0x01
|
|
72 #define OSD_PAUSE 0x02
|
|
73 #define OSD_STOP 0x03
|
|
74 #define OSD_REW 0x04
|
|
75 #define OSD_FFW 0x05
|
|
76 #define OSD_CLOCK 0x06
|
|
77 #define OSD_CONTRAST 0x07
|
|
78 #define OSD_SATURATION 0x08
|
|
79 #define OSD_VOLUME 0x09
|
|
80 #define OSD_BRIGHTNESS 0x0A
|
|
81 #define OSD_HUE 0x0B
|
6304
|
82 #define OSD_PANSCAN 0x50
|
218
|
83
|
|
84 #define OSD_PB_START 0x10
|
|
85 #define OSD_PB_0 0x11
|
|
86 #define OSD_PB_END 0x12
|
|
87 #define OSD_PB_1 0x13
|
|
88
|
1552
|
89 /* now in textform */
|
2498
|
90 extern char * __sub_osd_names[];
|
|
91 extern char * __sub_osd_names_short[];
|
1552
|
92
|
5669
|
93 extern int sub_unicode;
|
|
94 extern int sub_utf8;
|
|
95
|
|
96 #ifdef USE_ICONV
|
|
97 extern char *sub_cp;
|
|
98 #endif
|
|
99 extern int sub_pos;
|
8583
|
100 extern int sub_width_p;
|
8534
|
101 extern int sub_alignment;
|
7628
|
102 extern int sub_visibility;
|
8361
|
103 extern int suboverlap_enabled;
|
8617
|
104 extern int sub_bg_color; /* subtitles background color */
|
|
105 extern int sub_bg_alpha;
|
9077
|
106 extern int spu_alignment;
|
|
107 extern int spu_aamode;
|
|
108 extern float spu_gaussvar;
|
5669
|
109
|
898
|
110 //extern void vo_draw_text_osd(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride));
|
865
|
111 //extern void vo_draw_text_progbar(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride));
|
|
112 //extern void vo_draw_text_sub(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride));
|
898
|
113 extern 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));
|
5645
|
114 extern void vo_remove_text(int dxs,int dys,void (*remove)(int x0,int y0, int w,int h));
|
218
|
115
|
5638
|
116 void vo_init_osd();
|
|
117 int vo_update_osd(int dxs,int dys);
|
4807
|
118 int vo_osd_changed(int new_value);
|
6057
|
119 int vo_osd_check_range_update(int,int,int,int);
|
4807
|
120
|
5642
|
121 extern int vo_osd_changed_flag;
|
|
122
|
616
|
123 #endif
|
865
|
124 #endif
|