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

direct3d9: add a shared header to describe the VLC_CODEC_D3D9_OPAQUE chroma

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent af9f93f9
...@@ -398,7 +398,8 @@ endif ...@@ -398,7 +398,8 @@ endif
libdxva2_plugin_la_SOURCES = \ libdxva2_plugin_la_SOURCES = \
codec/avcodec/dxva2.c codec/avcodec/directx_va.c codec/avcodec/directx_va.h \ codec/avcodec/dxva2.c codec/avcodec/directx_va.c codec/avcodec/directx_va.h \
packetizer/h264_nal.c packetizer/h264_nal.h \ packetizer/h264_nal.c packetizer/h264_nal.h \
packetizer/hevc_nal.c packetizer/hevc_nal.h packetizer/hevc_nal.c packetizer/hevc_nal.h \
video_chroma/d3d9_fmt.h
libdxva2_plugin_la_LIBADD = $(LIBCOM) -lshlwapi -luuid libdxva2_plugin_la_LIBADD = $(LIBCOM) -lshlwapi -luuid
if HAVE_AVCODEC_DXVA2 if HAVE_AVCODEC_DXVA2
codec_LTLIBRARIES += libdxva2_plugin.la codec_LTLIBRARIES += libdxva2_plugin.la
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#define DXVA2API_USE_BITFIELDS #define DXVA2API_USE_BITFIELDS
#define COBJMACROS #define COBJMACROS
#include <libavcodec/dxva2.h> #include <libavcodec/dxva2.h>
#include "../../video_chroma/d3d9_fmt.h"
static int Open(vlc_va_t *, AVCodecContext *, enum PixelFormat, static int Open(vlc_va_t *, AVCodecContext *, enum PixelFormat,
const es_format_t *, picture_sys_t *p_sys); const es_format_t *, picture_sys_t *p_sys);
...@@ -134,11 +135,6 @@ struct vlc_va_sys_t ...@@ -134,11 +135,6 @@ struct vlc_va_sys_t
struct dxva_context hw; struct dxva_context hw;
}; };
struct picture_sys_t
{
LPDIRECT3DSURFACE9 surface;
};
static picture_t *DxAllocPicture(vlc_va_t *, const video_format_t *, unsigned index); static picture_t *DxAllocPicture(vlc_va_t *, const video_format_t *, unsigned index);
......
...@@ -115,7 +115,7 @@ endif ...@@ -115,7 +115,7 @@ endif
# DXVA2 # DXVA2
libdxa9_plugin_la_SOURCES = video_chroma/dxa9.c \ libdxa9_plugin_la_SOURCES = video_chroma/dxa9.c \
video_chroma/copy.c video_chroma/copy.h video_chroma/d3d9_fmt.h video_chroma/copy.c video_chroma/copy.h
if HAVE_AVCODEC_DXVA2 if HAVE_AVCODEC_DXVA2
chroma_LTLIBRARIES += \ chroma_LTLIBRARIES += \
......
/*****************************************************************************
* d3d9_fmt.h : D3D9 helper calls
*****************************************************************************
* 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_VIDEOCHROMA_D3D9_FMT_H_
#define VLC_VIDEOCHROMA_D3D9_FMT_H_
/* VLC_CODEC_D3D9_OPAQUE */
struct picture_sys_t
{
LPDIRECT3DSURFACE9 surface;
};
static inline void ReleasePictureSys(picture_sys_t *p_sys)
{
IDirect3DSurface9_Release(p_sys->surface);
}
#endif /* VLC_VIDEOCHROMA_D3D9_FMT_H_ */
...@@ -50,11 +50,7 @@ vlc_module_end () ...@@ -50,11 +50,7 @@ vlc_module_end ()
#include <windows.h> #include <windows.h>
#include <d3d9.h> #include <d3d9.h>
#include "d3d9_fmt.h"
struct picture_sys_t
{
LPDIRECT3DSURFACE9 surface;
};
static bool GetLock(filter_t *p_filter, LPDIRECT3DSURFACE9 d3d, static bool GetLock(filter_t *p_filter, LPDIRECT3DSURFACE9 d3d,
D3DLOCKED_RECT *p_lock, D3DSURFACE_DESC *p_desc) D3DLOCKED_RECT *p_lock, D3DSURFACE_DESC *p_desc)
......
...@@ -209,12 +209,14 @@ libdirect3d9_plugin_la_SOURCES = video_output/win32/direct3d9.c \ ...@@ -209,12 +209,14 @@ libdirect3d9_plugin_la_SOURCES = video_output/win32/direct3d9.c \
video_output/win32/common.c video_output/win32/common.h \ video_output/win32/common.c video_output/win32/common.h \
video_output/win32/events.c video_output/win32/events.h \ video_output/win32/events.c video_output/win32/events.h \
video_output/win32/builtin_shaders.h \ video_output/win32/builtin_shaders.h \
video_output/win32/win32touch.c video_output/win32/win32touch.h video_output/win32/win32touch.c video_output/win32/win32touch.h \
video_chroma/d3d9_fmt.h
libdirect3d9_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) \ libdirect3d9_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) \
-DMODULE_NAME_IS_direct3d9 -DMODULE_NAME_IS_direct3d9
libdirect3d9_plugin_la_LIBADD = -lgdi32 $(LIBCOM) -luuid libdirect3d9_plugin_la_LIBADD = -lgdi32 $(LIBCOM) -luuid
libdirect3d9_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' libdirect3d9_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)'
libdxva2_deinterlace_plugin_la_SOURCES = video_output/win32/dxva2_deinterlace.c libdxva2_deinterlace_plugin_la_SOURCES = video_output/win32/dxva2_deinterlace.c \
video_chroma/d3d9_fmt.h
libdxva2_deinterlace_plugin_la_LIBADD = $(LIBCOM) libdxva2_deinterlace_plugin_la_LIBADD = $(LIBCOM)
libdxva2_deinterlace_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)' libdxva2_deinterlace_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)'
if HAVE_WIN32_DESKTOP if HAVE_WIN32_DESKTOP
......
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
#include <windows.h> #include <windows.h>
#include <d3d9.h> #include <d3d9.h>
#include <d3dx9effect.h> #include <d3dx9effect.h>
#include "../../video_chroma/d3d9_fmt.h"
#include "common.h" #include "common.h"
#include "builtin_shaders.h" #include "builtin_shaders.h"
...@@ -147,8 +148,6 @@ struct vout_display_sys_t ...@@ -147,8 +148,6 @@ struct vout_display_sys_t
struct d3d_region_t *d3dregion; struct d3d_region_t *d3dregion;
const d3d_format_t *d3dtexture_format; /* Rendering texture(s) format */ const d3d_format_t *d3dtexture_format; /* Rendering texture(s) format */
picture_sys_t *picsys;
/* */ /* */
bool reset_device; bool reset_device;
bool reopen_device; bool reopen_device;
...@@ -161,11 +160,6 @@ struct vout_display_sys_t ...@@ -161,11 +160,6 @@ struct vout_display_sys_t
bool desktop_requested; bool desktop_requested;
}; };
struct picture_sys_t
{
LPDIRECT3DSURFACE9 surface;
};
static const d3d_format_t *Direct3DFindFormat(vout_display_t *vd, vlc_fourcc_t chroma, D3DFORMAT target); static const d3d_format_t *Direct3DFindFormat(vout_display_t *vd, vlc_fourcc_t chroma, D3DFORMAT target);
static int Open(vlc_object_t *); static int Open(vlc_object_t *);
...@@ -343,7 +337,7 @@ static void Close(vlc_object_t *object) ...@@ -343,7 +337,7 @@ static void Close(vlc_object_t *object)
static void DestroyPicture(picture_t *picture) static void DestroyPicture(picture_t *picture)
{ {
IDirect3DSurface9_Release(picture->p_sys->surface); ReleasePictureSys(picture->p_sys);
free(picture->p_sys); free(picture->p_sys);
free(picture); free(picture);
......
...@@ -36,11 +36,7 @@ ...@@ -36,11 +36,7 @@
#include <initguid.h> #include <initguid.h>
#include <d3d9.h> #include <d3d9.h>
#include <dxva2api.h> #include <dxva2api.h>
#include "../../video_chroma/d3d9_fmt.h"
struct picture_sys_t
{
LPDIRECT3DSURFACE9 surface;
};
struct filter_sys_t struct filter_sys_t
{ {
......
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