[vlc-commits] commit: Used vout_control_Push for vout_PutSubpicture. (Laurent Aimar )
git at videolan.org
git at videolan.org
Tue May 25 22:01:21 CEST 2010
vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Tue May 25 21:03:20 2010 +0200| [a224dc9915bc8a4d337be2addbb52460155000ae] | committer: Laurent Aimar
Used vout_control_Push for vout_PutSubpicture.
It will be needed if we want to remove one of the timeout in the main vout
thread. It also avoids 1 access of vout->p->p_spu outside of the vout thread.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a224dc9915bc8a4d337be2addbb52460155000ae
---
src/video_output/control.c | 4 ++++
src/video_output/control.h | 2 ++
src/video_output/video_output.c | 15 ++++++++++++++-
3 files changed, 20 insertions(+), 1 deletions(-)
diff --git a/src/video_output/control.c b/src/video_output/control.c
index 64c96f6..57bb45f 100644
--- a/src/video_output/control.c
+++ b/src/video_output/control.c
@@ -39,6 +39,10 @@ void vout_control_cmd_Init(vout_control_cmd_t *cmd, int type)
void vout_control_cmd_Clean(vout_control_cmd_t *cmd)
{
switch (cmd->type) {
+ case VOUT_CONTROL_SUBPICTURE:
+ if (cmd->u.subpicture)
+ subpicture_Delete(cmd->u.subpicture);
+ break;
case VOUT_CONTROL_OSD_TITLE:
case VOUT_CONTROL_CHANGE_FILTERS:
case VOUT_CONTROL_CHANGE_SUB_FILTERS:
diff --git a/src/video_output/control.h b/src/video_output/control.h
index b47cd45..c9c1cf0 100644
--- a/src/video_output/control.h
+++ b/src/video_output/control.h
@@ -39,6 +39,7 @@ enum {
VOUT_CONTROL_START,
VOUT_CONTROL_STOP,
#endif
+ VOUT_CONTROL_SUBPICTURE, /* subpicture */
VOUT_CONTROL_OSD_TITLE, /* string */
VOUT_CONTROL_CHANGE_FILTERS, /* string */
VOUT_CONTROL_CHANGE_SUB_FILTERS, /* string */
@@ -92,6 +93,7 @@ typedef struct {
unsigned height;
} window;
const vout_configuration_t *cfg;
+ subpicture_t *subpicture;
} u;
} vout_control_cmd_t;
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 0bf78c8..248829e 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -349,7 +349,11 @@ void vout_DisplayTitle(vout_thread_t *vout, const char *title)
void vout_PutSubpicture( vout_thread_t *vout, subpicture_t *subpic )
{
- spu_DisplaySubpicture(vout->p->p_spu, subpic);
+ vout_control_cmd_t cmd;
+ vout_control_cmd_Init(&cmd, VOUT_CONTROL_SUBPICTURE);
+ cmd.u.subpicture = subpic;
+
+ vout_control_Push(&vout->p->control, &cmd);
}
int vout_RegisterSubpictureChannel( vout_thread_t *vout )
{
@@ -749,6 +753,11 @@ static void ThreadManage(vout_thread_t *vout,
vout_ManageWrapper(vout);
}
+static void ThreadDisplaySubpicture(vout_thread_t *vout,
+ subpicture_t *subpicture)
+{
+ spu_DisplaySubpicture(vout->p->p_spu, subpicture);
+}
static void ThreadDisplayOsdTitle(vout_thread_t *vout, const char *string)
{
if (!vout->p->title.show)
@@ -1100,6 +1109,10 @@ static void *Thread(void *object)
if (ThreadReinit(vout, cmd.u.cfg))
return NULL;
break;
+ case VOUT_CONTROL_SUBPICTURE:
+ ThreadDisplaySubpicture(vout, cmd.u.subpicture);
+ cmd.u.subpicture = NULL;
+ break;
case VOUT_CONTROL_OSD_TITLE:
ThreadDisplayOsdTitle(vout, cmd.u.string);
break;
More information about the vlc-commits
mailing list