summaryrefslogtreecommitdiffstats
path: root/spudec.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@symbol.nonexistent.invalid>2008-04-03 06:25:41 +0300
committerUoti Urpala <uau@symbol.nonexistent.invalid>2008-04-23 13:41:04 +0300
commit2bcfe1e077fe043751d3f7c73c82be761629419f (patch)
treed66207e0fad0af6d50b1d8a047d34570730a3413 /spudec.c
parent3bb140d847eb214cf71256794170d72616edbaf4 (diff)
downloadmpv-2bcfe1e077fe043751d3f7c73c82be761629419f.tar.bz2
mpv-2bcfe1e077fe043751d3f7c73c82be761629419f.tar.xz
Add new video driver API
Create new video driver API that has a per-instance context structure and does not rely on keeping status in global or static variables. Existing drivers are not yet converted to this API; instead there is a wrapper which translates calls to them. In the new API, an old API call vo_functions->xyz(args) is generally replaced by vo_xyz(vo_instance, args). The changes to keep the vesa, dxr2 and xover drivers compiling have not been tested.
Diffstat (limited to 'spudec.c')
-rw-r--r--spudec.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/spudec.c b/spudec.c
index 78a7865628..6e7899b13f 100644
--- a/spudec.c
+++ b/spudec.c
@@ -86,7 +86,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 */
@@ -490,7 +490,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);
}
}
@@ -1104,7 +1104,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);
}
}
@@ -1174,11 +1174,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);
}