#ifndef _MPLAYER_SPUDEC_H
#define _MPLAYER_SPUDEC_H

#include "libvo/video_out.h"

void spudec_heartbeat(void *this, unsigned int pts100);
void spudec_assemble(void *this, unsigned char *packet, unsigned int len, unsigned int pts100);
#define DVDNAV_SPU_YUV	1
#define DVDNAV_SPU_RGB	2
#define DVDNAV_SPU_BGR	3
#define DVDNAV_SPU_YUY	4

void spu_yuv_to_rgb(unsigned int y,unsigned int u,unsigned int v,
    unsigned int *r,unsigned int *g,unsigned int *b);
void spudec_dvdnav_mode(void *this, int mode, int cflg);
void spudec_dvdnav_area(void *this, uint16_t sx, uint16_t sy,
    uint16_t ex, uint16_t ey, uint32_t palette);
void spudec_dvdnav_palette(void *this, uint32_t palette);
int spudec_dvdnav_menu_box(void *this, int scaled, unsigned int scalex,
    unsigned int scaley);
void spudec_new_scaled_yuv(unsigned int *palette, unsigned int frame_width,
    unsigned int frame_height);
void spudec_new_scaled_rgb(unsigned int *palette, unsigned int frame_width,
    unsigned int frame_height);
void spudec_draw_scaled_yuv(void *me, unsigned int dxs, unsigned int dys,
    void (*draw_alpha)(int x0,int y0, int w,int h, int dp, unsigned char* src, unsigned char *srca, int stride));
void spudec_draw_scaled_rgb(void *me, unsigned int dxs, unsigned int dys,
    void (*draw_alpha)(int x0,int y0, int w,int h, int dp, unsigned char* src, unsigned char *srca, int stride));
void spudec_create_yuy(void *this, int spu_scaled);

void spudec_draw(void *this, void (*draw_alpha)(int x0,int y0, int w,int h, int dp, unsigned char* src, unsigned char *srca, int stride));
void spudec_draw_scaled(void *this, unsigned int dxs, unsigned int dys, void (*draw_alpha)(int x0,int y0, int w,int h, int dp, unsigned char* src, unsigned char *srca, int stride));
void spudec_update_palette(void *this, unsigned int *palette);
void *spudec_new_scaled(unsigned int *palette, unsigned int frame_width, unsigned int frame_height);
void *spudec_new_scaled_vobsub(unsigned int *palette, unsigned int *cuspal, unsigned int custom, 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
int spudec_visible(void *this); // check if spu is visible
void spudec_set_font_factor(void * this, double factor); // sets the equivalent to ffactor
void spudec_set_hw_spu(void *this, vo_functions_t *hw_spu);
int spudec_changed(void *this);
void spudec_calc_bbox(void *me, unsigned int dxs, unsigned int dys, unsigned int* bbox);
void spudec_draw_scaled(void *me, unsigned int dxs, unsigned int dys, void (*draw_alpha)(int x0,int y0, int w,int h, int dp, unsigned char* src, unsigned char *srca, int stride));
void spudec_set_forced_subs_only(void * const this, const unsigned int flag);
#endif

