[FFmpeg-devel] [RFC] Reintroduce sws_getContext() as sws_create_context()

Cyril Russo stage.nexvision
Fri Nov 5 15:29:39 CET 2010



>>> 3) Since SwsContext structure can change, the user code (mine) could
>>> break if you rename/remove a member of the struct.
> It is a private struct as said so this problem does not exist
> The correct way is to access is via av_set_int() and its friends
> The old api still exists and other ways may be provided to access it if the
> need arrises
I agree 100% with you. It's a bit premature to deprecate this, if there 
is no real alternative than to continue using the deprecated function, 
except for GCC output's pollution.
>
>>> 4) sws_getCachedContext is still here but not deprecated, and the
>>> documentation refer to sws_getContext.
>>> 5) I finally have to duplicate the getContext code in my code, and
>>> handle all the possible errors myself.
>>>
>>> For me, I would prefer the "blackbox" idea, and having a function
>>> that does the dirty work of filling the opaque structure member
>>> correctly, and not having to deal with it.
> we have that, its av_set_int/av_set_string ...
>
Yes, you're right.
That's the reason for the other thread about forcing FFmpeg developpers 
to always add something that could read:
"@deprecated Use sws_alloc_content, then set the required field with 
av_set_int and initialize the context with sws_init_context"
in deprecation commits above the attribute_deprecated.
Not every one reads the FFmpeg dev list, and finding such information is 
hard for the library user.

Cheers,
Cyril





More information about the ffmpeg-devel mailing list