Commit c3ea303a authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

wdummy: add dummy video window provider

parent fbc9feef
......@@ -391,7 +391,8 @@ static inline void vout_display_DeleteWindow(vout_display_t *vd)
static inline bool vout_display_IsWindowed(vout_display_t *vd)
{
return vd->cfg->window != NULL;
return vd->cfg->window != NULL
&& vd->cfg->window->type != VOUT_WINDOW_TYPE_DUMMY;
}
/**
......
......@@ -53,6 +53,7 @@ enum vout_window_type {
VOUT_WINDOW_TYPE_NSOBJECT /**< MacOS X view */,
VOUT_WINDOW_TYPE_ANDROID_NATIVE /**< Android native window */,
VOUT_WINDOW_TYPE_WAYLAND /**< Wayland surface */,
VOUT_WINDOW_TYPE_DUMMY /**< Dummy window (not an actual window) */
};
/**
......
......@@ -454,6 +454,7 @@ $Id$
* wav: Wav demuxer
* wave: Wave video effect
* waveout: simple audio output module for Windows
* wdummy: dummy window provider
* webvtt: WEBVTT subtitles decoder, encoder and demuxer
* wgl: WGL extension for OpenGL
* win_hotkeys: module to catch hotkeys when application doesn't have the focus
......
......@@ -448,10 +448,12 @@ libflaschen_plugin_la_LIBADD = $(SOCKET_LIBS)
libvdummy_plugin_la_SOURCES = video_output/vdummy.c
libvmem_plugin_la_SOURCES = video_output/vmem.c
libwdummy_plugin_la_SOURCES = video_output/wdummy.c
libyuv_plugin_la_SOURCES = video_output/yuv.c
vout_LTLIBRARIES += \
libflaschen_plugin.la \
libvdummy_plugin.la \
libvmem_plugin.la \
libwdummy_plugin.la \
libyuv_plugin.la
/**
* @file wdummy.c
* @brief Dummy video window provider for legacy video plugins
*/
/*****************************************************************************
* Copyright © 2009, 2018 Rémi Denis-Courmont
*
* 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 <stdarg.h>
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_vout_window.h>
static int Control(vout_window_t *wnd, int query, va_list ap)
{
switch (query)
{
case VOUT_WINDOW_SET_SIZE:
{
unsigned width = va_arg(ap, unsigned);
unsigned height = va_arg(ap, unsigned);
vout_window_ReportSize(wnd, width, height);
return VLC_SUCCESS;
}
case VOUT_WINDOW_SET_STATE:
case VOUT_WINDOW_SET_FULLSCREEN:
/* These controls deserve a proper window provider. Move along. */
return VLC_EGENERIC;
default:
msg_Warn(wnd, "unsupported control query %d", query);
return VLC_EGENERIC;
}
}
static int Open(vout_window_t *wnd, const vout_window_cfg_t *cfg)
{
wnd->type = VOUT_WINDOW_TYPE_DUMMY;
wnd->control = Control;
vout_window_ReportSize(wnd, cfg->width, cfg->height);
return VLC_SUCCESS;
}
vlc_module_begin()
set_shortname(N_("Dummy window"))
set_description(N_("Dummy window"))
set_category(CAT_VIDEO)
set_subcategory(SUBCAT_VIDEO_VOUT)
set_capability("vout window", 1)
set_callbacks(Open, NULL)
vlc_module_end()
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