[Ffmpeg-devel] Prefix for img_* functions

Panagiotis Issaris takis
Sat Mar 3 22:39:23 CET 2007


Hi,

Michael Niedermayer schreef:
> Hi
>
> On Thu, Mar 01, 2007 at 11:20:51PM +0100, Aurelien Jacobs wrote:
>   
>> On Thu, 1 Mar 2007 17:20:21 +0100
>> Michael Niedermayer <michaelni at gmx.at> wrote:
>>
>>     
>>> Hi
>>>
>>> On Thu, Mar 01, 2007 at 05:16:43PM +0100, Panagiotis Issaris wrote:
>>>       
>>>> -----BEGIN PGP SIGNED MESSAGE-----
>>>> Hash: SHA1
>>>>
>>>> Hi,
>>>>
>>>> Michael Niedermayer schreef:
>>>>         
>>>>> Hi
>>>>>
>>>>> On Mon, Feb 26, 2007 at 03:27:10AM +0100, Panagiotis Issaris wrote:
>>>>>           
>>>>>> Hi,
>>>>>>
>>>>>> Shouldn't the img_crop, img_copy and img_pad functions get av_ prefixes?
>>>>>>             
>>>>> yes but the old should stay available under #if version something and
>>>>> with deprecated attribute
>>>>>           
>>>> How would you prefer having the old versions available? Using #define's,
>>>> duplicate code or the old functions calling the new ones? Or some other way?
>>>>         
>>> #defines seem best after 5sec of thoughts
>>>       
>> Unless I'm totaly mistaken, #define would cause an ABI break.
>> I think the only reasonable way without breaking ABI is old functions
>> calling the new ones.
>>     
>
> argh yes of course, ill try to find 10l
>   

Here's an updated patch which renames img_copy, img_crop and img_pad to 
av_picture_* variants. This time without ABI breakage.

 ffmpeg.c                 |    8 ++++----
 libavcodec/avcodec.h     |   17 ++++++++++++++---
 libavcodec/imgconvert.c  |   29 +++++++++++++++++++++++++----
 libavcodec/imgresample.c |    2 +-
 libavcodec/nuv.c         |    2 +-
 libavcodec/utils.c       |    2 +-
 6 files changed, 46 insertions(+), 14 deletions(-)

There is also a function img_get_alpha_info(), is it okay to rename that 
one too? In the same patch or in a separate one?

I'm a bit confused regarding the FFmpeg project's naming conventions: 
Some functions are prefixed ith avcodec_, some with av_, some with 
avpicture_ some are not prefixed (such as register_avcodec, dump_format, 
parse_image_size, parse_frame_rate, parse_date, find_info_tag, 
video_grab_init, audio_init, dv1394_init, dc1394_init), some with ffm_ 
and now because of this patch :) three with av_picture.

I wasn't sure if I should prefix it with avpicture_ or av_picture, 
because: Well, there was already one prefixed with avpicture_ which made 
me want to prefix it with the same prefix, but as most other functions 
appeared to be prefixed with av_ I thought that it still might be a bit 
more consistent to use av_picture, hoping that avpicture_ might be 
allowed to be changed to av_picture too soon.

Is there a document describing naming conventions for the project?

With friendly regards,
Takis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pi-20070303T222654-ffmpeg-img_rename.diff
Type: text/x-patch
Size: 7009 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070303/838c55da/attachment.bin>



More information about the ffmpeg-devel mailing list