Commit 1983e0b9 authored by Thomas Guillem's avatar Thomas Guillem

vout: interlacing: move struct into vout_internal.h

parent 7cc833cc
......@@ -30,6 +30,7 @@
#include <vlc_vout.h>
#include "interlacing.h"
#include "vout_internal.h"
/*****************************************************************************
* Deinterlacing
......@@ -230,22 +231,28 @@ void vout_InitInterlacingSupport(vout_thread_t *vout, bool is_interlaced)
var_SetInteger(vout, "deinterlace", deinterlace_state);
free(deinterlace_mode);
vout->p->interlacing.is_interlaced = is_interlaced;
if (is_interlaced)
vout->p->interlacing.date = mdate();
}
void vout_SetInterlacingState(vout_thread_t *vout, vout_interlacing_support_t *state, bool is_interlaced)
void vout_SetInterlacingState(vout_thread_t *vout, bool is_interlaced)
{
/* Wait 30s before quiting interlacing mode */
const int interlacing_change = (!!is_interlaced) - (!!state->is_interlaced);
if ((interlacing_change == 1) ||
(interlacing_change == -1 && state->date + 30000000 < mdate())) {
const int interlacing_change = (!!is_interlaced)
- (!!vout->p->interlacing.is_interlaced);
if (interlacing_change == 1 ||
(interlacing_change == -1 &&
vout->p->interlacing.date + 30000000 < mdate()))
{
msg_Dbg(vout, "Detected %s video",
is_interlaced ? "interlaced" : "progressive");
var_SetBool(vout, "deinterlace-needed", is_interlaced);
state->is_interlaced = is_interlaced;
vout->p->interlacing.is_interlaced = is_interlaced;
}
if (is_interlaced)
state->date = mdate();
vout->p->interlacing.date = mdate();
}
......@@ -24,12 +24,7 @@
#ifndef LIBVLC_VOUT_INTERLACING_H
#define LIBVLC_VOUT_INTERLACING_H
typedef struct {
bool is_interlaced;
mtime_t date;
} vout_interlacing_support_t;
void vout_InitInterlacingSupport(vout_thread_t *, bool is_interlaced);
void vout_SetInterlacingState(vout_thread_t *, vout_interlacing_support_t *, bool is_interlaced);
void vout_SetInterlacingState(vout_thread_t *, bool is_interlaced);
#endif
......@@ -1627,11 +1627,6 @@ static void *Thread(void *object)
vout_thread_t *vout = object;
vout_thread_sys_t *sys = vout->p;
vout_interlacing_support_t interlacing = {
.is_interlaced = false,
.date = mdate(),
};
mtime_t deadline = VLC_TS_INVALID;
bool wait = false;
for (;;) {
......@@ -1653,7 +1648,7 @@ static void *Thread(void *object)
const bool picture_interlaced = sys->displayed.is_interlaced;
vout_SetInterlacingState(vout, &interlacing, picture_interlaced);
vout_SetInterlacingState(vout, picture_interlaced);
vout_ManageWrapper(vout);
}
}
......@@ -109,6 +109,11 @@ struct vout_thread_sys_t
int position;
} title;
struct {
bool is_interlaced;
mtime_t date;
} interlacing;
/* */
bool is_late_dropped;
......
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