Commit a224dc99 authored by Laurent Aimar's avatar 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.
parent 211f72ff
...@@ -39,6 +39,10 @@ void vout_control_cmd_Init(vout_control_cmd_t *cmd, int type) ...@@ -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) void vout_control_cmd_Clean(vout_control_cmd_t *cmd)
{ {
switch (cmd->type) { 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_OSD_TITLE:
case VOUT_CONTROL_CHANGE_FILTERS: case VOUT_CONTROL_CHANGE_FILTERS:
case VOUT_CONTROL_CHANGE_SUB_FILTERS: case VOUT_CONTROL_CHANGE_SUB_FILTERS:
......
...@@ -39,6 +39,7 @@ enum { ...@@ -39,6 +39,7 @@ enum {
VOUT_CONTROL_START, VOUT_CONTROL_START,
VOUT_CONTROL_STOP, VOUT_CONTROL_STOP,
#endif #endif
VOUT_CONTROL_SUBPICTURE, /* subpicture */
VOUT_CONTROL_OSD_TITLE, /* string */ VOUT_CONTROL_OSD_TITLE, /* string */
VOUT_CONTROL_CHANGE_FILTERS, /* string */ VOUT_CONTROL_CHANGE_FILTERS, /* string */
VOUT_CONTROL_CHANGE_SUB_FILTERS, /* string */ VOUT_CONTROL_CHANGE_SUB_FILTERS, /* string */
...@@ -92,6 +93,7 @@ typedef struct { ...@@ -92,6 +93,7 @@ typedef struct {
unsigned height; unsigned height;
} window; } window;
const vout_configuration_t *cfg; const vout_configuration_t *cfg;
subpicture_t *subpicture;
} u; } u;
} vout_control_cmd_t; } vout_control_cmd_t;
......
...@@ -349,7 +349,11 @@ void vout_DisplayTitle(vout_thread_t *vout, const char *title) ...@@ -349,7 +349,11 @@ void vout_DisplayTitle(vout_thread_t *vout, const char *title)
void vout_PutSubpicture( vout_thread_t *vout, subpicture_t *subpic ) 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 ) int vout_RegisterSubpictureChannel( vout_thread_t *vout )
{ {
...@@ -749,6 +753,11 @@ static void ThreadManage(vout_thread_t *vout, ...@@ -749,6 +753,11 @@ static void ThreadManage(vout_thread_t *vout,
vout_ManageWrapper(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) static void ThreadDisplayOsdTitle(vout_thread_t *vout, const char *string)
{ {
if (!vout->p->title.show) if (!vout->p->title.show)
...@@ -1100,6 +1109,10 @@ static void *Thread(void *object) ...@@ -1100,6 +1109,10 @@ static void *Thread(void *object)
if (ThreadReinit(vout, cmd.u.cfg)) if (ThreadReinit(vout, cmd.u.cfg))
return NULL; return NULL;
break; break;
case VOUT_CONTROL_SUBPICTURE:
ThreadDisplaySubpicture(vout, cmd.u.subpicture);
cmd.u.subpicture = NULL;
break;
case VOUT_CONTROL_OSD_TITLE: case VOUT_CONTROL_OSD_TITLE:
ThreadDisplayOsdTitle(vout, cmd.u.string); ThreadDisplayOsdTitle(vout, cmd.u.string);
break; break;
......
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