Commit 3624290f authored by Laurent Aimar's avatar Laurent Aimar

No functionnal changes (vout)

parent 7ea9a56d
......@@ -64,9 +64,6 @@ static int FilterCallback( vlc_object_t *, char const *,
static int VideoFilter2Callback( vlc_object_t *, char const *,
vlc_value_t, vlc_value_t, void * );
/* Display media title in OSD */
static void DisplayTitleOnOSD( vout_thread_t *p_vout );
/* */
static void PrintVideoFormat(vout_thread_t *, const char *, const video_format_t *);
......@@ -878,59 +875,15 @@ static int ThreadDisplayPicture(vout_thread_t *vout,
return VLC_SUCCESS;
}
/*****************************************************************************
* Thread: video output thread
*****************************************************************************
* Video output thread. This function does only returns when the thread is
* terminated. It handles the pictures arriving in the video heap and the
* display device events.
*****************************************************************************/
static void *Thread(void *object)
static int ThreadManage(vout_thread_t *vout,
mtime_t *deadline,
vout_interlacing_support_t *interlacing,
vout_postprocessing_support_t *postprocessing)
{
vout_thread_t *vout = object;
bool has_wrapper;
/*
* Initialize thread
*/
has_wrapper = !vout_OpenWrapper(vout, vout->p->psz_module_name);
vlc_mutex_lock(&vout->p->change_lock);
if (has_wrapper)
vout->p->b_error = ThreadInit(vout);
else
vout->p->b_error = true;
/* signal the creation of the vout */
vout->p->b_ready = true;
vlc_cond_signal(&vout->p->change_wait);
if (vout->p->b_error)
goto exit_thread;
/* */
vout_interlacing_support_t interlacing = {
.is_interlaced = false,
.date = mdate(),
};
vout_postprocessing_support_t postprocessing = {
.qtype = QTYPE_NONE,
};
/*
* Main loop - it is not executed if an error occurred during
* initialization
*/
while (!vout->p->b_done && !vout->p->b_error) {
/* */
if(vout->p->title.show && vout->p->title.value)
DisplayTitleOnOSD(vout);
vlc_mutex_lock(&vout->p->picture_lock);
mtime_t deadline = VLC_TS_INVALID;
bool has_displayed = !ThreadDisplayPicture(vout, vout->p->step.is_requested, &deadline);
*deadline = VLC_TS_INVALID;
bool has_displayed = !ThreadDisplayPicture(vout, vout->p->step.is_requested, deadline);
if (has_displayed) {
vout->p->step.timestamp = vout->p->displayed.timestamp;
......@@ -958,21 +911,49 @@ static void *Thread(void *object)
vlc_mutex_unlock(&vout->p->picture_lock);
/* Post processing */
vout_SetPostProcessingState(vout, postprocessing, picture_qtype);
/* Deinterlacing */
vout_SetInterlacingState(vout, interlacing, picture_interlaced);
if (vout_ManageWrapper(vout)) {
/* A fatal error occurred, and the thread must terminate
* immediately, without displaying anything - setting b_error to 1
* causes the immediate end of the main while() loop. */
// FIXME pf_end
vout->p->b_error = true;
break;
return VLC_EGENERIC;
}
return VLC_SUCCESS;
}
/* Post processing */
vout_SetPostProcessingState(vout, &postprocessing, picture_qtype);
static void ThreadDisplayOsdTitle(vout_thread_t *vout)
{
if (!vout->p->title.show || !vout->p->title.value)
return;
/* Deinterlacing */
vout_SetInterlacingState(vout, &interlacing, picture_interlaced);
vlc_assert_locked(&vout->p->change_lock);
const mtime_t start = mdate();
const mtime_t stop = start +
INT64_C(1000) * vout->p->title.timeout;
if (stop > start)
vout_ShowTextAbsolute(vout, DEFAULT_CHAN,
vout->p->title.value, NULL,
vout->p->title.position,
30 + vout->fmt_in.i_width
- vout->fmt_in.i_visible_width
- vout->fmt_in.i_x_offset,
20 + vout->fmt_in.i_y_offset,
start, stop);
free(vout->p->title.value);
vout->p->title.value = NULL;
}
static void ThreadChangeFilter(vout_thread_t *vout)
{
/* Check for "video filter2" changes */
vlc_mutex_lock(&vout->p->vfilter_lock);
if (vout->p->psz_vf2) {
......@@ -990,6 +971,63 @@ static void *Thread(void *object)
vout->p->psz_vf2 = NULL;
}
vlc_mutex_unlock(&vout->p->vfilter_lock);
}
/*****************************************************************************
* Thread: video output thread
*****************************************************************************
* Video output thread. This function does only returns when the thread is
* terminated. It handles the pictures arriving in the video heap and the
* display device events.
*****************************************************************************/
static void *Thread(void *object)
{
vout_thread_t *vout = object;
bool has_wrapper;
/*
* Initialize thread
*/
has_wrapper = !vout_OpenWrapper(vout, vout->p->psz_module_name);
vlc_mutex_lock(&vout->p->change_lock);
if (has_wrapper)
vout->p->b_error = ThreadInit(vout);
else
vout->p->b_error = true;
/* signal the creation of the vout */
vout->p->b_ready = true;
vlc_cond_signal(&vout->p->change_wait);
if (vout->p->b_error)
goto exit_thread;
/* */
vout_interlacing_support_t interlacing = {
.is_interlaced = false,
.date = mdate(),
};
vout_postprocessing_support_t postprocessing = {
.qtype = QTYPE_NONE,
};
/*
* Main loop - it is not executed if an error occurred during
* initialization
*/
while (!vout->p->b_done && !vout->p->b_error) {
/* */
mtime_t deadline;
if (ThreadManage(vout, &deadline,
&interlacing, &postprocessing)) {
vout->p->b_error = true;
break;
}
ThreadDisplayOsdTitle(vout);
ThreadChangeFilter(vout);
vlc_mutex_unlock(&vout->p->change_lock);
......@@ -1078,30 +1116,6 @@ static int VideoFilter2Callback( vlc_object_t *p_this, char const *psz_cmd,
return VLC_SUCCESS;
}
static void DisplayTitleOnOSD( vout_thread_t *p_vout )
{
const mtime_t i_start = mdate();
const mtime_t i_stop = i_start + INT64_C(1000) * p_vout->p->title.timeout;
if( i_stop <= i_start )
return;
vlc_assert_locked( &p_vout->p->change_lock );
vout_ShowTextAbsolute( p_vout, DEFAULT_CHAN,
p_vout->p->title.value, NULL,
p_vout->p->title.position,
30 + p_vout->fmt_in.i_width
- p_vout->fmt_in.i_visible_width
- p_vout->fmt_in.i_x_offset,
20 + p_vout->fmt_in.i_y_offset,
i_start, i_stop );
free( p_vout->p->title.value );
p_vout->p->title.value = NULL;
}
/* */
static void PrintVideoFormat(vout_thread_t *vout,
const char *description,
......
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