[vlc-devel] [PATCH v5 23/24] video_output: remove unused control API

Steve Lhomme robux4 at ycbcr.xyz
Mon Aug 24 09:42:04 CEST 2020


---
 src/Makefile.am                 |  2 -
 src/video_output/control.c      | 86 ---------------------------------
 src/video_output/control.h      | 64 ------------------------
 src/video_output/video_output.c |  4 +-
 4 files changed, 1 insertion(+), 155 deletions(-)
 delete mode 100644 src/video_output/control.c
 delete mode 100644 src/video_output/control.h

diff --git a/src/Makefile.am b/src/Makefile.am
index 9e7c2931d27..3bef0703e3e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -306,8 +306,6 @@ libvlccore_la_SOURCES = \
 	audio_output/output.c \
 	audio_output/volume.c \
 	video_output/chrono.h \
-	video_output/control.c \
-	video_output/control.h \
 	video_output/display.c \
 	video_output/display.h \
 	video_output/inhibit.c \
diff --git a/src/video_output/control.c b/src/video_output/control.c
deleted file mode 100644
index 83a08043e3a..00000000000
--- a/src/video_output/control.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/*****************************************************************************
- * control.c : vout internal control
- *****************************************************************************
- * Copyright (C) 2009 Laurent Aimar
- *
- * Authors: Laurent Aimar <fenrir _AT_ videolan _DOT_ org>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <vlc_common.h>
-#include <vlc_vout.h>
-#include "vout_internal.h"
-#include "control.h"
-
-/* */
-void vout_control_cmd_Init(vout_control_cmd_t *cmd, int type)
-{
-    memset(cmd, 0, sizeof(*cmd));
-    cmd->type = type;
-}
-
-/* */
-void vout_control_Init(vout_control_t *ctrl)
-{
-    ctrl->can_sleep = true;
-    ARRAY_INIT(ctrl->cmd);
-}
-
-void vout_control_Clean(vout_control_t *ctrl)
-{
-    /* */
-    ARRAY_RESET(ctrl->cmd);
-}
-
-void vout_control_Push(vout_control_t *ctrl, vout_control_cmd_t *cmd)
-{
-    {
-        ARRAY_APPEND(ctrl->cmd, *cmd);
-    }
-}
-
-void vout_control_Wake(vout_control_t *ctrl)
-{
-    ctrl->can_sleep = false;
-}
-
-int vout_control_Pop(vout_control_t *ctrl, vout_control_cmd_t *cmd,
-                     vlc_tick_t deadline, vlc_cond_t *wait_request, vlc_mutex_t *lock)
-{
-    if (ctrl->cmd.i_size <= 0) {
-        /* Spurious wakeups are perfectly fine */
-        if (deadline != INVALID_DEADLINE && ctrl->can_sleep) {
-            vlc_cond_timedwait(wait_request, lock, deadline);
-        }
-    }
-
-    bool has_cmd;
-    if (ctrl->cmd.i_size > 0) {
-        has_cmd = true;
-        *cmd = ARRAY_VAL(ctrl->cmd, 0);
-        ARRAY_REMOVE(ctrl->cmd, 0);
-    } else {
-        has_cmd = false;
-        ctrl->can_sleep = true;
-    }
-
-    return has_cmd ? VLC_SUCCESS : VLC_EGENERIC;
-}
-
diff --git a/src/video_output/control.h b/src/video_output/control.h
deleted file mode 100644
index a5bbef577b6..00000000000
--- a/src/video_output/control.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*****************************************************************************
- * control.h : vout internal control
- *****************************************************************************
- * Copyright (C) 2009-2010 Laurent Aimar
- *
- * Authors: Laurent Aimar <fenrir _AT_ videolan _DOT_ org>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifndef LIBVLC_VOUT_INTERNAL_CONTROL_H
-#define LIBVLC_VOUT_INTERNAL_CONTROL_H
-
-#include <vlc_viewpoint.h>
-
-/* */
-enum {
-    VOUT_CONTROL_MOUSE_STATE,           /* vlc_mouse_t */
-};
-
-typedef struct {
-    int type;
-
-    union {
-        vlc_mouse_t mouse;
-    };
-} vout_control_cmd_t;
-
-void vout_control_cmd_Init(vout_control_cmd_t *, int type);
-
-typedef struct {
-    /* */
-    bool can_sleep;
-    DECL_ARRAY(vout_control_cmd_t) cmd;
-} vout_control_t;
-
-/* */
-void vout_control_Init(vout_control_t *);
-void vout_control_Clean(vout_control_t *);
-
-/* controls outside of the vout thread */
-void vout_control_WaitEmpty(vout_control_t *);
-
-void vout_control_Push(vout_control_t *, vout_control_cmd_t *);
-void vout_control_Wake(vout_control_t *);
-
-/* control inside of the vout thread */
-#define INVALID_DEADLINE   ((vlc_tick_t) INT64_MAX)
-
-int vout_control_Pop(vout_control_t *, vout_control_cmd_t *, vlc_tick_t deadline, vlc_cond_t *, vlc_mutex_t *);
-
-#endif
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index b37985e10b8..2aac0f53219 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -60,7 +60,6 @@
 #include "../clock/clock.h"
 #include "statistic.h"
 #include "chrono.h"
-#include "control.h"
 
 typedef struct vout_thread_sys_t
 {
@@ -124,7 +123,6 @@ typedef struct vout_thread_sys_t
     vlc_cond_t      has_pictures;
     bool            terminate;
     DECL_ARRAY(vlc_mouse_t) mouse_events;
-    vout_control_t  control;
     vlc_thread_t    thread;
 
     struct {
@@ -196,6 +194,7 @@ typedef struct vout_thread_sys_t
 #define VOUT_THREAD_TO_SYS(vout) \
     container_of(vout, vout_thread_sys_t, obj.obj)
 
+#define INVALID_DEADLINE   ((vlc_tick_t) INT64_MAX)
 
 /* Maximum delay between 2 displayed pictures.
  * XXX it is needed for now but should be removed in the long term.
@@ -2242,7 +2241,6 @@ int vout_Request(const vout_configuration_t *cfg, vlc_video_context *vctx, input
 
     sys->original = original;
 
-    sys->delay = 0;
     sys->rate = 1.f;
     sys->clock = cfg->clock;
     sys->delay = 0;
-- 
2.26.2



More information about the vlc-devel mailing list