diff options
Diffstat (limited to 'spudec.c')
-rw-r--r-- | spudec.c | 21 |
1 files changed, 11 insertions, 10 deletions
@@ -88,7 +88,7 @@ typedef struct { unsigned char *scaled_aimage; int auto_palette; /* 1 if we lack a palette and must use an heuristic. */ int font_start_level; /* Darkest value used for the computed font */ - const vo_functions_t *hw_spu; + struct vo *hw_spu; int spu_changed; unsigned int forced_subs_only; /* flag: 0=display all subtitle, !0 display only forced subtitles */ unsigned int is_forced_sub; /* true if current subtitle is a forced subtitle */ @@ -492,7 +492,7 @@ static void spudec_decode(spudec_handle_t *this, int pts100) packet.data = this->packet; packet.size = this->packet_size; packet.timestamp = pts100; - this->hw_spu->draw_frame((uint8_t**)&pkg); + vo_draw_frame(this->hw_spu, (uint8_t**)&pkg); } } @@ -743,8 +743,9 @@ static void scale_image(int x, int y, scale_pixel* table_x, scale_pixel* table_y } } -void sws_spu_image(unsigned char *d1, unsigned char *d2, int dw, int dh, int ds, - unsigned char *s1, unsigned char *s2, int sw, int sh, int ss) +static void sws_spu_image(unsigned char *d1, unsigned char *d2, int dw, int dh, + int ds, unsigned char *s1, unsigned char *s2, int sw, + int sh, int ss) { struct SwsContext *ctx; static SwsFilter filter; @@ -769,7 +770,7 @@ void sws_spu_image(unsigned char *d1, unsigned char *d2, int dw, int dh, int ds, sws_freeContext(ctx); } -void spudec_draw_scaled(void *me, unsigned int dxs, unsigned int dys, void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)) +void spudec_draw_scaled(void *me, 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) { spudec_handle_t *spu = (spudec_handle_t *)me; scale_pixel *table_x; @@ -786,7 +787,7 @@ void spudec_draw_scaled(void *me, unsigned int dxs, unsigned int dys, void (*dra || (spu->orig_frame_width == dxs && spu->orig_frame_height == dys))) { if (spu->image) { - draw_alpha(spu->start_col, spu->start_row, spu->width, spu->height, + draw_alpha(ctx, spu->start_col, spu->start_row, spu->width, spu->height, spu->image, spu->aimage, spu->stride); spu->spu_changed = 0; } @@ -1087,7 +1088,7 @@ nothing_to_do: spu->scaled_start_row = dys*sub_pos/100 - spu->scaled_height; break; } - draw_alpha(spu->scaled_start_col, spu->scaled_start_row, spu->scaled_width, spu->scaled_height, + draw_alpha(ctx, spu->scaled_start_col, spu->scaled_start_row, spu->scaled_width, spu->scaled_height, spu->scaled_image, spu->scaled_aimage, spu->scaled_stride); spu->spu_changed = 0; } @@ -1106,7 +1107,7 @@ void spudec_update_palette(void * this, unsigned int *palette) if (spu && palette) { memcpy(spu->global_palette, palette, sizeof(spu->global_palette)); if(spu->hw_spu) - spu->hw_spu->control(VOCTRL_SET_SPU_PALETTE,spu->global_palette); + vo_control(spu->hw_spu, VOCTRL_SET_SPU_PALETTE, spu->global_palette); } } @@ -1210,11 +1211,11 @@ void spudec_free(void *this) } } -void spudec_set_hw_spu(void *this, const vo_functions_t *hw_spu) +void spudec_set_hw_spu(void *this, struct vo *hw_spu) { spudec_handle_t *spu = (spudec_handle_t*)this; if (!spu) return; spu->hw_spu = hw_spu; - hw_spu->control(VOCTRL_SET_SPU_PALETTE,spu->global_palette); + vo_control(hw_spu, VOCTRL_SET_SPU_PALETTE, spu->global_palette); } |