diff options
author | wm4 <wm4@nowhere> | 2012-10-04 17:16:47 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2012-10-16 07:26:32 +0200 |
commit | 3ad918bbc62449759bbf97f6a809ebdde27ad59e (patch) | |
tree | 24c3668687c5ebff37d6d1aaa0354d01310a0d8d /sub/spudec.h | |
parent | cc05910f16a5ccd8e3dca26a89e9c3835cbdb645 (diff) | |
download | mpv-3ad918bbc62449759bbf97f6a809ebdde27ad59e.tar.bz2 mpv-3ad918bbc62449759bbf97f6a809ebdde27ad59e.tar.xz |
sub: never decode subs to old OSD format
Instead, sd_lavc.c and spudec.c (the two image sub decoders) always
output indexed/paletted images. For this purpose, add SUBBITMAP_INDEXED,
and convert the subs to RGBA in img_convert.c instead. If a VO is used
that supports the old OSD format only, the indexed bitmaps are converted
to the old OSD format by abusing spudec.c in a similar way sd_lavc.c
used to do.
The main reason why spudec.c is used is because the images must not only
be converted to the old format, but also properly scaled, cropped, and
aligned (the asm code in libvo/osd.c requires this alignment).
Remove support for the old format (packed variant) from the OpenGL VOs.
(The packed formats were how the actual OSD format was handled in some
GPU-driven VOs for a while.)
Remove all conversions from old to new formats. Now all subtitle
decoders and OSD renderers produce the new formats only.
Add an evil hack to convert the new format (scaled+indexed bitmaps) to
the old format. It creates a new spudec instance to convert images to
grayscale and to scale them. This is temporary for VOs which don't
support new OSD formats yet (vo_xv, vo_x11, vo_lavc).
Diffstat (limited to 'sub/spudec.h')
-rw-r--r-- | sub/spudec.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sub/spudec.h b/sub/spudec.h index 2e2542128a..411aafeb19 100644 --- a/sub/spudec.h +++ b/sub/spudec.h @@ -22,14 +22,17 @@ #include <stdint.h> struct sub_bitmaps; +struct mp_eosd_res; void spudec_heartbeat(void *this, unsigned int pts100); void spudec_assemble(void *this, unsigned char *packet, unsigned int len, int pts100); void spudec_draw(void *this, void (*draw_alpha)(void *ctx, int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride), void *ctx); void spudec_draw_scaled(void *this, unsigned int dxs, unsigned int dys, void (*draw_alpha)(void *ctx, int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride), void *ctx); void spudec_get_bitmap(void *this, int w, int h, struct sub_bitmaps *res); +void spudec_get_indexed(void *this, struct mp_eosd_res *dim, struct sub_bitmaps *res); int spudec_apply_palette_crop(void *this, uint32_t palette, int sx, int ex, int sy, int ey); void *spudec_new_scaled(unsigned int *palette, unsigned int frame_width, unsigned int frame_height, uint8_t *extradata, int extradata_len); +void spudec_set_res(void *this, unsigned int frame_width, unsigned int frame_height); void *spudec_new(unsigned int *palette); void spudec_free(void *this); void spudec_reset(void *this); // called after seek |