Commit 6e8939e4 authored by Laurent Aimar's avatar Laurent Aimar

Made SPU commands go through vout.

parent a3988310
......@@ -163,6 +163,11 @@ VLC_EXPORT( void, vout_PutPicture, ( vout_thread_t *, picture_t *
VLC_EXPORT( void, vout_HoldPicture, ( vout_thread_t *, picture_t * ) );
VLC_EXPORT( void, vout_ReleasePicture, ( vout_thread_t *, picture_t * ) );
/* */
VLC_EXPORT( void, vout_PutSubpicture, ( vout_thread_t *, subpicture_t * ) );
VLC_EXPORT( int, vout_RegisterSubpictureChannel, ( vout_thread_t * ) );
VLC_EXPORT( void, vout_FlushSubpictureChannel, ( vout_thread_t *, int ) );
/**
* Return the spu_t object associated to a vout_thread_t.
*
......
......@@ -170,7 +170,7 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
* Alternatively, we should keep a reference to the vout thread. */
if( p_vout && p_vout != p_sys->p_last_vout )
for( unsigned i = 0; i < CHANNELS_NUMBER; i++ )
p_intf->p_sys->p_channels[i] = spu_RegisterChannel( vout_GetSpu( p_vout ) );
p_intf->p_sys->p_channels[i] = vout_RegisterSubpictureChannel( p_vout );
p_sys->p_last_vout = p_vout;
/* Quit */
......@@ -1073,9 +1073,8 @@ static void ClearChannels( intf_thread_t *p_intf, vout_thread_t *p_vout )
{
if( p_vout )
{
spu_t *p_spu = vout_GetSpu( p_vout );
spu_ClearChannel( p_spu, SPU_DEFAULT_CHANNEL );
vout_FlushSubpictureChannel( p_vout, SPU_DEFAULT_CHANNEL );
for( int i = 0; i < CHANNELS_NUMBER; i++ )
spu_ClearChannel( p_spu, p_intf->p_sys->p_channels[i] );
vout_FlushSubpictureChannel( p_vout, p_intf->p_sys->p_channels[i] );
}
}
......@@ -152,7 +152,7 @@ static int vlclua_spu_channel_register( lua_State *L )
if( !p_vout )
return luaL_error( L, "Unable to find vout." );
i_chan = spu_RegisterChannel( vout_GetSpu( p_vout ) );
i_chan = vout_RegisterSubpictureChannel( p_vout );
vlc_object_release( p_vout );
lua_pushinteger( L, i_chan );
return 1;
......@@ -167,7 +167,7 @@ static int vlclua_spu_channel_clear( lua_State *L )
if( !p_vout )
return luaL_error( L, "Unable to find vout." );
spu_ClearChannel( vout_GetSpu( p_vout ), i_chan );
vout_ClearSubpitureChannel( p_vout, i_chan );
vlc_object_release( p_vout );
return 0;
}
......
......@@ -1593,7 +1593,7 @@ static void DecoderPlaySpu( decoder_t *p_dec, subpicture_t *p_subpic,
p_subpic->i_start - SPU_MAX_PREPARE_TIME );
if( !b_reject )
spu_DisplaySubpicture( vout_GetSpu( p_vout ), p_subpic );
vout_PutSubpicture( p_vout, p_subpic );
else
subpicture_Delete( p_subpic );
......@@ -1935,8 +1935,7 @@ static void DecoderProcessSpu( decoder_t *p_dec, block_t *p_block, bool b_flush
p_vout = input_resource_HoldVout( p_input->p->p_resource );
if( p_vout && p_owner->p_spu_vout == p_vout )
spu_ClearChannel( vout_GetSpu( p_vout ),
p_owner->i_spu_channel );
vout_FlushSubpictureChannel( p_vout, p_owner->i_spu_channel );
if( p_vout )
vlc_object_release( p_vout );
......@@ -2098,7 +2097,7 @@ static void DeleteDecoder( decoder_t * p_dec )
if( p_vout )
{
if( p_owner->p_spu_vout == p_vout )
spu_ClearChannel( vout_GetSpu( p_vout ), p_owner->i_spu_channel );
vout_FlushSubpictureChannel( p_vout, p_owner->i_spu_channel );
vlc_object_release( p_vout );
}
}
......@@ -2427,7 +2426,7 @@ static subpicture_t *spu_new_buffer( decoder_t *p_dec,
vlc_mutex_unlock( &p_owner->lock );
p_owner->i_spu_channel = spu_RegisterChannel( vout_GetSpu( p_vout ) );
p_owner->i_spu_channel = vout_RegisterSubpictureChannel( p_vout );
p_owner->i_spu_order = 0;
p_owner->p_spu_vout = p_vout;
}
......
......@@ -273,7 +273,7 @@ static vout_thread_t *RequestVout( input_resource_t *p_resource,
{
msg_Dbg( p_resource->p_input, "saving a free vout" );
vout_Flush( p_vout, 1 );
spu_ClearChannel( vout_GetSpu( p_vout ), -1 );
vout_FlushSubpictureChannel( p_vout, -1 );
p_resource->p_vout_free = p_vout;
}
......
......@@ -614,6 +614,9 @@ vout_GetPicture
vout_PutPicture
vout_HoldPicture
vout_ReleasePicture
vout_PutSubpicture
vout_RegisterSubpictureChannel
vout_FlushSubpictureChannel
vout_EnableFilter
vout_GetSnapshot
vout_GetSpu
......
......@@ -315,7 +315,7 @@ int vout_OSDEpg( vout_thread_t *p_vout, input_item_t *p_input )
p_spu->b_absolute = true;
p_spu->b_fade = true;
spu_DisplaySubpicture( vout_GetSpu( p_vout ), p_spu );
vout_PutSubpicture( p_vout, p_spu );
return VLC_SUCCESS;
}
......@@ -506,6 +506,19 @@ void vout_DisplayTitle(vout_thread_t *vout, const char *title)
vout_control_PushString(&vout->p->control, VOUT_CONTROL_OSD_TITLE, title);
}
void vout_PutSubpicture( vout_thread_t *vout, subpicture_t *subpic )
{
spu_DisplaySubpicture(vout->p->p_spu, subpic);
}
int vout_RegisterSubpictureChannel( vout_thread_t *vout )
{
return spu_RegisterChannel(vout->p->p_spu);
}
void vout_FlushSubpictureChannel( vout_thread_t *vout, int channel )
{
spu_ClearChannel(vout->p->p_spu, channel);
}
spu_t *vout_GetSpu( vout_thread_t *p_vout )
{
return p_vout->p->p_spu;
......
......@@ -118,7 +118,7 @@ void vout_OSDText(vout_thread_t *vout, int channel,
subpic->b_absolute = false;
subpic->b_fade = true;
spu_DisplaySubpicture(vout_GetSpu(vout), subpic);
vout_PutSubpicture(vout, subpic);
}
void vout_OSDMessage(vout_thread_t *vout, int channel, const char *format, ...)
......
......@@ -309,7 +309,7 @@ static void OSDWidget(vout_thread_t *vout, int channel, int type, int position)
subpic->b_absolute = true;
subpic->b_fade = true;
spu_DisplaySubpicture(vout_GetSpu(vout), subpic);
vout_PutSubpicture(vout, subpic);
}
void vout_OSDSlider(vout_thread_t *vout, int channel, int position, short type)
......
......@@ -384,7 +384,7 @@ static int VoutSnapshotPip( vout_thread_t *p_vout, picture_t *p_pic )
p_subpic->i_original_picture_width *= 4;
p_subpic->i_original_picture_height *= 4;
spu_DisplaySubpicture( vout_GetSpu( p_vout ), p_subpic );
vout_PutSubpicture( p_vout, p_subpic );
return VLC_SUCCESS;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment