On 28/06/17 12:03, wm4 wrote:
> On Tue, 27 Jun 2017 22:50:44 +0100
> Mark Thompson <s...@jkqxz.net> wrote:
> 
>> ---
>>  configure                      |    5 +-
>>  doc/APIchanges                 |    4 +
>>  libavutil/Makefile             |    2 +
>>  libavutil/hwcontext.c          |    4 +
>>  libavutil/hwcontext.h          |    1 +
>>  libavutil/hwcontext_internal.h |    1 +
>>  libavutil/hwcontext_opencl.c   | 1303 
>> ++++++++++++++++++++++++++++++++++++++++
>>  libavutil/hwcontext_opencl.h   |   96 +++
>>  libavutil/version.h            |    4 +-
>>  9 files changed, 1417 insertions(+), 3 deletions(-)
>>  create mode 100644 libavutil/hwcontext_opencl.c
>>  create mode 100644 libavutil/hwcontext_opencl.h
>> ...
>> +/**
>> + * OpenCL frame descriptor for pool allocation.
>> + *
>> + * In user-allocated pools, AVHWFramesContext.pool must return AVBufferRefs
>> + * with the data pointer pointing at an object of this type describing the
>> + * planes of the frame.
>> + */
>> +typedef struct AVOpenCLFrameDescriptor {
>> +    /**
>> +     * Number of planes in the frame.
>> +     */
>> +    int nb_planes;
>> +    /**
>> +     * OpenCL image2d objects for each plane of the frame.
>> +     */
>> +    cl_mem planes[AV_NUM_DATA_POINTERS];
>> +} AVOpenCLFrameDescriptor;
> 
> Not sure if this should have more metadata about the formats?

I'm not sure what other metadata you want here?  This structure is used as the 
buffer reference, and also then also to carry the objects for some mapping 
cases where that is useful.  It doesn't actually end up in the frame itself.

>> +
>> +/**
>> + * OpenCL device details.
>> + *
>> + * Allocated as AVHWDeviceContext.hwctx
>> + */
>> +typedef struct AVOpenCLDeviceContext {
>> +    /**
>> +     * The primary device ID of the device.  If multiple OpenCL devices
>> +     * are associated with the context then this is the one which will
>> +     * be used for all operations internal to Libav.
>> +     */
>> +    cl_device_id device_id;
>> +    /**
>> +     * The OpenCL context which will contain all operations and frames on
>> +     * this device.
>> +     */
>> +    cl_context context;
>> +    /**
>> +     * The default command queue for this device, which will be used by all
>> +     * frames contexts which do not have their own command queue.  If not
>> +     * intialised by the user, a default queue will be created on the
>> +     * primary device.
>> +     */
>> +    cl_command_queue command_queue;
>> +} AVOpenCLDeviceContext;
> 
> Is the default queue also set on the public struct if created by Libav?

Not currently - it stays internal so that it is clear where all of the 
references to it are.

It could be put here with suitable documentation if you want?

>> +
>> +/**
>> + * OpenCL-specific data associated with a frame pool.
>> + *
>> + * Allocated as AVHWFramesContext.hwctx.
>> + */
>> +typedef struct AVOpenCLFramesContext {
>> +    /**
>> +     * The command queue used for internal asynchronous operations on this
>> +     * device (av_hwframe_transfer_data(), av_hwframe_map()).
>> +     *
>> +     * If this is not set, the command queue from the associated device is
>> +     * used instead.
>> +     */
>> +    cl_command_queue command_queue;
>> +} AVOpenCLFramesContext;
> 
> Same question.

Same answer.

Thanks,

- Mark

_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to