annotate libvo/sub.h @ 9077:d430529c5b4b

Improvements to spudec (DVD/VobSub) subtitle code: - runtime selectable positioning, like with text subs - runtime selectable scaling/antialiasing algorithm - gaussian blur scaler (finally dvd/vobsub doesn't look like shit!)
author rfelker
date Fri, 24 Jan 2003 10:24:07 +0000
parents 6ffbe7608013
children 6e35326c742f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
616
41d6eec69b60 clean up
pontscho
parents: 254
diff changeset
1
41d6eec69b60 clean up
pontscho
parents: 254
diff changeset
2 #ifndef __MPLAYER_SUB_H
41d6eec69b60 clean up
pontscho
parents: 254
diff changeset
3 #define __MPLAYER_SUB_H
41d6eec69b60 clean up
pontscho
parents: 254
diff changeset
4
5638
86663f1b9b00 new osd code, use osd objs to follow changes and do minimal updates
arpi
parents: 5294
diff changeset
5 typedef struct mp_osd_bbox_s {
86663f1b9b00 new osd code, use osd objs to follow changes and do minimal updates
arpi
parents: 5294
diff changeset
6 int x1,y1,x2,y2;
86663f1b9b00 new osd code, use osd objs to follow changes and do minimal updates
arpi
parents: 5294
diff changeset
7 } mp_osd_bbox_t;
86663f1b9b00 new osd code, use osd objs to follow changes and do minimal updates
arpi
parents: 5294
diff changeset
8
86663f1b9b00 new osd code, use osd objs to follow changes and do minimal updates
arpi
parents: 5294
diff changeset
9 #define OSDTYPE_OSD 1
86663f1b9b00 new osd code, use osd objs to follow changes and do minimal updates
arpi
parents: 5294
diff changeset
10 #define OSDTYPE_SUBTITLE 2
86663f1b9b00 new osd code, use osd objs to follow changes and do minimal updates
arpi
parents: 5294
diff changeset
11 #define OSDTYPE_PROGBAR 3
86663f1b9b00 new osd code, use osd objs to follow changes and do minimal updates
arpi
parents: 5294
diff changeset
12 #define OSDTYPE_SPU 4
86663f1b9b00 new osd code, use osd objs to follow changes and do minimal updates
arpi
parents: 5294
diff changeset
13
86663f1b9b00 new osd code, use osd objs to follow changes and do minimal updates
arpi
parents: 5294
diff changeset
14 #define OSDFLAG_VISIBLE 1
86663f1b9b00 new osd code, use osd objs to follow changes and do minimal updates
arpi
parents: 5294
diff changeset
15 #define OSDFLAG_CHANGED 2
86663f1b9b00 new osd code, use osd objs to follow changes and do minimal updates
arpi
parents: 5294
diff changeset
16 #define OSDFLAG_BBOX 4
86663f1b9b00 new osd code, use osd objs to follow changes and do minimal updates
arpi
parents: 5294
diff changeset
17 #define OSDFLAG_OLD_BBOX 8
86663f1b9b00 new osd code, use osd objs to follow changes and do minimal updates
arpi
parents: 5294
diff changeset
18 #define OSDFLAG_FORCE_UPDATE 16
86663f1b9b00 new osd code, use osd objs to follow changes and do minimal updates
arpi
parents: 5294
diff changeset
19
86663f1b9b00 new osd code, use osd objs to follow changes and do minimal updates
arpi
parents: 5294
diff changeset
20 #define MAX_UCS 1600
86663f1b9b00 new osd code, use osd objs to follow changes and do minimal updates
arpi
parents: 5294
diff changeset
21 #define MAX_UCSLINES 16
86663f1b9b00 new osd code, use osd objs to follow changes and do minimal updates
arpi
parents: 5294
diff changeset
22
86663f1b9b00 new osd code, use osd objs to follow changes and do minimal updates
arpi
parents: 5294
diff changeset
23 typedef struct mp_osd_obj_s {
86663f1b9b00 new osd code, use osd objs to follow changes and do minimal updates
arpi
parents: 5294
diff changeset
24 struct mp_osd_obj_s* next;
86663f1b9b00 new osd code, use osd objs to follow changes and do minimal updates
arpi
parents: 5294
diff changeset
25 unsigned char type;
86663f1b9b00 new osd code, use osd objs to follow changes and do minimal updates
arpi
parents: 5294
diff changeset
26 unsigned char alignment; // 2 bits: x;y percents, 2 bits: x;y relative to parent; 2 bits: alignment left/right/center
86663f1b9b00 new osd code, use osd objs to follow changes and do minimal updates
arpi
parents: 5294
diff changeset
27 unsigned short flags;
86663f1b9b00 new osd code, use osd objs to follow changes and do minimal updates
arpi
parents: 5294
diff changeset
28 int x,y;
86663f1b9b00 new osd code, use osd objs to follow changes and do minimal updates
arpi
parents: 5294
diff changeset
29 int dxs,dys;
86663f1b9b00 new osd code, use osd objs to follow changes and do minimal updates
arpi
parents: 5294
diff changeset
30 mp_osd_bbox_t bbox; // bounding box
86663f1b9b00 new osd code, use osd objs to follow changes and do minimal updates
arpi
parents: 5294
diff changeset
31 mp_osd_bbox_t old_bbox; // the renderer will save bbox here
86663f1b9b00 new osd code, use osd objs to follow changes and do minimal updates
arpi
parents: 5294
diff changeset
32 union {
86663f1b9b00 new osd code, use osd objs to follow changes and do minimal updates
arpi
parents: 5294
diff changeset
33 struct {
86663f1b9b00 new osd code, use osd objs to follow changes and do minimal updates
arpi
parents: 5294
diff changeset
34 void* sub; // value of vo_sub at last update
86663f1b9b00 new osd code, use osd objs to follow changes and do minimal updates
arpi
parents: 5294
diff changeset
35 int utbl[MAX_UCS+1]; // subtitle text
86663f1b9b00 new osd code, use osd objs to follow changes and do minimal updates
arpi
parents: 5294
diff changeset
36 int xtbl[MAX_UCSLINES]; // x positions
86663f1b9b00 new osd code, use osd objs to follow changes and do minimal updates
arpi
parents: 5294
diff changeset
37 int lines; // no. of lines
86663f1b9b00 new osd code, use osd objs to follow changes and do minimal updates
arpi
parents: 5294
diff changeset
38 } subtitle;
86663f1b9b00 new osd code, use osd objs to follow changes and do minimal updates
arpi
parents: 5294
diff changeset
39 struct {
86663f1b9b00 new osd code, use osd objs to follow changes and do minimal updates
arpi
parents: 5294
diff changeset
40 int elems;
86663f1b9b00 new osd code, use osd objs to follow changes and do minimal updates
arpi
parents: 5294
diff changeset
41 } progbar;
86663f1b9b00 new osd code, use osd objs to follow changes and do minimal updates
arpi
parents: 5294
diff changeset
42 } params;
7121
6abc330b5b32 subtitle/osd cache - pre-render text to a buffer with alpha and bitmap separated
arpi
parents: 6304
diff changeset
43 int stride;
6abc330b5b32 subtitle/osd cache - pre-render text to a buffer with alpha and bitmap separated
arpi
parents: 6304
diff changeset
44
6abc330b5b32 subtitle/osd cache - pre-render text to a buffer with alpha and bitmap separated
arpi
parents: 6304
diff changeset
45 int allocated;
6abc330b5b32 subtitle/osd cache - pre-render text to a buffer with alpha and bitmap separated
arpi
parents: 6304
diff changeset
46 unsigned char *alpha_buffer;
6abc330b5b32 subtitle/osd cache - pre-render text to a buffer with alpha and bitmap separated
arpi
parents: 6304
diff changeset
47 unsigned char *bitmap_buffer;
5638
86663f1b9b00 new osd code, use osd objs to follow changes and do minimal updates
arpi
parents: 5294
diff changeset
48 } mp_osd_obj_t;
86663f1b9b00 new osd code, use osd objs to follow changes and do minimal updates
arpi
parents: 5294
diff changeset
49
86663f1b9b00 new osd code, use osd objs to follow changes and do minimal updates
arpi
parents: 5294
diff changeset
50
865
83919c1b9924 removed redundant osd.h includes
arpi_esp
parents: 616
diff changeset
51 #if 0
83919c1b9924 removed redundant osd.h includes
arpi_esp
parents: 616
diff changeset
52
83919c1b9924 removed redundant osd.h includes
arpi_esp
parents: 616
diff changeset
53 // disable subtitles:
83919c1b9924 removed redundant osd.h includes
arpi_esp
parents: 616
diff changeset
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)){
83919c1b9924 removed redundant osd.h includes
arpi_esp
parents: 616
diff changeset
55 }
83919c1b9924 removed redundant osd.h includes
arpi_esp
parents: 616
diff changeset
56
83919c1b9924 removed redundant osd.h includes
arpi_esp
parents: 616
diff changeset
57 #else
83919c1b9924 removed redundant osd.h includes
arpi_esp
parents: 616
diff changeset
58
616
41d6eec69b60 clean up
pontscho
parents: 254
diff changeset
59 #include "../subreader.h"
218
fbfc2077ba72 sub/osd interface changes
arpi_esp
parents:
diff changeset
60
fbfc2077ba72 sub/osd interface changes
arpi_esp
parents:
diff changeset
61 extern unsigned char* vo_osd_text;
fbfc2077ba72 sub/osd interface changes
arpi_esp
parents:
diff changeset
62
fbfc2077ba72 sub/osd interface changes
arpi_esp
parents:
diff changeset
63 extern int vo_osd_progbar_type;
fbfc2077ba72 sub/osd interface changes
arpi_esp
parents:
diff changeset
64 extern int vo_osd_progbar_value; // 0..255
fbfc2077ba72 sub/osd interface changes
arpi_esp
parents:
diff changeset
65
254
57f0156416e3 use subreader's sub struct
arpi_esp
parents: 218
diff changeset
66 extern subtitle* vo_sub;
218
fbfc2077ba72 sub/osd interface changes
arpi_esp
parents:
diff changeset
67
3034
24d3dca4e813 DVD sub patch by Kim Minh Kaplan <kmkaplan@selfoffice.com>
arpi
parents: 2498
diff changeset
68 extern void* vo_spudec;
4080
47bcafe1442e Add vobsub support.
kmkaplan
parents: 3034
diff changeset
69 extern void* vo_vobsub;
3034
24d3dca4e813 DVD sub patch by Kim Minh Kaplan <kmkaplan@selfoffice.com>
arpi
parents: 2498
diff changeset
70
218
fbfc2077ba72 sub/osd interface changes
arpi_esp
parents:
diff changeset
71 #define OSD_PLAY 0x01
fbfc2077ba72 sub/osd interface changes
arpi_esp
parents:
diff changeset
72 #define OSD_PAUSE 0x02
fbfc2077ba72 sub/osd interface changes
arpi_esp
parents:
diff changeset
73 #define OSD_STOP 0x03
fbfc2077ba72 sub/osd interface changes
arpi_esp
parents:
diff changeset
74 #define OSD_REW 0x04
fbfc2077ba72 sub/osd interface changes
arpi_esp
parents:
diff changeset
75 #define OSD_FFW 0x05
fbfc2077ba72 sub/osd interface changes
arpi_esp
parents:
diff changeset
76 #define OSD_CLOCK 0x06
fbfc2077ba72 sub/osd interface changes
arpi_esp
parents:
diff changeset
77 #define OSD_CONTRAST 0x07
fbfc2077ba72 sub/osd interface changes
arpi_esp
parents:
diff changeset
78 #define OSD_SATURATION 0x08
fbfc2077ba72 sub/osd interface changes
arpi_esp
parents:
diff changeset
79 #define OSD_VOLUME 0x09
fbfc2077ba72 sub/osd interface changes
arpi_esp
parents:
diff changeset
80 #define OSD_BRIGHTNESS 0x0A
fbfc2077ba72 sub/osd interface changes
arpi_esp
parents:
diff changeset
81 #define OSD_HUE 0x0B
6304
ee65527096c2 pan&scan support with -vo xv by ?? <mplayer@svennevid.net>
arpi
parents: 6110
diff changeset
82 #define OSD_PANSCAN 0x50
218
fbfc2077ba72 sub/osd interface changes
arpi_esp
parents:
diff changeset
83
fbfc2077ba72 sub/osd interface changes
arpi_esp
parents:
diff changeset
84 #define OSD_PB_START 0x10
fbfc2077ba72 sub/osd interface changes
arpi_esp
parents:
diff changeset
85 #define OSD_PB_0 0x11
fbfc2077ba72 sub/osd interface changes
arpi_esp
parents:
diff changeset
86 #define OSD_PB_END 0x12
fbfc2077ba72 sub/osd interface changes
arpi_esp
parents:
diff changeset
87 #define OSD_PB_1 0x13
fbfc2077ba72 sub/osd interface changes
arpi_esp
parents:
diff changeset
88
1552
ce8e8c342004 changes made for vo_aa
folke
parents: 898
diff changeset
89 /* now in textform */
2498
38bb41c48d1f never declare variables in *.h files, pls
nick
parents: 1910
diff changeset
90 extern char * __sub_osd_names[];
38bb41c48d1f never declare variables in *.h files, pls
nick
parents: 1910
diff changeset
91 extern char * __sub_osd_names_short[];
1552
ce8e8c342004 changes made for vo_aa
folke
parents: 898
diff changeset
92
5669
391931fa79a6 enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents: 5645
diff changeset
93 extern int sub_unicode;
391931fa79a6 enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents: 5645
diff changeset
94 extern int sub_utf8;
391931fa79a6 enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents: 5645
diff changeset
95
391931fa79a6 enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents: 5645
diff changeset
96 #ifdef USE_ICONV
391931fa79a6 enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents: 5645
diff changeset
97 extern char *sub_cp;
391931fa79a6 enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents: 5645
diff changeset
98 #endif
391931fa79a6 enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents: 5645
diff changeset
99 extern int sub_pos;
8583
4c18c4e7f34e -subwidth
arpi
parents: 8534
diff changeset
100 extern int sub_width_p;
8534
922ce27eb683 This patch adds support for vertical subtitle alignment
arpi
parents: 8361
diff changeset
101 extern int sub_alignment;
7628
d6608342591d This patch adds the functionality to disable/enable subtitles while playing
arpi
parents: 7121
diff changeset
102 extern int sub_visibility;
8361
2202c00001e3 overlapping subtitles support is now optional, can be disabled (-nooverlapsub)
arpi
parents: 7628
diff changeset
103 extern int suboverlap_enabled;
8617
6ffbe7608013 Me: -sub-bg-* would be nicer. "Background" is usually shortened as "bg", not "bkg".
rathann
parents: 8601
diff changeset
104 extern int sub_bg_color; /* subtitles background color */
6ffbe7608013 Me: -sub-bg-* would be nicer. "Background" is usually shortened as "bg", not "bkg".
rathann
parents: 8601
diff changeset
105 extern int sub_bg_alpha;
9077
d430529c5b4b Improvements to spudec (DVD/VobSub) subtitle code:
rfelker
parents: 8617
diff changeset
106 extern int spu_alignment;
d430529c5b4b Improvements to spudec (DVD/VobSub) subtitle code:
rfelker
parents: 8617
diff changeset
107 extern int spu_aamode;
d430529c5b4b Improvements to spudec (DVD/VobSub) subtitle code:
rfelker
parents: 8617
diff changeset
108 extern float spu_gaussvar;
5669
391931fa79a6 enabled new OSD code in -vop expand, subtitles rendering support to mencoder
arpi
parents: 5645
diff changeset
109
898
ae80adb64752 argh. i commented out wrong lines
arpi_esp
parents: 865
diff changeset
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
83919c1b9924 removed redundant osd.h includes
arpi_esp
parents: 616
diff changeset
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));
83919c1b9924 removed redundant osd.h includes
arpi_esp
parents: 616
diff changeset
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
ae80adb64752 argh. i commented out wrong lines
arpi_esp
parents: 865
diff changeset
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
bd5c0d8346f0 vo_osd_check_range_update() added + 10l fix
arpi
parents: 5642
diff changeset
114 extern void vo_remove_text(int dxs,int dys,void (*remove)(int x0,int y0, int w,int h));
218
fbfc2077ba72 sub/osd interface changes
arpi_esp
parents:
diff changeset
115
5638
86663f1b9b00 new osd code, use osd objs to follow changes and do minimal updates
arpi
parents: 5294
diff changeset
116 void vo_init_osd();
86663f1b9b00 new osd code, use osd objs to follow changes and do minimal updates
arpi
parents: 5294
diff changeset
117 int vo_update_osd(int dxs,int dys);
4807
156482788caf osd outside movie support for vo_sdl, patch by Fredrik Kuivinen
atmos4
parents: 4080
diff changeset
118 int vo_osd_changed(int new_value);
6057
31e465fda59c various openbsd and general warning fixes - patch by Bj«Órn Sandell <biorn@dce.chalmers.se>
arpi
parents: 5669
diff changeset
119 int vo_osd_check_range_update(int,int,int,int);
4807
156482788caf osd outside movie support for vo_sdl, patch by Fredrik Kuivinen
atmos4
parents: 4080
diff changeset
120
5642
eb0cb6185e6c osd: ok, now it's possible to do partial draw/clear of the buffer only if changed
arpi
parents: 5638
diff changeset
121 extern int vo_osd_changed_flag;
eb0cb6185e6c osd: ok, now it's possible to do partial draw/clear of the buffer only if changed
arpi
parents: 5638
diff changeset
122
616
41d6eec69b60 clean up
pontscho
parents: 254
diff changeset
123 #endif
865
83919c1b9924 removed redundant osd.h includes
arpi_esp
parents: 616
diff changeset
124 #endif