Discussion:
‘avcodec_alloc_frame’ was not declared in this scope
(too old to reply)
satya gowtham kudupudi
2016-02-13 19:58:22 UTC
Permalink
After a long time I've decided to rebuild my application. So I've compiled
latest ffmpeg and installed. But now when I try to rebuild my application
against latest ffmpeg, I got the following build errors.

libavcodec_util.cpp:156:33: error: ‘avcodec_alloc_frame’ was not declared
in this scope
frame = avcodec_alloc_frame();
^
libavcodec_util.cpp:219:13: warning: ‘void av_free_packet(AVPacket*)’ is
deprecated (declared at /usr/local/include/libavcodec/avcodec.h:4040)
[-Wdeprecated-declarations]
av_free_packet(&pkt);
^
libavcodec_util.cpp:219:32: warning: ‘void av_free_packet(AVPacket*)’ is
deprecated (declared at /usr/local/include/libavcodec/avcodec.h:4040)
[-Wdeprecated-declarations]
av_free_packet(&pkt);
^
libavcodec_util.cpp:233:13: warning: ‘void av_free_packet(AVPacket*)’ is
deprecated (declared at /usr/local/include/libavcodec/avcodec.h:4040)
[-Wdeprecated-declarations]
av_free_packet(&pkt);
^
libavcodec_util.cpp:233:32: warning: ‘void av_free_packet(AVPacket*)’ is
deprecated (declared at /usr/local/include/libavcodec/avcodec.h:4040)
[-Wdeprecated-declarations]
av_free_packet(&pkt);
^
libavcodec_util.cpp:238:30: error: ‘avcodec_free_frame’ was not declared in
this scope
avcodec_free_frame(&frame);
^
libavcodec_util.cpp: In function ‘void audio_decode_example(const char*,
const char*)’:
libavcodec_util.cpp:288:55: error: ‘avcodec_alloc_frame’ was not declared
in this scope
if (!(decoded_frame = avcodec_alloc_frame())) {
^
libavcodec_util.cpp:293:53: error: ‘avcodec_get_frame_defaults’ was not
declared in this scope
avcodec_get_frame_defaults(decoded_frame);
^
libavcodec_util.cpp:327:38: error: ‘avcodec_free_frame’ was not declared in
this scope
avcodec_free_frame(&decoded_frame);
^
libavcodec_util.cpp: In function ‘void video_encode_example(const char*,
int)’:
libavcodec_util.cpp:375:33: error: ‘avcodec_alloc_frame’ was not declared
in this scope
frame = avcodec_alloc_frame();
^
libavcodec_util.cpp:420:13: warning: ‘void av_free_packet(AVPacket*)’ is
deprecated (declared at /usr/local/include/libavcodec/avcodec.h:4040)
[-Wdeprecated-declarations]
av_free_packet(&pkt);
^
libavcodec_util.cpp:420:32: warning: ‘void av_free_packet(AVPacket*)’ is
deprecated (declared at /usr/local/include/libavcodec/avcodec.h:4040)
[-Wdeprecated-declarations]
av_free_packet(&pkt);
^
libavcodec_util.cpp:434:13: warning: ‘void av_free_packet(AVPacket*)’ is
deprecated (declared at /usr/local/include/libavcodec/avcodec.h:4040)
[-Wdeprecated-declarations]
av_free_packet(&pkt);
^
libavcodec_util.cpp:434:32: warning: ‘void av_free_packet(AVPacket*)’ is
deprecated (declared at /usr/local/include/libavcodec/avcodec.h:4040)
[-Wdeprecated-declarations]
av_free_packet(&pkt);
^
libavcodec_util.cpp:443:30: error: ‘avcodec_free_frame’ was not declared in
this scope
avcodec_free_frame(&frame);
^
libavcodec_util.cpp: In function ‘void video_decode_example(const char*,
const char*)’:
libavcodec_util.cpp:524:33: error: ‘avcodec_alloc_frame’ was not declared
in this scope
frame = avcodec_alloc_frame();
^
libavcodec_util.cpp:560:30: error: ‘avcodec_free_frame’ was not declared in
this scope
avcodec_free_frame(&frame);


Apparently libavcodec API got updated. What is the alternative
implementation for the above errors?

--
Gowtham
Gonzalo
2016-02-13 22:00:11 UTC
Permalink
Post by satya gowtham kudupudi
After a long time I've decided to rebuild my application. So I've
compiled latest ffmpeg and installed. But now when I try to rebuild my
application against latest ffmpeg, I got the following build errors.
libavcodec_util.cpp:156:33: error: ‘avcodec_alloc_frame’ was not
declared in this scope
frame = avcodec_alloc_frame();
av_frame_alloc()
Post by satya gowtham kudupudi
^
libavcodec_util.cpp:219:13: warning: ‘void av_free_packet(AVPacket*)’
is deprecated (declared at
/usr/local/include/libavcodec/avcodec.h:4040) [-Wdeprecated-declarations]
av_free_packet(&pkt);
^
av_packet_unref(&pkt);
Post by satya gowtham kudupudi
^
libavcodec_util.cpp:238:30: error: ‘avcodec_free_frame’ was not
declared in this scope
avcodec_free_frame(&frame);
av_frame_free(&frame);
Post by satya gowtham kudupudi
^
^
libavcodec_util.cpp:293:53: error: ‘avcodec_get_frame_defaults’ was
not declared in this scope
avcodec_get_frame_defaults(decoded_frame);
Not sure, you'll need to check some old .h files for the deprecation
warning.
--
Gonzalo Garramuño
***@gmail.com
Satya Gowtham Kudupudi
2016-02-14 17:44:04 UTC
Permalink
Post by Gonzalo
After a long time I've decided to rebuild my application. So I've compiled latest ffmpeg and installed. But now when I try to rebuild my application against latest ffmpeg, I got the following build errors.
libavcodec_util.cpp:156:33: error: ‘avcodec_alloc_frame’ was not declared in this scope
frame = avcodec_alloc_frame();
av_frame_alloc()
^
libavcodec_util.cpp:219:13: warning: ‘void av_free_packet(AVPacket*)’ is deprecated (declared at /usr/local/include/libavcodec/avcodec.h:4040) [-Wdeprecated-declarations]
av_free_packet(&pkt);
^
av_packet_unref(&pkt);
^
libavcodec_util.cpp:238:30: error: ‘avcodec_free_frame’ was not declared in this scope
avcodec_free_frame(&frame);
av_frame_free(&frame);
^
^
libavcodec_util.cpp:293:53: error: ‘avcodec_get_frame_defaults’ was not declared in this scope
avcodec_get_frame_defaults(decoded_frame);
Not sure, you'll need to check some old .h files for the deprecation warning.
av_frame_unref(&frame)
Post by Gonzalo
--
Gonzalo Garramuño
_______________________________________________
Libav-user mailing list
http://ffmpeg.org/mailman/listinfo/libav-user
Thank you!

—
Gowtham

Loading...