FFmpeg
hwcontext_opencl.h
Go to the documentation of this file.
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_OPENCL_H
20 #define AVUTIL_HWCONTEXT_OPENCL_H
21 
22 #ifdef __APPLE__
23 #include <OpenCL/cl.h>
24 #else
25 #include <CL/cl.h>
26 #endif
27 
28 #include "frame.h"
29 
47 typedef struct AVOpenCLFrameDescriptor {
51  int nb_planes;
55  cl_mem planes[AV_NUM_DATA_POINTERS];
57 
63 typedef struct AVOpenCLDeviceContext {
69  cl_device_id device_id;
74  cl_context context;
81  cl_command_queue command_queue;
83 
89 typedef struct AVOpenCLFramesContext {
97  cl_command_queue command_queue;
99 
100 #endif /* AVUTIL_HWCONTEXT_OPENCL_H */
struct AVOpenCLFramesContext AVOpenCLFramesContext
OpenCL-specific data associated with a frame pool.
OpenCL frame descriptor for pool allocation.
Definition: hwcontext_opencl.h:47
cl_device_id device_id
The primary device ID of the device.
Definition: hwcontext_opencl.h:69
cl_command_queue command_queue
The command queue used for internal asynchronous operations on this device (av_hwframe_transfer_data(...
Definition: hwcontext_opencl.h:97
reference-counted frame API
int nb_planes
Number of planes in the frame.
Definition: hwcontext_opencl.h:51
struct AVOpenCLFrameDescriptor AVOpenCLFrameDescriptor
OpenCL frame descriptor for pool allocation.
OpenCL-specific data associated with a frame pool.
Definition: hwcontext_opencl.h:89
struct AVOpenCLDeviceContext AVOpenCLDeviceContext
OpenCL device details.
cl_mem planes[AV_NUM_DATA_POINTERS]
OpenCL image2d objects for each plane of the frame.
Definition: hwcontext_opencl.h:55
cl_command_queue command_queue
The default command queue for this device, which will be used by all frames contexts which do not hav...
Definition: hwcontext_opencl.h:81
OpenCL device details.
Definition: hwcontext_opencl.h:63
cl_context context
The OpenCL context which will contain all operations and frames on this device.
Definition: hwcontext_opencl.h:74