1 /*****************************************************************************
2 * d3d9_fmt.h : D3D9 helper calls
3 *****************************************************************************
4 * Copyright © 2017 VLC authors, VideoLAN and VideoLabs
6 * Authors: Steve Lhomme <robux4@gmail.com>
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU Lesser General Public License as published by
10 * the Free Software Foundation; either version 2.1 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this program; if not, write to the Free Software Foundation,
20 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
21 *****************************************************************************/
23 #ifndef VLC_VIDEOCHROMA_D3D9_FMT_H_
24 #define VLC_VIDEOCHROMA_D3D9_FMT_H_
26 #include <vlc_picture.h>
34 /* owned by the vout for VLC_CODEC_D3D9_OPAQUE */
37 IDirect3DSurface9
*surface
;
39 IDirectXVideoDecoder
*decoder
; /* keep a reference while the surface exist */
45 HINSTANCE hdll
; /* handle of the opened d3d9 dll */
55 /* d3d9_handle_t hd3d; TODO */
58 LPDIRECT3DDEVICE9 dev
;
59 LPDIRECT3DDEVICE9EX devex
;
63 /* creation parameters */
64 D3DPRESENT_PARAMETERS pp
;
70 #include "../codec/avcodec/va_surface.h"
72 picture_sys_t
*ActivePictureSys(picture_t
*p_pic
);
74 static inline void AcquirePictureSys(picture_sys_t
*p_sys
)
76 IDirect3DSurface9_AddRef(p_sys
->surface
);
78 IDirectXVideoDecoder_AddRef(p_sys
->decoder
);
79 p_sys
->dxva2_dll
= LoadLibrary(TEXT("DXVA2.DLL"));
82 static inline void ReleasePictureSys(picture_sys_t
*p_sys
)
84 IDirect3DSurface9_Release(p_sys
->surface
);
86 IDirectXVideoDecoder_Release(p_sys
->decoder
);
87 FreeLibrary(p_sys
->dxva2_dll
);
90 HRESULT
D3D9_CreateDevice(vlc_object_t
*, d3d9_handle_t
*, HWND
,
91 const video_format_t
*, d3d9_device_t
*out
);
92 #define D3D9_CreateDevice(a,b,c,d,e) D3D9_CreateDevice( VLC_OBJECT(a), b, c, d, e )
94 void D3D9_ReleaseDevice(d3d9_device_t
*);
95 int D3D9_Create(vlc_object_t
*, d3d9_handle_t
*);
96 #define D3D9_Create(a,b) D3D9_Create( VLC_OBJECT(a), b )
98 void D3D9_Destroy(d3d9_handle_t
*);
100 int D3D9_FillPresentationParameters(d3d9_handle_t
*, const video_format_t
*, d3d9_device_t
*);
104 int wddm
, d3d_features
, revision
, build
;
106 int D3D9CheckDriverVersion(d3d9_handle_t
*hd3d
, d3d9_device_t
*d3d_dev
, UINT vendorId
,
107 const struct wddm_version
*min_ver
);
110 #endif /* VLC_VIDEOCHROMA_D3D9_FMT_H_ */