[vlc-commits] commit: Made SPU commands go through vout. (Laurent Aimar )
git at videolan.org
git at videolan.org
Mon May 10 23:02:38 CEST 2010
vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Mon May 10 22:38:49 2010 +0200| [6e8939e4961f2f471a702db016939156f99ded5f] | committer: Laurent Aimar
Made SPU commands go through vout.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6e8939e4961f2f471a702db016939156f99ded5f
---
include/vlc_vout.h | 5 +++++
modules/control/hotkeys.c | 7 +++----
modules/misc/lua/libs/osd.c | 4 ++--
src/input/decoder.c | 9 ++++-----
src/input/resource.c | 2 +-
src/libvlccore.sym | 3 +++
src/video_output/video_epg.c | 2 +-
src/video_output/video_output.c | 13 +++++++++++++
src/video_output/video_text.c | 2 +-
src/video_output/video_widgets.c | 2 +-
src/video_output/vout_intf.c | 2 +-
11 files changed, 35 insertions(+), 16 deletions(-)
diff --git a/include/vlc_vout.h b/include/vlc_vout.h
index 2e14ef7..2d3f0b2 100644
--- a/include/vlc_vout.h
+++ b/include/vlc_vout.h
@@ -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.
*
diff --git a/modules/control/hotkeys.c b/modules/control/hotkeys.c
index cbf1965..b1444d7 100644
--- a/modules/control/hotkeys.c
+++ b/modules/control/hotkeys.c
@@ -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] );
}
}
diff --git a/modules/misc/lua/libs/osd.c b/modules/misc/lua/libs/osd.c
index acba508..8d757a0 100644
--- a/modules/misc/lua/libs/osd.c
+++ b/modules/misc/lua/libs/osd.c
@@ -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;
}
diff --git a/src/input/decoder.c b/src/input/decoder.c
index 9c0aa3d..e5f84dd 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -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;
}
diff --git a/src/input/resource.c b/src/input/resource.c
index ba3cf7e..64cfa52 100644
--- a/src/input/resource.c
+++ b/src/input/resource.c
@@ -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;
}
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index 308f19b..ffb933a 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -614,6 +614,9 @@ vout_GetPicture
vout_PutPicture
vout_HoldPicture
vout_ReleasePicture
+vout_PutSubpicture
+vout_RegisterSubpictureChannel
+vout_FlushSubpictureChannel
vout_EnableFilter
vout_GetSnapshot
vout_GetSpu
diff --git a/src/video_output/video_epg.c b/src/video_output/video_epg.c
index 5f89457..48d31d7 100644
--- a/src/video_output/video_epg.c
+++ b/src/video_output/video_epg.c
@@ -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;
}
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 8467ca8..cc706c6 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -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;
diff --git a/src/video_output/video_text.c b/src/video_output/video_text.c
index 6ac6af6..8bf7a71 100644
--- a/src/video_output/video_text.c
+++ b/src/video_output/video_text.c
@@ -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, ...)
diff --git a/src/video_output/video_widgets.c b/src/video_output/video_widgets.c
index f8835d2..5d3e21b 100644
--- a/src/video_output/video_widgets.c
+++ b/src/video_output/video_widgets.c
@@ -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)
diff --git a/src/video_output/vout_intf.c b/src/video_output/vout_intf.c
index 7c2c8c5..4cf3b5e 100644
--- a/src/video_output/vout_intf.c
+++ b/src/video_output/vout_intf.c
@@ -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;
}
More information about the vlc-commits
mailing list