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)
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:
......
......@@ -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;
......
......@@ -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;
......
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