[FFmpeg-devel] [PATCH 2/6] avcodec/nvdec: avoid needless copy of output frame

Timo Rothenpieler timo at rothenpieler.org
Thu May 10 12:39:37 EEST 2018


Am 10.05.2018 um 04:51 schrieb Wang Bin:
>>
>>
>>
>> -        offset += cpy.Height;
>> +    frame->buf[1] = av_buffer_create((uint8_t *)unmap_data,
>> sizeof(*unmap_data),
>> +                                     nvdec_unmap_mapped_frame,
>> (void*)devptr,
>> +                                     AV_BUFFER_FLAG_READONLY);
>> +    if (!frame->buf[1]) {
>> +        ret = AVERROR(ENOMEM);
>> +        goto copy_fail;
>>       }
>>
>>
> If AVFrame.buf[i] is non-NULL, then buf[j] must be non-NULL for all j < i,
> see libavutil/frame.h. So either change the comment in frame.h or change
> your implementation is required

buf[0] is filled by the hw_frames_ctx, with a dummy buffer, but it is 
filled.
So after this buf[0] and buf[1] are filled, so I don't see the problem?

-------------- 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/20180510/f5411126/attachment.bin>


More information about the ffmpeg-devel mailing list