[FFmpeg-devel] [PATCH 47/50] doc/examples/vaapi_transcode: use av_packet_alloc() to allocate packets

James Almer jamrial at gmail.com
Fri Feb 5 19:10:26 EET 2021


On 2/5/2021 1:49 PM, Michael Niedermayer wrote:
> On Thu, Feb 04, 2021 at 04:10:02PM -0300, James Almer wrote:
>> Signed-off-by: James Almer <jamrial at gmail.com>
>> ---
>>   doc/examples/vaapi_transcode.c | 45 ++++++++++++++++++++--------------
>>   1 file changed, 26 insertions(+), 19 deletions(-)
> 
> maybe i forgot something but this

No, you didn't. This is one of the patches i couldn't test, but since 
it's an example i figured it was important to ensure it's adapted 
alongside the deprecation, so i wrote it blind.

Will try again, but otherwise someone with a vaapi enabled system will 
have to give it a try.

> breaks build here
> 
> make -j32 doc/examples/vaapi_transcode.o
> CC	doc/examples/vaapi_transcode.o
> doc/examples/vaapi_transcode.c: In function ‘main’:
> doc/examples/vaapi_transcode.c:296:21: warning: passing argument 1 of ‘av_packet_unref’ from incompatible pointer type [-Wincompatible-pointer-types]
>       av_packet_unref(&dec_pkt);
>                       ^
> In file included from ./libavcodec/bsf.h:30:0,
>                   from ./libavcodec/avcodec.h:44,
>                   from doc/examples/vaapi_transcode.c:38:
> ./libavcodec/packet.h:682:6: note: expected ‘AVPacket * {aka struct AVPacket *}’ but argument is of type ‘AVPacket ** {aka struct AVPacket **}’
>   void av_packet_unref(AVPacket *pkt);
>        ^~~~~~~~~~~~~~~
> doc/examples/vaapi_transcode.c:300:11: error: too few arguments to function ‘encode_write’
>       ret = encode_write(NULL);
>             ^~~~~~~~~~~~
> doc/examples/vaapi_transcode.c:112:12: note: declared here
>   static int encode_write(AVPacket *enc_pkt, AVFrame *frame)
>              ^~~~~~~~~~~~
> ffbuild/common.mak:67: recipe for target 'doc/examples/vaapi_transcode.o' failed
> make: *** [doc/examples/vaapi_transcode.o] Error 1
> 
> 
> [...]
> 
> 
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
> 



More information about the ffmpeg-devel mailing list