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

directfb: remove legacy video output

The DirectFB project has been dead for several years, and is ostensibly
not used. If you really need direct access to the Linux frame buffer,
there is still the raw LinuxFB module for the time being.
parent c900e39c
......@@ -298,6 +298,8 @@ Removed modules
* Rar access and stream filter: use libarchive
* VDA decoder: use VT
* Audioqueue: use audiounit
* DirectFB video output module
Changes between 2.2.5 and 2.2.5.1:
--------------------------------
......
......@@ -3309,70 +3309,6 @@ AC_CHECK_HEADER([linux/fb.h], [
])
dnl
dnl DirectFB module
dnl try to find using: 1 - given location; 2 - directfb-config; 3 - pkg-config
dnl TODO: support for static linking
dnl
AC_ARG_ENABLE(directfb,
[ --enable-directfb DirectFB support (default disabled)])
AC_ARG_WITH(directfb,
[ --with-directfb=PATH path to DirectFB headers and libraries])
if test "${enable_directfb}" = "yes"; then
have_directfb="false"
CPPFLAGS_mydirectfb=
LIBS_mydirectfb=
if test "${with_directfb}" != "no" -a -n "${with_directfb}"; then
dnl Trying the given location
VLC_SAVE_FLAGS
CPPFLAGS_new="-I${with_directfb}/include -D_REENTRANT -D_GNU_SOURCE"
LIBS_new="-L${with_directfb}/lib/fusion/.libs/ -L${with_directfb}/lib/direct/.libs/ -L${with_directfb}/src/.libs/"
CPPFLAGS="${CPPFLAGS} ${CPPFLAGS_new}"
LIBS="${LIBS} ${LIBS_new}"
dnl FIXME: too obscure
AC_CHECK_HEADER([directfb.h], [
AC_CHECK_LIB([direct],[direct_initialize], [
AC_CHECK_LIB([fusion], [fusion_enter], [
AC_CHECK_LIB([directfb], [DirectFBInit], have_directfb="true", have_directfb="false")
], have_directfb="false")
], have_directfb="false")
], have_directfb="false")
VLC_RESTORE_FLAGS
if test "${have_directfb}" = "true"; then
LIBS_mydirectfb="${LIBS_new} -lz $LIBDL -ldirectfb -lfusion -ldirect -lpthread"
CPPFLAGS_mydirectfb="${CPPFLAGS_new}"
fi
else
dnl Look for directfb-config
AC_CHECK_PROG(DIRECTFB_CONFIG, [directfb-config], [false])
AS_IF(["${DIRECTFB_CONFIG}" != "false"], [
CPPFLAGS_mydirectfb="`${DIRECTFB_CONFIG} --cflags`"
LIBS_mydirectfb="`${DIRECTFB_CONFIG} --libs`"
have_directfb="true"
], [
dnl Trying with pkg-config
PKG_CHECK_MODULES(DIRECTFB, directfb, [
CPPFLAGS_mydirectfb="${DIRECTFB_CFLAGS}"
LIBS_mydirectfb="${DIRECTFB_LIBS}"
have_directfb="true"
], [have_directfb="false"])
])
fi
if test "${have_directfb}" = "true"; then
VLC_ADD_PLUGIN([directfb])
VLC_ADD_CPPFLAGS([directfb],[${CPPFLAGS_mydirectfb}])
VLC_ADD_LIBS([directfb],[${LIBS_mydirectfb}])
else
AC_MSG_ERROR([${DIRECTFB_PKG_ERRORS}.])
fi
fi
dnl
dnl AA plugin
dnl
......
......@@ -112,7 +112,6 @@ $Id$
* direct3d9_adjust: adjust filter for Direct3D9 video decoding
* direct3d9_deinterlace: deinterlacer for Direct3D9/DxVA video decoding
* directdraw: video output module using the DirectDraw API
* directfb: Direct Framebuffer video output
* directsound: audio output module using the DirectSound API
* dmo: a DirectMediaObject decoder that uses DirectMedia to decode video (WMV3)
* dolby_surround_decoder: simple decoder for dolby surround encoded streams
......
......@@ -399,13 +399,6 @@ endif
### FrameBuffer ###
libdirectfb_plugin_la_SOURCES = video_output/directfb.c
libdirectfb_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) $(CPPFLAGS_directfb)
libdirectfb_plugin_la_LIBADD = $(LIBS_directfb)
libdirectfb_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)'
EXTRA_LTLIBRARIES += libdirectfb_plugin.la
vout_LTLIBRARIES += $(LTLIBdirectfb)
libfb_plugin_la_SOURCES = video_output/fb.c
libfb_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)'
EXTRA_LTLIBRARIES += libfb_plugin.la
......
/*****************************************************************************
* directfb.c: DirectFB video output display method
*****************************************************************************
* Copyright © 2005-2009 VLC authors and VideoLAN
*
* Authors: Iuri Diniz <iuridiniz@gmail.com>
* Laurent Aimar <fenrir@videolan.org>
*
* This code is based in sdl.c and fb.c, thanks for VideoLAN team.
*
* 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.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_vout_display.h>
#include <vlc_picture_pool.h>
#include <directfb.h>
/*****************************************************************************
* Module descriptor
*****************************************************************************/
static int Open (vlc_object_t *);
static void Close(vlc_object_t *);
vlc_module_begin()
set_shortname("DirectFB")
set_category(CAT_VIDEO)
set_subcategory(SUBCAT_VIDEO_VOUT)
set_description(N_("DirectFB video output http://www.directfb.org/"))
set_capability("vout display", 35)
add_shortcut("directfb")
set_callbacks(Open, Close)
vlc_module_end()
/*****************************************************************************
* Local prototypes
*****************************************************************************/
static picture_pool_t *Pool (vout_display_t *, unsigned);
static void Display(vout_display_t *, picture_t *, subpicture_t *);
static int Control(vout_display_t *, int, va_list);
/* */
struct vout_display_sys_t {
IDirectFB *directfb;
IDirectFBSurface *primary;
picture_pool_t *pool;
picture_t *pics[3];
int idx;
};
/* */
static int Open(vlc_object_t *object)
{
vout_display_t *vd = (vout_display_t *)object;
vout_display_sys_t *sys;
if (vout_display_IsWindowed(vd))
return VLC_EGENERIC;
vd->sys = sys = calloc(1, sizeof(*sys));
if (!sys)
return VLC_ENOMEM;
if (DirectFBInit(NULL,NULL) != DFB_OK) {
msg_Err(vd, "Cannot init DirectFB");
free(sys);
return VLC_EGENERIC;
}
DFBSurfaceDescription dsc;
dsc.flags = DSDESC_CAPS;
dsc.caps = DSCAPS_PRIMARY | DSCAPS_TRIPLE;
#if 0
dsc.flags |= DSDESC_HEIGHT | DSDESC_WIDTH;
dsc.width = 352;
dsc.height = 240;
#endif
IDirectFB *directfb = NULL;
if (DirectFBCreate(&directfb) != DFB_OK || !directfb)
goto error;
sys->directfb = directfb;
IDirectFBSurface *primary = NULL;
if (directfb->CreateSurface(directfb, &dsc, &primary) || !primary)
goto error;
sys->primary = primary;
/* */
int width;
int height;
primary->GetSize(primary, &width, &height);
/* */
video_format_t fmt;
video_format_ApplyRotation(&fmt, &vd->fmt);
DFBSurfacePixelFormat pixel_format;
sys->primary->GetPixelFormat(sys->primary, &pixel_format);
switch (pixel_format) {
case DSPF_RGB332:
fmt.i_chroma = VLC_CODEC_RGB8;
fmt.i_rmask = 0x7 << 5;
fmt.i_gmask = 0x7 << 2;
fmt.i_bmask = 0x3 << 0;
break;
case DSPF_RGB16: fmt.i_chroma = VLC_CODEC_RGB16; break;
case DSPF_RGB24: fmt.i_chroma = VLC_CODEC_RGB24; break;
case DSPF_RGB32: fmt.i_chroma = VLC_CODEC_RGB32; break;
default:
msg_Err(vd, "unknown screen depth %i", pixel_format);
Close(VLC_OBJECT(vd));
return VLC_EGENERIC;
}
video_format_FixRgb(&fmt);
fmt.i_width = width;
fmt.i_height = height;
fmt.i_visible_width = width;
fmt.i_visible_height = height;
/* */
vout_display_info_t info = vd->info;
info.has_hide_mouse = true;
/* */
vd->fmt = fmt;
vd->info = info;
vd->pool = Pool;
vd->prepare = NULL;
vd->display = Display;
vd->control = Control;
vd->manage = NULL;
/* */
vout_display_SendEventDisplaySize(vd, fmt.i_width, fmt.i_height);
return VLC_SUCCESS;
error:
msg_Err(vd, "Cannot create primary surface");
Close(VLC_OBJECT(vd));
return VLC_EGENERIC;
}
static void Close(vlc_object_t *object)
{
vout_display_t *vd = (vout_display_t *)object;
vout_display_sys_t *sys = vd->sys;
if (sys->pool)
picture_pool_Release(sys->pool);
IDirectFBSurface *primary = sys->primary;
if (primary)
primary->Release(primary);
IDirectFB *directfb = sys->directfb;
if (directfb)
directfb->Release(directfb);
free(sys);
}
struct picture_sys_t {
vout_display_sys_t *sys;
};
static int Lock(picture_t *pic)
{
vout_display_sys_t *sys = pic->p_sys->sys;
return sys->pics[sys->idx] == pic ? VLC_SUCCESS : VLC_EGENERIC;
}
/* */
static picture_pool_t *Pool(vout_display_t *vd, unsigned count)
{
VLC_UNUSED(count);
vout_display_sys_t *sys = vd->sys;
IDirectFBSurface *primary = sys->primary;
if (!sys->pool) {
picture_resource_t rsc;
memset(&rsc, 0, sizeof(rsc));
rsc.p[0].i_lines = vd->fmt.i_height;
for (int i = 0; i < 3; i++) {
rsc.p_sys = malloc(sizeof(*rsc.p_sys));
if (!rsc.p_sys)
goto cleanup;
rsc.p_sys->sys = sys;
void *pixels;
int pitch;
if (primary->Lock(primary, DSLF_WRITE, &pixels, &pitch) != DFB_OK)
goto cleanup;
rsc.p[0].i_pitch = pitch;
rsc.p[0].p_pixels = pixels;
primary->Unlock(primary);
primary->Flip(primary, NULL, 0);
sys->pics[i] = picture_NewFromResource(&vd->fmt, &rsc);
if (!sys->pics[i]) {
free(rsc.p_sys);
goto cleanup;
}
}
picture_pool_configuration_t cfg = {
.picture_count = 3,
.picture = sys->pics,
.lock = Lock,
.unlock = NULL,
};
sys->pool = picture_pool_NewExtended(&cfg);
}
return sys->pool;
cleanup:
for (int i = 0; i < 2; i++) {
if (sys->pics[i]) {
free(sys->pics[i]->p_sys);
picture_Release(sys->pics[i]);
}
}
return NULL;
}
static void Display(vout_display_t *vd, picture_t *picture, subpicture_t *subpicture)
{
vout_display_sys_t *sys = vd->sys;
IDirectFBSurface *primary = sys->primary;
primary->Flip(primary, NULL, 0);
if (++sys->idx >= 3)
sys->idx = 0;
picture_Release(picture);
VLC_UNUSED(subpicture);
}
static int Control(vout_display_t *vd, int query, va_list args)
{
(void) vd; (void) query; (void) args;
return VLC_EGENERIC;
}
......@@ -1125,7 +1125,6 @@ modules/video_output/android/window.c
modules/video_output/caca.c
modules/video_output/caopengllayer.m
modules/video_output/decklink.cpp
modules/video_output/directfb.c
modules/video_output/drawable.c
modules/video_output/evas.c
modules/video_output/fb.c
......
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