[Ffmpeg-devel] [PATCH] introduce swscale interface inlibavcodec

Michael Niedermayer michaelni
Mon Apr 10 16:47:04 CEST 2006


On Mon, Apr 10, 2006 at 03:03:13PM +0200, Luca Abeni wrote:
> Hi Michael,
> On Mon, 2006-04-10 at 13:13 +0200, Michael Niedermayer wrote:
> [...]
> > > > hmm, i thought sws should support both mplayer style and ffmpeg style img
> > > > formats externally ...
> > > I must have misunderstood something, then ;-)
> > > Anyway, I can add a new flag SWS_FFMPEG_PIXFMT that enables ffmpeg style
> > > format names when set (so, mplayer will not set such flag and will
> > > continue to use its own format names. FFMpeg will set the flag and will
> > > use PIX_FMT_*).
> > 
> > well using only ffmpeg style formats is fine too (and maybe better) but
> > then why did you move img_format.h over?
> It's used by swscale internally. So, I copied it in libswscale to allow
> swscale.c & friends to compile. My plan was:
> 1) first import swscale, with FFMpeg style PIX_FMT_* used in the
> interface, but without changing swscale internals (to avoid introducing
> bugs)
> 2) after that, swscale can be changed to use PIX_FMT_* internally
> (instead of converting from ffmpeg's names to mplayer's names in
> getContext). This is "potentially dangerous", so I was thinking about
> doing this change in a second time, after things proved to be stable
> enough.
> So, my plan was to have img_format.h as a private header in libswscale
> for a (hopefully) short "transition period".


> At this point, I do not know if this idea was good enough, or if it's
> better to add a SWS_FFMPEG_PIXFMT flag and allow both FFMpeg's and
> mplayer's pixel format names in the interface. Let me know which
> solution is better, and I'll go for it.

ffmpeg currently doesnt support all pix_fmts sws supports IIRC, so
you will have to add them ...

id say sws should only support ffmpeg style and mplayer should have a
wraper function which does the conversaton from mplayer img_fmt to
ffmpegs pix_fmt


In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is

More information about the ffmpeg-devel mailing list