[FFmpeg-devel] [PATCH] lavc/amfenc: Reference to input AVFrame (hwaccel) is retained during the encoding process

Michael Niedermayer michael at niedermayer.cc
Tue Mar 27 00:50:25 EEST 2018


On Mon, Mar 26, 2018 at 01:41:20PM +0300, Alexander Kravchenko wrote:
> Hello,
> I have fixed issues listed in previous patch.
> 
> 
> > Say what the change is in the title.  Something like "amfenc: Retain a reference to D3D11 frames used as input during the encoding
> > process", maybe?
> Sure, but I am preparing next patch adding DX9 support, so probably better to write D3D instead D3D11
> 
> > 
> > How many frames can end up queued inside the encoder here?
> 16
> 
> > 
> > Is there always an exact 1->1 correspondence between input frames and output packets?  That is, is it guaranteed that no frames are
> > ever dropped, even in the low-latency modes?
> yes
> 
> > Put the * in the right place - it's part of the declarator, not the declaration-specifiers.
> > "if (", and in all places below too.
> I have fixed these issues in whole file (Hopefully you don’t mind if it put to same commit. There aren't many pf them)
> 
> 

> From: Alexander Kravchenko <akravchenko188 at gmail.com>
> ---
>  libavcodec/amfenc.c | 89 ++++++++++++++++++++++++++++++++++++++++++++++++-----
>  1 file changed, 81 insertions(+), 8 deletions(-)
> 
> diff --git a/libavcodec/amfenc.c b/libavcodec/amfenc.c
> index 89a10ff253..f532a32b7b 100644
> --- a/libavcodec/amfenc.c
> +++ b/libavcodec/amfenc.c
> @@ -188,7 +188,7 @@ static int amf_init_context(AVCodecContext *avctx)
>                              return AVERROR(ENOMEM);
>                          }
>                      } else {
> -                        if(res == AMF_NOT_SUPPORTED)
> +                        if (res == AMF_NOT_SUPPORTED)
>                              av_log(avctx, AV_LOG_INFO, "avctx->hw_frames_ctx has D3D11 device which doesn't have D3D11VA interface, switching to default\n");
>                          else
>                              av_log(avctx, AV_LOG_INFO, "avctx->hw_frames_ctx has non-AMD device, switching to default\n");
> @@ -298,7 +298,7 @@ int av_cold ff_amf_encode_close(AVCodecContext *avctx)
>  }
>  
>  static int amf_copy_surface(AVCodecContext *avctx, const AVFrame *frame,
> -    AMFSurface* surface)
> +    AMFSurface *surface)
>  {
>      AVFrame        *sw_frame = NULL;
>      AMFPlane       *plane = NULL;

These changes are unrelated and should not be in this patch


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

Those who are best at talking, realize last or never when they are wrong.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20180326/16582d5d/attachment.sig>


More information about the ffmpeg-devel mailing list