[FFmpeg-cvslog] r32368 - in trunk/libswscale: swscale.h utils.c
Michael Niedermayer
michaelni
Mon Sep 27 01:43:24 CEST 2010
On Sun, Sep 26, 2010 at 11:06:42PM +0200, Aurelien Jacobs wrote:
> On Sun, Sep 26, 2010 at 05:00:40PM -0300, Ramiro Polla wrote:
> > On Sun, Sep 26, 2010 at 4:33 PM, michael <subversion at mplayerhq.hu> wrote:
> > > Author: michael
> > > Date: Sun Sep 26 21:33:57 2010
> > > New Revision: 32368
> > >
> > > Log:
> > > Split alloc and init of context so that parameters can be set in the context
> > > instead of requireing being passed through function parameters. This also
> > > makes sws work with AVOptions.
> >
> > Thanks
> >
> > > Modified:
> > > ? trunk/libswscale/swscale.h
> > > ? trunk/libswscale/utils.c
> > >
> > > Modified: trunk/libswscale/swscale.h
> > > ==============================================================================
> > > --- trunk/libswscale/swscale.h ?Sun Sep 26 21:33:48 2010 ? ? ? ?(r32367)
> > > +++ trunk/libswscale/swscale.h ?Sun Sep 26 21:33:57 2010 ? ? ? ?(r32368)
> > > @@ -144,6 +144,17 @@ int sws_isSupportedInput(enum PixelForma
> > > ?int sws_isSupportedOutput(enum PixelFormat pix_fmt);
> > >
> > > ?/**
> > > + * Alloctaes an empty SwsContext, this must be filled and passed to sws_init_context().
> > > + * For filling see AVOptions, options.c and sws_setColorspaceDetails().
> > > + */
> > > +struct SwsContext *sws_alloc_context(void);
> > > +
> > > +/**
> > > + * Initializs the swscaler context sws_context.
> > > + */
> > > +int sws_init_context(struct SwsContext *sws_context, SwsFilter *srcFilter, SwsFilter *dstFilter);
>
> What about taking this opportunity to use hierarchical names instead ?
> sws_context_alloc
> sws_context_init
> I think it's not too late.
i dont really care either way
>
> > One thing that particularly bothers me are the filters and params
> > being part of the arguments in the function call to initialize a
> > context. I haven't checked extensively, but almost no one uses them
> > (except for mplayer), which leads to an extra "NULL, NULL, NULL" to a
> > bunch of code.
>
> We could use this new API opportunity to also introduce those functions?
>
> SwsContext *sws_context_get_full(int src_w, int src_h, enum PixelFormat src_format,
> int dst_w, int dst_h, enum PixelFormat dst_format,
> int flags,
> SwsFilter *src_filter, SwsFilter
> *dst_filter,
> const double *param)
> {
> ...
> }
>
> SwsContext *sws_context_get(int src_w, int src_h, enum PixelFormat src_format,
> int dst_w, int dst_h, enum PixelFormat dst_format,
> int flags)
> {
> return sws_context_get_full(src_w, src_h, src_format,
> dst_w, dst_h, dst_format, flags,
> NULL, NULL, NULL);
> }
iam strongly against this, the api should stay simple
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Many that live deserve death. And some that die deserve life. Can you give
it to them? Then do not be too eager to deal out death in judgement. For
even the very wise cannot see all ends. -- Gandalf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-cvslog/attachments/20100927/4f73382c/attachment.pgp>
More information about the ffmpeg-cvslog
mailing list