Path: blob/master/dep/ffmpeg/include/libavutil/hwcontext_opencl.h
4216 views
/*1* This file is part of FFmpeg.2*3* FFmpeg is free software; you can redistribute it and/or4* modify it under the terms of the GNU Lesser General Public5* License as published by the Free Software Foundation; either6* version 2.1 of the License, or (at your option) any later version.7*8* FFmpeg is distributed in the hope that it will be useful,9* but WITHOUT ANY WARRANTY; without even the implied warranty of10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU11* Lesser General Public License for more details.12*13* You should have received a copy of the GNU Lesser General Public14* License along with FFmpeg; if not, write to the Free Software15* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA16*/1718#ifndef AVUTIL_HWCONTEXT_OPENCL_H19#define AVUTIL_HWCONTEXT_OPENCL_H2021#ifdef __APPLE__22#include <OpenCL/cl.h>23#else24#include <CL/cl.h>25#endif2627#include "frame.h"2829/**30* @file31* API-specific header for AV_HWDEVICE_TYPE_OPENCL.32*33* Pools allocated internally are always dynamic, and are primarily intended34* to be used in OpenCL-only cases. If interoperation is required, it is35* typically required to allocate frames in the other API and then map the36* frames context to OpenCL with av_hwframe_ctx_create_derived().37*/3839/**40* OpenCL frame descriptor for pool allocation.41*42* In user-allocated pools, AVHWFramesContext.pool must return AVBufferRefs43* with the data pointer pointing at an object of this type describing the44* planes of the frame.45*/46typedef struct AVOpenCLFrameDescriptor {47/**48* Number of planes in the frame.49*/50int nb_planes;51/**52* OpenCL image2d objects for each plane of the frame.53*/54cl_mem planes[AV_NUM_DATA_POINTERS];55} AVOpenCLFrameDescriptor;5657/**58* OpenCL device details.59*60* Allocated as AVHWDeviceContext.hwctx61*/62typedef struct AVOpenCLDeviceContext {63/**64* The primary device ID of the device. If multiple OpenCL devices65* are associated with the context then this is the one which will66* be used for all operations internal to FFmpeg.67*/68cl_device_id device_id;69/**70* The OpenCL context which will contain all operations and frames on71* this device.72*/73cl_context context;74/**75* The default command queue for this device, which will be used by all76* frames contexts which do not have their own command queue. If not77* intialised by the user, a default queue will be created on the78* primary device.79*/80cl_command_queue command_queue;81} AVOpenCLDeviceContext;8283/**84* OpenCL-specific data associated with a frame pool.85*86* Allocated as AVHWFramesContext.hwctx.87*/88typedef struct AVOpenCLFramesContext {89/**90* The command queue used for internal asynchronous operations on this91* device (av_hwframe_transfer_data(), av_hwframe_map()).92*93* If this is not set, the command queue from the associated device is94* used instead.95*/96cl_command_queue command_queue;97} AVOpenCLFramesContext;9899#endif /* AVUTIL_HWCONTEXT_OPENCL_H */100101102