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

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

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 34a545f1
......@@ -3338,7 +3338,7 @@ AS_IF([test "${enable_directx}" != "no"], [
#endif
]],[[;]])
],[
VLC_ADD_PLUGIN([direct3d9_deinterlace direct3d9_adjust])
VLC_ADD_PLUGIN([direct3d9_filters])
],
[AC_MSG_WARN([Could not find required IDirectXVideoDecoder in dxva2api.h])])
......
d3d9dir = $(pluginsdir)/d3d9
d3d9_LTLIBRARIES =
# GPU/CPU converter
libdxa9_plugin_la_SOURCES = hw/d3d9/dxa9.c
libdxa9_plugin_la_LIBADD = libd3d9_common.la libchroma_copy.la
if HAVE_AVCODEC_DXVA2
d3d9_LTLIBRARIES += libdxa9_plugin.la
endif
libdirect3d9_deinterlace_plugin_la_SOURCES = hw/d3d9/dxva2_deinterlace.c
libdirect3d9_deinterlace_plugin_la_LIBADD = libd3d9_common.la $(LIBCOM) libdeinterlace_common.la
libdirect3d9_deinterlace_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)'
libdirect3d9_adjust_plugin_la_SOURCES = hw/d3d9/d3d9_adjust.c
libdirect3d9_adjust_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)'
libdirect3d9_adjust_plugin_la_LIBADD = libd3d9_common.la $(LIBCOM)
libdirect3d9_filters_plugin_la_SOURCES = hw/d3d9/d3d9_filters.h \
hw/d3d9/d3d9_filters.c \
hw/d3d9/dxva2_deinterlace.c \
hw/d3d9/dxa9.c
libdirect3d9_filters_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(d3d9dir)'
libdirect3d9_filters_plugin_la_LIBADD = libchroma_copy.la libdeinterlace_common.la libd3d9_common.la $(LIBCOM)
if HAVE_WIN32_DESKTOP
#video_filter_LTLIBRARIES = $(LTLIBdirect3d9_deinterlace) $(LTLIBdirect3d9_adjust)
d3d9_LTLIBRARIES += libdirect3d9_deinterlace_plugin.la libdirect3d9_adjust_plugin.la
d3d9_LTLIBRARIES = $(LTLIBdirect3d9_filters)
EXTRA_LTLIBRARIES += libdirect3d9_filters_plugin.la
endif
/*****************************************************************************
* d3d9_adjust.c: D3D9 adjust filter (no gamma)
* d3d9_filters.c: D3D9 filters module callbacks
*****************************************************************************
* Copyright (C) 2017 Videolabs SAS
* Copyright © 2017 VLC authors, VideoLAN and VideoLabs
*
* Authors: Steve Lhomme <robux4@gmail.com>
*
......@@ -39,6 +39,8 @@
#include <dxva2api.h>
#include "../../video_chroma/d3d9_fmt.h"
#include "d3d9_filters.h"
struct filter_level
{
atomic_int level;
......@@ -464,4 +466,16 @@ vlc_module_begin()
add_bool( "brightness-threshold", false,
THRES_TEXT, THRES_LONGTEXT, false )
change_safe()
add_submodule()
set_callbacks(D3D9OpenDeinterlace, D3D9CloseDeinterlace)
add_shortcut ("deinterlace")
add_submodule()
set_capability( "video converter", 10 )
set_callbacks( D3D9OpenConverter, D3D9CloseConverter )
add_submodule()
set_callbacks( D3D9OpenCPUConverter, D3D9CloseCPUConverter )
set_capability( "video converter", 10 )
vlc_module_end()
/*****************************************************************************
* d3d9_filters.h : D3D9 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_D3D9_FILTERS_H
#define VLC_D3D9_FILTERS_H
#include <vlc_common.h>
int D3D9OpenDeinterlace(vlc_object_t *);
void D3D9CloseDeinterlace(vlc_object_t *);
int D3D9OpenConverter(vlc_object_t *);
void D3D9CloseConverter(vlc_object_t *);
int D3D9OpenCPUConverter(vlc_object_t *);
void D3D9CloseCPUConverter(vlc_object_t *);
#endif /* VLC_D3D9_FILTERS_H */
......@@ -30,11 +30,12 @@
#endif
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_filter.h>
#include <vlc_picture.h>
#include <vlc_modules.h>
#include "d3d9_filters.h"
#include "../../video_chroma/copy.h"
#include <windows.h>
......@@ -287,7 +288,7 @@ VIDEO_FILTER_WRAPPER (DXA9_YV12)
VIDEO_FILTER_WRAPPER (DXA9_NV12)
VIDEO_FILTER_WRAPPER (YV12_D3D9)
static int D3D9OpenConverter( vlc_object_t *obj )
int D3D9OpenConverter( vlc_object_t *obj )
{
filter_t *p_filter = (filter_t *)obj;
HINSTANCE hd3d_dll = NULL;
......@@ -336,7 +337,7 @@ done:
return err;
}
static int D3D9OpenCPUConverter( vlc_object_t *obj )
int D3D9OpenCPUConverter( vlc_object_t *obj )
{
filter_t *p_filter = (filter_t *)obj;
int err = VLC_EGENERIC;
......@@ -455,7 +456,7 @@ done:
return err;
}
static void D3D9CloseConverter( vlc_object_t *obj )
void D3D9CloseConverter( vlc_object_t *obj )
{
filter_t *p_filter = (filter_t *)obj;
copy_cache_t *p_copy_cache = (copy_cache_t*) p_filter->p_sys;
......@@ -464,7 +465,7 @@ static void D3D9CloseConverter( vlc_object_t *obj )
p_filter->p_sys = NULL;
}
static void D3D9CloseCPUConverter( vlc_object_t *obj )
void D3D9CloseCPUConverter( vlc_object_t *obj )
{
filter_t *p_filter = (filter_t *)obj;
filter_sys_t *p_sys = (filter_sys_t*) p_filter->p_sys;
......@@ -475,15 +476,3 @@ static void D3D9CloseCPUConverter( vlc_object_t *obj )
free( p_sys );
p_filter->p_sys = NULL;
}
/*****************************************************************************
* Module descriptor.
*****************************************************************************/
vlc_module_begin ()
set_description( N_("Conversions from DxVA2 to YUV") )
set_capability( "video converter", 10 )
set_callbacks( D3D9OpenConverter, D3D9CloseConverter )
add_submodule()
set_callbacks( D3D9OpenCPUConverter, D3D9CloseCPUConverter )
set_capability( "video converter", 10 )
vlc_module_end ()
......@@ -28,7 +28,6 @@
#include <assert.h>
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_filter.h>
#include <vlc_picture.h>
......@@ -39,6 +38,8 @@
#include "../../video_chroma/d3d9_fmt.h"
#include "../../video_filter/deinterlace/common.h"
#include "d3d9_filters.h"
struct filter_sys_t
{
HINSTANCE hdecoder_dll;
......@@ -266,7 +267,7 @@ static picture_t *NewOutputPicture( filter_t *p_filter )
return pic;
}
static int D3D9OpenDeinterlace(vlc_object_t *obj)
int D3D9OpenDeinterlace(vlc_object_t *obj)
{
filter_t *filter = (filter_t *)obj;
filter_sys_t *sys = NULL;
......@@ -492,7 +493,7 @@ error:
return VLC_EGENERIC;
}
static void D3D9CloseDeinterlace(vlc_object_t *obj)
void D3D9CloseDeinterlace(vlc_object_t *obj)
{
filter_t *filter = (filter_t *)obj;
filter_sys_t *sys = filter->p_sys;
......@@ -505,12 +506,3 @@ static void D3D9CloseDeinterlace(vlc_object_t *obj)
free(sys);
}
vlc_module_begin()
set_description(N_("Direct3D9 deinterlacing filter"))
set_capability("video filter", 0)
set_category(CAT_VIDEO)
set_subcategory(SUBCAT_VIDEO_VFILTER)
set_callbacks(D3D9OpenDeinterlace, D3D9CloseDeinterlace)
add_shortcut ("deinterlace")
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