[vlc-devel] [PATCH v2 13/13] video_output: remove unused control API
Steve Lhomme
robux4 at ycbcr.xyz
Mon Aug 17 15:15:32 CEST 2020
---
src/Makefile.am | 2 -
src/video_output/control.c | 78 ---------------------------------
src/video_output/control.h | 55 -----------------------
src/video_output/video_output.c | 7 +--
4 files changed, 1 insertion(+), 141 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 80c0def5c72..00000000000
--- a/src/video_output/control.c
+++ /dev/null
@@ -1,78 +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"
-
-/* */
-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_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 6e904ba35b4..00000000000
--- a/src/video_output/control.h
+++ /dev/null
@@ -1,55 +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>
-
-/* */
-typedef struct {
- int type;
-} 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_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 27034cb3eca..174598f562c 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
{
@@ -122,7 +121,6 @@ typedef struct vout_thread_sys_t
/* Thread & synchronization */
vlc_mutex_t control_lock;
vlc_cond_t has_pictures;
- vout_control_t control;
vlc_thread_t thread;
atomic_bool terminate;
@@ -197,6 +195,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.
@@ -2044,8 +2043,6 @@ void vout_Release(vout_thread_t *vout)
assert(!sys->window_enabled);
vout_display_window_Delete(sys->display_cfg.window);
- vout_control_Clean(&sys->control);
-
/* */
vout_statistic_Clean(&sys->statistic);
@@ -2122,7 +2119,6 @@ vout_thread_t *vout_Create(vlc_object_t *object)
vlc_mutex_init(&sys->control_lock);
vlc_cond_init(&sys->has_pictures);
- vout_control_Init(&sys->control);
atomic_init(&sys->terminate, false);
sys->title.show = var_InheritBool(vout, "video-title-show");
@@ -2260,7 +2256,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