Commit 34a545f1 authored by Steve Lhomme's avatar Steve Lhomme Committed by Jean-Baptiste Kempf

hw:d3d11: move all the filters into a single module

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent a5d18124
......@@ -3321,7 +3321,7 @@ AS_IF([test "${enable_directx}" != "no"], [
dnl Direct3D11
AC_CHECK_HEADERS(d3d11.h, [
VLC_ADD_PLUGIN([direct3d11 direct3d11_deinterlace direct3d11_adjust])
VLC_ADD_PLUGIN([direct3d11 direct3d11_filters])
])
dnl Direct3D9
......
d3d11dir = $(pluginsdir)/d3d11
d3d11_LTLIBRARIES =
libdirect3d11_deinterlace_plugin_la_SOURCES = hw/d3d11/d3d11_deinterlace.c
libdirect3d11_deinterlace_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)'
libdirect3d11_deinterlace_plugin_la_LIBADD = libdeinterlace_common.la libd3d11_common.la
libdirect3d11_filters_plugin_la_SOURCES = hw/d3d11/d3d11_filters.h \
hw/d3d11/d3d11_filters.c \
hw/d3d11/d3d11_deinterlace.c \
hw/d3d11/d3d11_surface.c
libdirect3d11_filters_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(d3d11dir)'
libdirect3d11_filters_plugin_la_LIBADD = libchroma_copy.la libdeinterlace_common.la libd3d11_common.la
if HAVE_WINSTORE
libdirect3d11_deinterlace_plugin_la_LIBADD += -ld3d11
endif
libdirect3d11_adjust_plugin_la_SOURCES = hw/d3d11/d3d11_adjust.c
libdirect3d11_adjust_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)'
libdirect3d11_adjust_plugin_la_LIBADD = libd3d11_common.la
if HAVE_WINSTORE
libdirect3d11_adjust_plugin_la_LIBADD += -ld3d11
endif
if HAVE_AVCODEC_D3D11VA
#video_filter_LTLIBRARIES += $(LTLIBdirect3d11_deinterlace) $(LTLIBdirect3d11_adjust)
d3d11_LTLIBRARIES += libdirect3d11_deinterlace_plugin.la libdirect3d11_adjust_plugin.la
libdirect3d11_filters_plugin_la_LIBADD += -ld3d11
endif
# GPU/CPU converter
libd3d11_surface_plugin_la_SOURCES = hw/d3d11/d3d11_surface.c
libd3d11_surface_plugin_la_LIBADD = libchroma_copy.la libd3d11_common.la
if HAVE_WINSTORE
libd3d11_surface_plugin_la_LIBADD += -ld3d11
endif
if HAVE_AVCODEC_D3D11VA
d3d11_LTLIBRARIES += libd3d11_surface_plugin.la
endif
d3d11_LTLIBRARIES = $(LTLIBdirect3d11_filters)
EXTRA_LTLIBRARIES += libdirect3d11_filters_plugin.la
......@@ -28,7 +28,6 @@
#include <assert.h>
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_filter.h>
#include <vlc_picture.h>
......@@ -36,6 +35,7 @@
#include <initguid.h>
#include <d3d11.h>
#include "d3d11_filters.h"
#include "../../video_chroma/d3d11_fmt.h"
#include "../../video_filter/deinterlace/common.h"
......@@ -281,7 +281,7 @@ static picture_t *NewOutputPicture( filter_t *p_filter )
return pic;
}
static int D3D11OpenDeinterlace(vlc_object_t *obj)
int D3D11OpenDeinterlace(vlc_object_t *obj)
{
filter_t *filter = (filter_t *)obj;
HRESULT hr;
......@@ -515,7 +515,7 @@ error:
return VLC_EGENERIC;
}
static void D3D11CloseDeinterlace(vlc_object_t *obj)
void D3D11CloseDeinterlace(vlc_object_t *obj)
{
filter_t *filter = (filter_t *)obj;
filter_sys_t *sys = filter->p_sys;
......@@ -530,11 +530,3 @@ static void D3D11CloseDeinterlace(vlc_object_t *obj)
free(sys);
}
vlc_module_begin()
set_description(N_("Direct3D11 deinterlacing filter"))
set_capability("video filter", 0)
set_category(CAT_VIDEO)
set_subcategory(SUBCAT_VIDEO_VFILTER)
set_callbacks(D3D11OpenDeinterlace, D3D11CloseDeinterlace)
add_shortcut ("deinterlace")
vlc_module_end()
/*****************************************************************************
* d3d11_adjust.c: D3D11 adjust filter (no gamma)
* d3d11_adjust.c: D3D11 filters module callbacks
*****************************************************************************
* Copyright (C) 2017 Videolabs SAS
* Copyright © 2017 VLC authors, VideoLAN and VideoLabs
*
* Authors: Steve Lhomme <robux4@gmail.com>
*
......@@ -38,6 +38,7 @@
#include <initguid.h>
#include <d3d11.h>
#include "d3d11_filters.h"
#include "../../video_chroma/d3d11_fmt.h"
#ifdef __MINGW32__
......@@ -616,7 +617,7 @@ static void D3D11CloseAdjust(vlc_object_t *obj)
}
vlc_module_begin()
set_description(N_("Direct3D11 adjust filter"))
set_description(N_("Direct3D11 filter"))
set_capability("video filter", 0)
set_category( CAT_VIDEO )
set_subcategory( SUBCAT_VIDEO_VFILTER )
......@@ -642,4 +643,16 @@ vlc_module_begin()
THRES_TEXT, THRES_LONGTEXT, false )
change_safe()
add_submodule()
set_callbacks( D3D11OpenDeinterlace, D3D11CloseDeinterlace )
add_shortcut ("deinterlace")
add_submodule()
set_capability( "video converter", 10 )
set_callbacks( D3D11OpenConverter, D3D11CloseConverter )
add_submodule()
set_callbacks( D3D11OpenCPUConverter, D3D11CloseCPUConverter )
set_capability( "video converter", 10 )
vlc_module_end()
/*****************************************************************************
* d3d11_filters.h : D3D11 filters module callbacks
*****************************************************************************
* Copyright © 2017 VLC authors, VideoLAN and VideoLabs
*
* Authors: Steve Lhomme <robux4@gmail.com>
*
* 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 VLC_D3D11_FILTERS_H
#define VLC_D3D11_FILTERS_H
#include <vlc_common.h>
int D3D11OpenDeinterlace(vlc_object_t *);
void D3D11CloseDeinterlace(vlc_object_t *);
int D3D11OpenConverter(vlc_object_t *);
void D3D11CloseConverter(vlc_object_t *);
int D3D11OpenCPUConverter(vlc_object_t *);
void D3D11CloseCPUConverter(vlc_object_t *);
#endif /* VLC_D3D11_FILTERS_H */
......@@ -29,7 +29,6 @@
#endif
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_filter.h>
#include <vlc_picture.h>
#include <vlc_modules.h>
......@@ -41,6 +40,8 @@
#include <windows.h>
#define COBJMACROS
#include <d3d11.h>
#include "d3d11_filters.h"
#include "../../video_chroma/d3d11_fmt.h"
#ifdef ID3D11VideoContext_VideoProcessorBlt
......@@ -624,7 +625,7 @@ VIDEO_FILTER_WRAPPER (D3D11_NV12)
VIDEO_FILTER_WRAPPER (D3D11_YUY2)
VIDEO_FILTER_WRAPPER (NV12_D3D11)
static int D3D11OpenConverter( vlc_object_t *obj )
int D3D11OpenConverter( vlc_object_t *obj )
{
filter_t *p_filter = (filter_t *)obj;
int err = VLC_EGENERIC;
......@@ -671,7 +672,7 @@ done:
return err;
}
static int D3D11OpenCPUConverter( vlc_object_t *obj )
int D3D11OpenCPUConverter( vlc_object_t *obj )
{
filter_t *p_filter = (filter_t *)obj;
int err = VLC_EGENERIC;
......@@ -796,7 +797,7 @@ done:
return err;
}
static void D3D11CloseConverter( vlc_object_t *obj )
void D3D11CloseConverter( vlc_object_t *obj )
{
filter_t *p_filter = (filter_t *)obj;
filter_sys_t *p_sys = (filter_sys_t*) p_filter->p_sys;
......@@ -819,7 +820,7 @@ static void D3D11CloseConverter( vlc_object_t *obj )
p_filter->p_sys = NULL;
}
static void D3D11CloseCPUConverter( vlc_object_t *obj )
void D3D11CloseCPUConverter( vlc_object_t *obj )
{
filter_t *p_filter = (filter_t *)obj;
filter_sys_t *p_sys = (filter_sys_t*) p_filter->p_sys;
......@@ -829,15 +830,3 @@ static void D3D11CloseCPUConverter( vlc_object_t *obj )
free( p_sys );
p_filter->p_sys = NULL;
}
/*****************************************************************************
* Module descriptor.
*****************************************************************************/
vlc_module_begin ()
set_description( N_("Conversions from D3D11 to YUV") )
set_capability( "video converter", 10 )
set_callbacks( D3D11OpenConverter, D3D11CloseConverter )
add_submodule()
set_callbacks( D3D11OpenCPUConverter, D3D11CloseCPUConverter )
set_capability( "video converter", 10 )
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