[FFmpeg-devel] [PATCH 2/2] ffmpeg: Set default output format for dummy hwaccels

Philip Langdale philipl at overt.org
Tue Jun 27 06:46:48 EEST 2017


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Mon, 26 Jun 2017 21:19:28 +0200
Michael Niedermayer <michael at niedermayer.cc> wrote:

> On Sun, Jun 25, 2017 at 02:27:06PM -0700, Philip Langdale wrote:
> > Dummy hwaccels, of which cuvid is the best example, behave
> > differently from real hwaccels. In the past, one of these
> > behaviours was that selecting the hwaccel would automatically cause
> > the decoder (and remember it's a dedicated decoder) to use the
> > native hardware output format.
> > 
> > This meant that transcoding command lines would pass frames through
> > device memory automatically once the right hwaccel and
> > decoder/encoder were selected.
> > 
> > With the generic hwaccel code path, dummy decoders end up following
> > the 'real' hwaccel path where the output format defaults to a
> > software format.
> > 
> > To avoid users facing an unexpected change in behaviour, we now
> > indicate whether an hwaccel is a dummy, and if it is, we set the
> > default output format appropriately.
> > 
> > To make this process easier, I updated ffmpeg to pass the HWAccel
> > struct to the init() call so that we know which decoder we are
> > dealing with.
> > 
> > Signed-off-by: Philip Langdale <philipl at overt.org>
> > ---
> >  ffmpeg.c              |  2 +-
> >  ffmpeg.h              | 15 +++++++++++----
> >  ffmpeg_dxva2.c        |  2 +-
> >  ffmpeg_hw.c           |  5 ++++-
> >  ffmpeg_opt.c          | 21 ++++++++++++++-------
> >  ffmpeg_qsv.c          |  2 +-
> >  ffmpeg_videotoolbox.c |  2 +-
> >  7 files changed, 33 insertions(+), 16 deletions(-)  
> 
> breaks build on mingw64
> 
> CC      ffmpeg_dxva2.o
> src/ffmpeg_dxva2.c:409:5: error: conflicting types for ‘dxva2_init’
>  int dxva2_init(const HWAccel *hwaccel, AVCodecContext *s)
>      ^
> In file included from src/ffmpeg_dxva2.c:33:0:
> src/ffmpeg.h:671:5: note: previous declaration of ‘dxva2_init’ was
> here int dxva2_init(AVCodecContext *s);
>      ^
> make: *** [ffmpeg_dxva2.o] Error 1
> 
> [...]

Thanks. Fixed locally.

- --phil
-----BEGIN PGP SIGNATURE-----

iEYEARECAAYFAllR1SgACgkQ+NaxlGp1aC7nqQCfTHxMgT3im0kFQmRgmkC1AWgr
j/oAn1XHGRsNncAp6cPqsHYvhOvkfZQ1
=qzKq
-----END PGP SIGNATURE-----


More information about the ffmpeg-devel mailing list