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

Michael Niedermayer michael at niedermayer.cc
Mon Jun 26 22:19:28 EEST 2017


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

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In fact, the RIAA has been known to suggest that students drop out
of college or go to community college in order to be able to afford
settlements. -- The RIAA
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20170626/b105a0df/attachment.sig>


More information about the ffmpeg-devel mailing list