[FFmpeg-devel] [PATCH] HWAccel infrastructure (take 5)

Gwenole Beauchesne gbeauchesne
Fri Feb 20 15:15:02 CET 2009


Le 20 f?vr. 09 ? 13:45, Michael Niedermayer a ?crit :

>> +     * @param avctx the codec context
>> +     * @param buf the frame data buffer base
>> +     * @param buf_size the size of the frame in bytes
>> +     * @return zero if successful, a negative value otherwise
>> +     */
>> +    int (*start_frame)(AVCodecContext *avctx, const uint8_t *buf,  
>> uint32_t buf_size);
>
> dont you want the current AVFrame as well? just a question ...

Well, we do retrieve it through s->current_picture_ptr. So, I don't  
think it's a real gain since the user would be using other things from  
the MpegEnContext anyway. You only avoid a memory load on systems with  
register-based calling conventions. You don't gain anything otherwise.

>> +    /* The default ::get_format() filters out HW accelerated  
>> formats */
>> +    if ((pix_fmt = avctx->get_format(avctx, pix_fmts)) !=  
>> PIX_FMT_NONE)
>> +        return hwaccels[pix_fmt];
>> +    return NULL;
>> +}
>
> the PIX_FMT_NONE check seems useless using pix_fmt+1 as index seems  
> to achive
> the same

OK, I was not NULL-initializing the array initially, so it's also a  
left-over from other code. Since we are querying the user, I'd  
probably have to bound-check the return value instead. Though, I can't  
imagine how a user could return anything else than what was given as  
arguments.



More information about the ffmpeg-devel mailing list