[FFmpeg-devel] [PATCH] avutil/hwcontext_cuda: add AVCUDAFramesContext and AVCUDAFramesContext.flags

Timo Rothenpieler timo at rothenpieler.org
Tue May 8 19:30:12 EEST 2018


Am 08.05.2018 um 17:49 schrieb wm4:
> On Tue, 8 May 2018 17:43:49 +0200
> Timo Rothenpieler <timo at rothenpieler.org> wrote:
> 
>>>> -    frame->buf[0] = av_buffer_pool_get(ctx->pool);
>>>> +    if (frctx->flags & AV_CUDA_HWFRAMES_DUMMY_MODE)
>>>> +        frame->buf[0] = av_buffer_create(NULL, 0, NULL, NULL, 0);
>>>> +    else
>>>> +        frame->buf[0] = av_buffer_pool_get(ctx->pool);
>>>> +
>>>
>>> Is this really needed? Because at least videotoolbox also lets the
>>> decoder allocate frames, and allocates the "dummy" buffers outside of
>>> the hwcontext. (I don't quite remember how it works.)
>>
>> You mean compared to just leaving buf[0] empty?
>>
> 
> No, compared to how the videotoolbox code does things.

videotoolbox seems to use an externally supplied AVHWFramesContext::pool.
Which should be possible to do for cuda as well, i.e. a custom buffer 
pool that returns mostly empty data, so the new API would be unneeded. 
I'll have a look if it works out.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3994 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20180508/855c3c30/attachment.bin>


More information about the ffmpeg-devel mailing list