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

direct3d11: move the VLC_CODEC_D3D11_OPAQUE definition in a separate header

Shared by all code using the opaque format.
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 2ee46959
......@@ -396,7 +396,7 @@ endif
libd3d11va_plugin_la_SOURCES = \
codec/avcodec/d3d11va.c codec/avcodec/directx_va.c codec/avcodec/directx_va.h \
video_chroma/dxgi_fmt.c video_chroma/dxgi_fmt.h \
video_chroma/d3d11_fmt.h video_chroma/dxgi_fmt.c video_chroma/dxgi_fmt.h \
packetizer/h264_nal.c packetizer/h264_nal.h \
packetizer/hevc_nal.c packetizer/hevc_nal.h
libd3d11va_plugin_la_LIBADD = $(LIBCOM) -luuid
......
......@@ -52,7 +52,7 @@
#include <d3d11.h>
#include <libavcodec/d3d11va.h>
#include "../../video_chroma/dxgi_fmt.h"
#include "../../video_chroma/d3d11_fmt.h"
static int Open(vlc_va_t *, AVCodecContext *, enum PixelFormat,
const es_format_t *, picture_sys_t *p_sys);
......@@ -134,16 +134,6 @@ struct vlc_va_sys_t
DXGI_FORMAT processorFormat;
};
/* VLC_CODEC_D3D11_OPAQUE */
struct picture_sys_t
{
ID3D11VideoDecoderOutputView *decoder; /* may be NULL for pictures from the pool */
ID3D11Texture2D *texture;
ID3D11DeviceContext *context;
unsigned slice_index;
ID3D11VideoProcessorInputView *inputView; /* when used as processor input */
};
/* */
static int D3dCreateDevice(vlc_va_t *);
static void D3dDestroyDevice(vlc_va_t *);
......
......@@ -124,7 +124,7 @@ endif
# D3D11VA
libd3d11_surface_plugin_la_SOURCES = video_chroma/d3d11_surface.c \
video_chroma/dxgi_fmt.c video_chroma/dxgi_fmt.h \
video_chroma/d3d11_fmt.h video_chroma/dxgi_fmt.c video_chroma/dxgi_fmt.h \
video_chroma/copy.c video_chroma/copy.h
if HAVE_AVCODEC_D3D11VA
......
/*****************************************************************************
* d3d11_fmt.h : D3D11 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_D3D11_FMT_H_
#define VLC_VIDEOCHROMA_D3D11_FMT_H_
#include <d3d11.h>
#include "dxgi_fmt.h"
/* VLC_CODEC_D3D11_OPAQUE */
struct picture_sys_t
{
ID3D11VideoDecoderOutputView *decoder; /* may be NULL for pictures from the pool */
ID3D11Texture2D *texture;
ID3D11DeviceContext *context;
unsigned slice_index;
ID3D11VideoProcessorInputView *inputView; /* when used as processor input */
};
#endif /* include-guard */
......@@ -34,7 +34,6 @@
#include <vlc_picture.h>
#include "copy.h"
#include "dxgi_fmt.h"
static int OpenConverter( vlc_object_t * );
static void CloseConverter( vlc_object_t * );
......@@ -51,16 +50,7 @@ vlc_module_end ()
#include <windows.h>
#define COBJMACROS
#include <d3d11.h>
/* VLC_CODEC_D3D11_OPAQUE */
struct picture_sys_t
{
ID3D11VideoDecoderOutputView *decoder; /* may be NULL for pictures from the pool */
ID3D11Texture2D *texture;
ID3D11DeviceContext *context;
unsigned slice_index;
HINSTANCE hd3d11_dll; /* TODO */
};
#include "d3d11_fmt.h"
struct filter_sys_t {
copy_cache_t cache;
......
......@@ -196,7 +196,7 @@ EXTRA_LTLIBRARIES += libdirect3d9_plugin.la
endif
libdirect3d11_plugin_la_SOURCES = video_output/win32/direct3d11.c \
video_chroma/dxgi_fmt.c video_chroma/dxgi_fmt.h \
video_chroma/d3d11_fmt.h video_chroma/dxgi_fmt.c video_chroma/dxgi_fmt.h \
video_output/win32/common.c video_output/win32/common.h
libdirect3d11_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) \
-DMODULE_NAME_IS_direct3d11
......
......@@ -45,6 +45,10 @@
#include "events.h"
#ifdef MODULE_NAME_IS_direct3d11
#include "../../video_chroma/dxgi_fmt.h"
#ifdef HAVE_ID3D11VIDEODECODER
#include "../../video_chroma/d3d11_fmt.h"
#endif
typedef struct
{
DXGI_FORMAT textureFormat;
......
......@@ -44,10 +44,13 @@
/* avoided until we can pass ISwapchainPanel without c++/cx mode
# include <windows.ui.xaml.media.dxinterop.h> */
#include "common.h"
#ifdef HAVE_ID3D11VIDEODECODER
#include "../../video_chroma/d3d11_fmt.h"
#endif
#include "../../video_chroma/dxgi_fmt.h"
#include "common.h"
#if !VLC_WINSTORE_APP
# define D3D11CreateDevice(args...) sys->OurD3D11CreateDevice(args)
# define D3DCompile(args...) sys->OurD3DCompile(args)
......@@ -84,17 +87,6 @@ vlc_module_begin ()
set_callbacks(Open, Close)
vlc_module_end ()
#ifdef HAVE_ID3D11VIDEODECODER
/* VLC_CODEC_D3D11_OPAQUE */
struct picture_sys_t
{
ID3D11VideoDecoderOutputView *decoder; /* may be NULL for pictures from the pool */
ID3D11Texture2D *texture;
ID3D11DeviceContext *context;
unsigned slice_index;
};
#endif
/* internal picture_t pool */
typedef struct
{
......
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