[vlc-devel] [PATCH 15/17] Caca: Use vlc_data_fifo_t to process commands
Denis Charmet
typx at dinauz.org
Mon Apr 22 19:10:44 CEST 2019
This is only temporary and should be fixed in the future
---
modules/video_output/caca.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/modules/video_output/caca.c b/modules/video_output/caca.c
index 617e9faf9e..c726ca7dd9 100644
--- a/modules/video_output/caca.c
+++ b/modules/video_output/caca.c
@@ -33,7 +33,7 @@
#include <stdlib.h>
#include <string.h>
#include <vlc_common.h>
-#include <vlc_block.h>
+#include <vlc_data.h>
#include <vlc_plugin.h>
#include <vlc_vout_display.h>
#if !defined(_WIN32) && !defined(__APPLE__)
@@ -51,7 +51,7 @@ struct vout_display_sys_t {
caca_display_t *dp;
cucul_dither_t *dither;
- block_fifo_t *fifo;
+ vlc_data_fifo_t *fifo;
vlc_thread_t thread;
vout_window_t *window;
vout_display_place_t place;
@@ -64,16 +64,16 @@ noreturn static void *VoutDisplayEventKeyDispatch(void *data)
{
vout_display_t *vd = data;
vout_display_sys_t *sys = vd->sys;
- block_fifo_t *fifo = sys->fifo;
+ vlc_data_fifo_t *fifo = sys->fifo;
for (;;) {
- block_t *event = block_FifoGet(fifo);
+ vlc_data_t *event = vlc_data_FifoGet(fifo);
int cancel = vlc_savecancel();
int key;
memcpy(&key, event->p_buffer, sizeof (key));
- block_Release(event);
+ vlc_data_Release(event);
vout_window_ReportKeyPress(sys->window, key);
vlc_restorecancel(cancel);
}
@@ -81,10 +81,10 @@ noreturn static void *VoutDisplayEventKeyDispatch(void *data)
static void VoutDisplayEventKey(vout_display_sys_t *sys, int key)
{
- block_t *event = block_Alloc(sizeof (key));
+ vlc_data_t *event = vlc_data_Alloc(sizeof (key));
if (likely(event != NULL)) {
memcpy(event->p_buffer, &key, sizeof (key));
- block_FifoPut(sys->fifo, event);
+ vlc_data_FifoPut(sys->fifo, event);
}
}
@@ -446,13 +446,13 @@ static int Open(vlc_object_t *object)
(title != NULL) ? title : VOUT_TITLE "(Colour AsCii Art)");
free(title);
- block_fifo_t *fifo = block_FifoNew();
+ vlc_data_fifo_t *fifo = vlc_data_FifoNew();
if (likely(fifo != NULL)) {
sys->fifo = fifo;
if (vlc_clone(&sys->thread, VoutDisplayEventKeyDispatch, vd,
VLC_THREAD_PRIORITY_LOW)) {
- block_FifoRelease(fifo);
+ vlc_data_FifoRelease(fifo);
sys->fifo = NULL;
}
}
@@ -511,7 +511,7 @@ static void Close(vlc_object_t *object)
if (sys->fifo != NULL) {
vlc_cancel(sys->thread);
vlc_join(sys->thread, NULL);
- block_FifoRelease(sys->fifo);
+ vlc_data_FifoRelease(sys->fifo);
}
if (sys->dither)
cucul_free_dither(sys->dither);
--
2.20.1
More information about the vlc-devel
mailing list