On Sat, Aug 08, 2015 at 05:58:29PM +0200, wm4 wrote: > On Sat, 8 Aug 2015 17:14:58 +0200 > Michael Niedermayer <michae...@gmx.at> wrote: > > > From: Michael Niedermayer <mich...@niedermayer.cc> > > > > Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc> > > --- > > libswscale/swscale.h | 11 +++++++++++ > > libswscale/swscale_internal.h | 11 ----------- > > libswscale/version.h | 4 ++-- > > 3 files changed, 13 insertions(+), 13 deletions(-) > > > > diff --git a/libswscale/swscale.h b/libswscale/swscale.h > > index 903e120..055c9fc 100644 > > --- a/libswscale/swscale.h > > +++ b/libswscale/swscale.h > > @@ -161,6 +161,17 @@ int sws_isSupportedEndiannessConversion(enum > > AVPixelFormat pix_fmt); > > struct SwsContext *sws_alloc_context(void); > > > > /** > > + * Allocate and return an SwsContext. > > + * This is like sws_getContext() but does not perform the init step, > > allowing > > + * the user to set additional AVOptions. > > + * > > + * @see sws_getContext() > > + */ > > +struct SwsContext *sws_alloc_set_opts(int srcW, int srcH, enum > > AVPixelFormat srcFormat, > > + int dstW, int dstH, enum > > AVPixelFormat dstFormat, > > + int flags, const double *param); > > + > > This looks excessively useless and un-nice to use.
what do you suggest ? The function is intended to replace: context = sws_alloc_context() if (!context) handle error ret0 = av_opt_set_int(context, "sws_flags", flags, 0); ret1 = av_opt_set_int(context, "srcw", srcW, 0); ret2 = av_opt_set_int(context, "srch", srcH, 0); ret3 = av_opt_set_int(context, "dstw", dstW, 0); ret4 = av_opt_set_int(context, "dsth", dstH, 0); ret5 = av_opt_set_int(context, "src_format", srcFormat, 0); ret6 = av_opt_set_int(context, "dst_format", dstFormat, 0); ret7 = av_opt_set(context, "alphablend", "none", 0); if (ret0 <0) handle error, free context, return ret0 if (ret1 <0) handle error, free context, return ret1 if (ret2 <0) handle error, free context, return ret2 if (ret3 <0) handle error, free context, return ret3 if (ret4 <0) handle error, free context, return ret4 if (ret5 <0) handle error, free context, return ret5 if (ret6 <0) handle error, free context, return ret6 if (ret7 <0) handle error, free context, return ret7 by this: context = sws_alloc_set_opts(srcW, srcH, srcFormat, dstW, dstH, dstFormat, flags, NULL); if (!context) handle error ret = av_opt_set(context, "alphablend", "none", 0); if (ret <0) handle error, free context, return ret and that looks alot nicer to me, but if someone has a even better idea? -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB No snowflake in an avalanche ever feels responsible. -- Voltaire
signature.asc
Description: Digital signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel