1 /*****************************************************************************
2 * d3d9_device.c : D3D9 decoder device from external IDirect3DDevice9
3 *****************************************************************************
4 * Copyright © 2019 VLC authors, VideoLAN and VideoLabs
6 * Authors: Steve Lhomme <robux4@ycbcr.xyz>
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 /*****************************************************************************
25 *****************************************************************************/
31 #include <vlc_common.h>
32 #include <vlc_codec.h>
34 #include "d3d9_filters.h"
36 static void D3D9CloseDecoderDevice(vlc_decoder_device
*device
)
38 d3d9_decoder_device_t
*dec_device
= device
->opaque
;
39 D3D9_ReleaseDevice( dec_device
);
41 static const struct vlc_decoder_device_operations d3d9_dev_ops
= {
42 .close
= D3D9CloseDecoderDevice
,
45 int D3D9OpenDecoderDevice(vlc_decoder_device
*device
, vout_window_t
*wnd
)
49 d3d9_decoder_device_t
*dec_device
= D3D9_CreateDevice( device
);
50 if ( dec_device
== NULL
)
53 device
->ops
= &d3d9_dev_ops
;
54 device
->opaque
= dec_device
;
55 device
->type
= VLC_DECODER_DEVICE_DXVA2
;