[vlc-devel] [PATCH v2 02/13] video_output: use filter lock to change deinterlacing in the vout thread
Steve Lhomme
robux4 at ycbcr.xyz
Mon Aug 17 15:15:21 CEST 2020
We don't use the control lock anymore, just the filters lock.
Now the interlacing mode change is applied in frame by frame mode.
Remove related control push/clean functions.
---
src/video_output/control.c | 8 --------
src/video_output/control.h | 3 ---
src/video_output/video_output.c | 13 +++++++------
3 files changed, 7 insertions(+), 17 deletions(-)
diff --git a/src/video_output/control.c b/src/video_output/control.c
index db9c30b32ad..96d598f81ad 100644
--- a/src/video_output/control.c
+++ b/src/video_output/control.c
@@ -87,14 +87,6 @@ void vout_control_PushVoid(vout_control_t *ctrl, int type)
vout_control_cmd_Init(&cmd, type);
vout_control_Push(ctrl, &cmd);
}
-void vout_control_PushBool(vout_control_t *ctrl, int type, bool boolean)
-{
- vout_control_cmd_t cmd;
-
- vout_control_cmd_Init(&cmd, type);
- cmd.boolean = boolean;
- vout_control_Push(ctrl, &cmd);
-}
void vout_control_Hold(vout_control_t *ctrl)
{
diff --git a/src/video_output/control.h b/src/video_output/control.h
index ed4613d6c14..5d84db34d13 100644
--- a/src/video_output/control.h
+++ b/src/video_output/control.h
@@ -28,7 +28,6 @@
/* */
enum {
VOUT_CONTROL_TERMINATE,
- VOUT_CONTROL_CHANGE_INTERLACE, /* boolean */
VOUT_CONTROL_MOUSE_STATE, /* vlc_mouse_t */
};
@@ -37,7 +36,6 @@ typedef struct {
int type;
union {
- bool boolean;
vlc_mouse_t mouse;
};
} vout_control_cmd_t;
@@ -66,7 +64,6 @@ void vout_control_WaitEmpty(vout_control_t *);
void vout_control_Push(vout_control_t *, vout_control_cmd_t *);
void vout_control_PushVoid(vout_control_t *, int type);
-void vout_control_PushBool(vout_control_t *, int type, bool boolean);
void vout_control_Wake(vout_control_t *);
void vout_control_Hold(vout_control_t *);
void vout_control_Release(vout_control_t *);
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index c934430dae8..778fdc99ae7 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -172,6 +172,7 @@ typedef struct vout_thread_sys_t
/* Video filter2 chain */
struct {
vlc_mutex_t lock;
+ bool new_interlaced;
bool filters_changed;
char *new_filters;
char *configuration;
@@ -764,7 +765,9 @@ void vout_ControlChangeInterlacing(vout_thread_t *vout, bool set)
{
vout_thread_sys_t *sys = VOUT_THREAD_TO_SYS(vout);
assert(!sys->dummy);
- vout_control_PushBool(&sys->control, VOUT_CONTROL_CHANGE_INTERLACE, set);
+ vlc_mutex_lock(&sys->filter.lock);
+ sys->filter.new_interlaced = set;
+ vlc_mutex_unlock(&sys->filter.lock);
}
void vout_ControlChangeSubSources(vout_thread_t *vout, const char *filters)
@@ -1460,8 +1463,9 @@ static int ThreadDisplayPicture(vout_thread_sys_t *vout, vlc_tick_t *deadline)
assert(sys->clock);
vlc_mutex_lock(&sys->filter.lock);
- if (sys->filter.filters_changed)
- ThreadChangeFilters(vout, sys->filter.new_filters, NULL, true);
+ if (sys->filter.filters_changed ||
+ sys->filter.new_interlaced != sys->private.interlacing.has_deint)
+ ThreadChangeFilters(vout, sys->filter.new_filters, &sys->filter.new_interlaced, true);
vlc_mutex_unlock(&sys->filter.lock);
if (first)
@@ -1884,9 +1888,6 @@ static void *Thread(void *object)
switch(cmd.type) {
case VOUT_CONTROL_TERMINATE:
return NULL; /* no need to clean &cmd */
- case VOUT_CONTROL_CHANGE_INTERLACE:
- ThreadChangeFilters(vout, NULL, &cmd.boolean, false);
- break;
case VOUT_CONTROL_MOUSE_STATE:
ThreadProcessMouseState(vout, &cmd.mouse);
break;
--
2.26.2
More information about the vlc-devel
mailing list