FFmpeg
hwcontext_d3d12va_internal.h
Go to the documentation of this file.
1 /*
2  * Direct3D 12 HW acceleration.
3  *
4  * copyright (c) 2022-2023 Wu Jianhua <toqsxw@outlook.com>
5  *
6  * This file is part of FFmpeg.
7  *
8  * FFmpeg is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * FFmpeg 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 GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with FFmpeg; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 
23 #ifndef AVUTIL_HWCONTEXT_D3D12VA_INTERNAL_H
24 #define AVUTIL_HWCONTEXT_D3D12VA_INTERNAL_H
25 
26 /**
27  * @def COBJMACROS
28  *
29  * @brief Enable C style interface for D3D12
30  */
31 #ifndef COBJMACROS
32 #define COBJMACROS
33 #endif
34 
35 /**
36  * @def DX_CHECK
37  *
38  * @brief A check macro used by D3D12 functions highly frequently
39  */
40 #define DX_CHECK(hr) \
41  do { \
42  if (FAILED(hr)) \
43  goto fail; \
44  } while (0)
45 
46 /**
47  * @def D3D12_OBJECT_RELEASE
48  *
49  * @brief A release macro used by D3D12 objects highly frequently
50  */
51 #define D3D12_OBJECT_RELEASE(pInterface) \
52  do { \
53  if (pInterface) { \
54  IUnknown_Release((IUnknown *)pInterface); \
55  pInterface = NULL; \
56  } \
57  } while (0)
58 
59 #endif /* AVUTIL_HWCONTEXT_D3D12VA_INTERNAL_H */