2001-03-27 02:32:24 +02:00
|
|
|
|
2007-07-03 00:34:45 +02:00
|
|
|
#ifndef MPLAYER_SUB_H
|
|
|
|
#define MPLAYER_SUB_H
|
2001-04-24 13:42:04 +02:00
|
|
|
|
2002-04-15 21:17:12 +02:00
|
|
|
typedef struct mp_osd_bbox_s {
|
|
|
|
int x1,y1,x2,y2;
|
|
|
|
} mp_osd_bbox_t;
|
|
|
|
|
|
|
|
#define OSDTYPE_OSD 1
|
|
|
|
#define OSDTYPE_SUBTITLE 2
|
|
|
|
#define OSDTYPE_PROGBAR 3
|
|
|
|
#define OSDTYPE_SPU 4
|
2006-11-25 12:20:02 +01:00
|
|
|
#define OSDTYPE_DVDNAV 5
|
2007-07-29 19:57:39 +02:00
|
|
|
#define OSDTYPE_TELETEXT 6
|
2002-04-15 21:17:12 +02:00
|
|
|
|
|
|
|
#define OSDFLAG_VISIBLE 1
|
|
|
|
#define OSDFLAG_CHANGED 2
|
|
|
|
#define OSDFLAG_BBOX 4
|
|
|
|
#define OSDFLAG_OLD_BBOX 8
|
|
|
|
#define OSDFLAG_FORCE_UPDATE 16
|
|
|
|
|
|
|
|
#define MAX_UCS 1600
|
|
|
|
#define MAX_UCSLINES 16
|
|
|
|
|
|
|
|
typedef struct mp_osd_obj_s {
|
|
|
|
struct mp_osd_obj_s* next;
|
|
|
|
unsigned char type;
|
2003-10-04 19:29:08 +02:00
|
|
|
unsigned char alignment; // 2 bits: x;y percentages, 2 bits: x;y relative to parent; 2 bits: alignment left/right/center
|
2002-04-15 21:17:12 +02:00
|
|
|
unsigned short flags;
|
|
|
|
int x,y;
|
|
|
|
int dxs,dys;
|
|
|
|
mp_osd_bbox_t bbox; // bounding box
|
|
|
|
mp_osd_bbox_t old_bbox; // the renderer will save bbox here
|
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
void* sub; // value of vo_sub at last update
|
|
|
|
int utbl[MAX_UCS+1]; // subtitle text
|
|
|
|
int xtbl[MAX_UCSLINES]; // x positions
|
|
|
|
int lines; // no. of lines
|
|
|
|
} subtitle;
|
|
|
|
struct {
|
|
|
|
int elems;
|
|
|
|
} progbar;
|
|
|
|
} params;
|
2002-08-28 22:45:42 +02:00
|
|
|
int stride;
|
|
|
|
|
|
|
|
int allocated;
|
|
|
|
unsigned char *alpha_buffer;
|
|
|
|
unsigned char *bitmap_buffer;
|
2002-04-15 21:17:12 +02:00
|
|
|
} mp_osd_obj_t;
|
|
|
|
|
|
|
|
|
2001-05-24 22:48:45 +02:00
|
|
|
#if 0
|
|
|
|
|
|
|
|
// disable subtitles:
|
|
|
|
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)){
|
|
|
|
}
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
2004-10-28 03:15:53 +02:00
|
|
|
#include "subreader.h"
|
2001-04-24 13:42:04 +02:00
|
|
|
|
2006-11-29 15:08:24 +01:00
|
|
|
extern sub_data* subdata; //currently used subtitles
|
|
|
|
extern subtitle* vo_sub;
|
|
|
|
|
2001-03-27 02:32:24 +02:00
|
|
|
extern unsigned char* vo_osd_text;
|
|
|
|
|
2007-07-29 19:57:39 +02:00
|
|
|
extern void* vo_osd_teletext_page;
|
|
|
|
extern int vo_osd_teletext_half;
|
|
|
|
extern int vo_osd_teletext_mode;
|
|
|
|
extern int vo_osd_teletext_format;
|
|
|
|
|
2001-03-27 02:32:24 +02:00
|
|
|
extern int vo_osd_progbar_type;
|
|
|
|
extern int vo_osd_progbar_value; // 0..255
|
|
|
|
|
2001-11-20 19:36:50 +01:00
|
|
|
extern void* vo_spudec;
|
2002-01-10 18:20:27 +01:00
|
|
|
extern void* vo_vobsub;
|
2001-11-20 19:36:50 +01:00
|
|
|
|
2001-03-27 02:32:24 +02:00
|
|
|
#define OSD_PLAY 0x01
|
|
|
|
#define OSD_PAUSE 0x02
|
|
|
|
#define OSD_STOP 0x03
|
|
|
|
#define OSD_REW 0x04
|
|
|
|
#define OSD_FFW 0x05
|
|
|
|
#define OSD_CLOCK 0x06
|
|
|
|
#define OSD_CONTRAST 0x07
|
|
|
|
#define OSD_SATURATION 0x08
|
|
|
|
#define OSD_VOLUME 0x09
|
|
|
|
#define OSD_BRIGHTNESS 0x0A
|
|
|
|
#define OSD_HUE 0x0B
|
2007-06-20 04:26:20 +02:00
|
|
|
#define OSD_BALANCE 0x0C
|
2002-06-04 22:17:07 +02:00
|
|
|
#define OSD_PANSCAN 0x50
|
2001-03-27 02:32:24 +02:00
|
|
|
|
|
|
|
#define OSD_PB_START 0x10
|
|
|
|
#define OSD_PB_0 0x11
|
|
|
|
#define OSD_PB_END 0x12
|
|
|
|
#define OSD_PB_1 0x13
|
|
|
|
|
2001-08-16 17:18:46 +02:00
|
|
|
/* now in textform */
|
2007-08-15 12:34:53 +02:00
|
|
|
extern char * sub_osd_names[];
|
|
|
|
extern char * sub_osd_names_short[];
|
2001-08-16 17:18:46 +02:00
|
|
|
|
2002-04-17 23:51:18 +02:00
|
|
|
extern int sub_unicode;
|
|
|
|
extern int sub_utf8;
|
|
|
|
|
|
|
|
extern char *sub_cp;
|
|
|
|
extern int sub_pos;
|
2002-12-27 22:41:40 +01:00
|
|
|
extern int sub_width_p;
|
2002-12-23 02:37:43 +01:00
|
|
|
extern int sub_alignment;
|
2002-10-06 19:40:51 +02:00
|
|
|
extern int sub_visibility;
|
2002-12-28 16:03:23 +01:00
|
|
|
extern int sub_bg_color; /* subtitles background color */
|
|
|
|
extern int sub_bg_alpha;
|
2003-01-24 11:24:07 +01:00
|
|
|
extern int spu_alignment;
|
|
|
|
extern int spu_aamode;
|
|
|
|
extern float spu_gaussvar;
|
2002-04-17 23:51:18 +02:00
|
|
|
|
2001-05-28 17:12:14 +02:00
|
|
|
//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));
|
2001-05-24 22:48:45 +02:00
|
|
|
//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));
|
|
|
|
//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));
|
2008-04-04 05:36:36 +02:00
|
|
|
extern void osd_draw_text(int dxs,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);
|
2002-04-16 02:35:01 +02:00
|
|
|
extern void vo_remove_text(int dxs,int dys,void (*remove)(int x0,int y0, int w,int h));
|
2001-03-27 02:32:24 +02:00
|
|
|
|
2006-02-09 15:08:03 +01:00
|
|
|
void vo_init_osd(void);
|
2002-04-15 21:17:12 +02:00
|
|
|
int vo_update_osd(int dxs,int dys);
|
2002-02-22 16:25:11 +01:00
|
|
|
int vo_osd_changed(int new_value);
|
2002-05-12 04:18:52 +02:00
|
|
|
int vo_osd_check_range_update(int,int,int,int);
|
2006-02-09 15:08:03 +01:00
|
|
|
void free_osd_list(void);
|
2002-02-22 16:25:11 +01:00
|
|
|
|
2002-04-16 00:08:50 +02:00
|
|
|
extern int vo_osd_changed_flag;
|
|
|
|
|
2006-12-11 23:37:17 +01:00
|
|
|
unsigned utf8_get_char(const char **str);
|
2006-07-07 20:04:56 +02:00
|
|
|
|
2006-11-25 18:44:22 +01:00
|
|
|
#ifdef USE_DVDNAV
|
2006-11-25 18:58:14 +01:00
|
|
|
#include <inttypes.h>
|
2006-11-25 18:44:22 +01:00
|
|
|
void osd_set_nav_box (uint16_t sx, uint16_t sy, uint16_t ex, uint16_t ey);
|
|
|
|
#endif
|
|
|
|
|
2008-01-06 13:57:26 +01:00
|
|
|
#endif /* 0 */
|
2007-12-31 17:15:50 +01:00
|
|
|
|
|
|
|
#endif /* MPLAYER_SUB_H */
|