1 /*
2 * This file is part of FFmpeg.
3 *
4 * FFmpeg is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * FFmpeg is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with FFmpeg; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19 #ifndef AVUTIL_HWCONTEXT_INTERNAL_H
20 #define AVUTIL_HWCONTEXT_INTERNAL_H
21
22 #include <stddef.h>
23
28
32
33 /**
34 * An array of pixel formats supported by the AVHWFramesContext instances
35 * Terminated by AV_PIX_FMT_NONE.
36 */
38
39 /**
40 * size of the public hardware-specific context,
41 * i.e. AVHWDeviceContext.hwctx
42 */
44 /**
45 * size of the private data, i.e.
46 * AVHWDeviceInternal.priv
47 */
49
50 /**
51 * Size of the hardware-specific device configuration.
52 * (Used to query hwframe constraints.)
53 */
55
56 /**
57 * size of the public frame pool hardware-specific context,
58 * i.e. AVHWFramesContext.hwctx
59 */
61 /**
62 * size of the private data, i.e.
63 * AVHWFramesInternal.priv
64 */
66
71
74
76 const void *hwconfig,
78
81
90
95
101
105
106 /**
107 * For a derived device, a reference to the original device
108 * context it was derived from.
109 */
111 };
112
116
118
119 /**
120 * For a derived context, a reference to the original frames
121 * context it was derived from.
122 */
124 /**
125 * Flags to apply to the mapping from the source to the derived
126 * frame context when trying to allocate in the derived context.
127 */
129 };
130
132 /**
133 * A reference to the original source of the mapping.
134 */
136 /**
137 * A reference to the hardware frames context in which this
138 * mapping was made. May be the same as source->hw_frames_ctx,
139 * but need not be.
140 */
142 /**
143 * Unmap function.
144 */
147 /**
148 * Hardware-specific private data associated with the mapping.
149 */
152
158
159
170
171 #endif /* AVUTIL_HWCONTEXT_INTERNAL_H */
This struct aggregates all the (hardware/vendor-specific) "high-level" state, i.e.
This structure describes decoded (raw) audio or video data.
void(* frames_uninit)(AVHWFramesContext *ctx)
const HWContextType ff_hwcontext_type_vdpau
const HWContextType ff_hwcontext_type_mediacodec
int(* frames_derive_to)(AVHWFramesContext *dst_ctx, AVHWFramesContext *src_ctx, int flags)
const HWContextType ff_hwcontext_type_dxva2
size_t device_priv_size
size of the private data, i.e.
const HWContextType * hw_type
int(* map_to)(AVHWFramesContext *ctx, AVFrame *dst, const AVFrame *src, int flags)
int(* device_derive)(AVHWDeviceContext *dst_ctx, AVHWDeviceContext *src_ctx, int flags)
AVBufferPool * pool_internal
size_t frames_priv_size
size of the private data, i.e.
size_t device_hwctx_size
size of the public hardware-specific context, i.e.
int(* frames_get_constraints)(AVHWDeviceContext *ctx, const void *hwconfig, AVHWFramesConstraints *constraints)
const HWContextType ff_hwcontext_type_qsv
size_t frames_hwctx_size
size of the public frame pool hardware-specific context, i.e.
int(* map_from)(AVHWFramesContext *ctx, AVFrame *dst, const AVFrame *src, int flags)
AVBufferRef * source_frames
For a derived context, a reference to the original frames context it was derived from.
const HWContextType ff_hwcontext_type_videotoolbox
reference-counted frame API
void(* device_uninit)(AVHWDeviceContext *ctx)
AVFrame * source
A reference to the original source of the mapping.
enum AVPixelFormat * pix_fmts
An array of pixel formats supported by the AVHWFramesContext instances Terminated by AV_PIX_FMT_NONE...
size_t device_hwconfig_size
Size of the hardware-specific device configuration.
void(* unmap)(AVHWFramesContext *ctx, struct HWMapDescriptor *hwmap)
Unmap function.
typedef void(APIENTRY *FF_PFNGLACTIVETEXTUREPROC)(GLenum texture)
int ff_hwframe_map_create(AVBufferRef *hwframe_ref, AVFrame *dst, const AVFrame *src, void(*unmap)(AVHWFramesContext *ctx, HWMapDescriptor *hwmap), void *priv)
void * priv
Hardware-specific private data associated with the mapping.
This struct describes the constraints on hardware frames attached to a given device with a hardware-s...
int(* device_create)(AVHWDeviceContext *ctx, const char *device, AVDictionary *opts, int flags)
int source_allocation_map_flags
Flags to apply to the mapping from the source to the derived frame context when trying to allocate in...
int(* frames_get_buffer)(AVHWFramesContext *ctx, AVFrame *frame)
This struct describes a set or pool of "hardware" frames (i.e.
refcounted data buffer API
AVBufferRef * hw_frames_ctx
A reference to the hardware frames context in which this mapping was made.
int(* frames_derive_from)(AVHWFramesContext *dst_ctx, AVHWFramesContext *src_ctx, int flags)
int(* transfer_data_from)(AVHWFramesContext *ctx, AVFrame *dst, const AVFrame *src)
int(* transfer_data_to)(AVHWFramesContext *ctx, AVFrame *dst, const AVFrame *src)
const HWContextType ff_hwcontext_type_d3d11va
A reference to a data buffer.
const HWContextType * hw_type
const HWContextType ff_hwcontext_type_opencl
const HWContextType ff_hwcontext_type_drm
const HWContextType ff_hwcontext_type_cuda
AVHWFrameTransferDirection
int(* transfer_get_formats)(AVHWFramesContext *ctx, enum AVHWFrameTransferDirection dir, enum AVPixelFormat **formats)
AVBufferRef * source_device
For a derived device, a reference to the original device context it was derived from.
int(* device_init)(AVHWDeviceContext *ctx)
int(* frames_init)(AVHWFramesContext *ctx)
AVPixelFormat
Pixel format.
const HWContextType ff_hwcontext_type_vaapi