demux: libmp4: fix ReadBoxUsing function return check
[vlc.git] / modules / codec / avcodec / directx_va.h
blob335cca7bd37babf57b631330f4b592f93ea40cef
1 /*****************************************************************************
2 * directx_va.h: DirectX Generic Video Acceleration helpers
3 *****************************************************************************
4 * Copyright (C) 2009 Geoffroy Couprie
5 * Copyright (C) 2009 Laurent Aimar
6 * Copyright (C) 2015 Steve Lhomme
7 * $Id$
9 * Authors: Geoffroy Couprie <geal@videolan.org>
10 * Laurent Aimar <fenrir _AT_ videolan _DOT_ org>
11 * Steve Lhomme <robux4@gmail.com>
13 * This program is free software; you can redistribute it and/or modify it
14 * under the terms of the GNU Lesser General Public License as published by
15 * the Free Software Foundation; either version 2.1 of the License, or
16 * (at your option) any later version.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License for more details.
23 * You should have received a copy of the GNU Lesser General Public License
24 * along with this program; if not, write to the Free Software Foundation,
25 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
26 *****************************************************************************/
28 #ifndef AVCODEC_DIRECTX_VA_H
29 #define AVCODEC_DIRECTX_VA_H
31 # if _WIN32_WINNT < _WIN32_WINNT_VISTA
32 /* d3d11 needs Vista support */
33 # undef _WIN32_WINNT
34 # define _WIN32_WINNT _WIN32_WINNT_VISTA
35 # endif
37 #include <vlc_common.h>
39 #include <libavcodec/avcodec.h>
40 #include "va.h"
42 #include <unknwn.h>
43 #include <stdatomic.h>
45 #include "va_surface_internal.h"
47 typedef struct input_list_t {
48 void (*pf_release)(struct input_list_t *);
49 GUID *list;
50 unsigned count;
51 } input_list_t;
53 #define MAX_SURFACE_COUNT (64)
54 typedef struct
56 va_pool_t va_pool;
57 bool can_extern_pool;
59 /* for pre allocation */
60 D3D_DecoderSurface *hw_surface[MAX_SURFACE_COUNT];
62 /* Video service */
63 GUID input;
64 D3D_DecoderDevice *d3ddec;
66 /* Video decoder */
67 D3D_DecoderType *decoder;
69 /**
70 * Read the list of possible input GUIDs
72 int (*pf_get_input_list)(vlc_va_t *, input_list_t *);
73 /**
74 * Find a suitable decoder configuration for the input and set the
75 * internal state to use that output
77 int (*pf_setup_output)(vlc_va_t *, const GUID *input, const video_format_t *fmt);
79 } directx_sys_t;
81 int directx_va_Open(vlc_va_t *, directx_sys_t *);
82 void directx_va_Close(vlc_va_t *, directx_sys_t *);
83 int directx_va_Setup(vlc_va_t *, directx_sys_t *, const AVCodecContext *avctx, const es_format_t *, int flag_xbox);
84 char *directx_va_GetDecoderName(const GUID *guid);
85 bool directx_va_canUseDecoder(vlc_va_t *, UINT VendorId, UINT DeviceId, const GUID *pCodec, UINT driverBuild);
87 #endif /* AVCODEC_DIRECTX_VA_H */