freshplayerplugin icon indicating copy to clipboard operation
freshplayerplugin copied to clipboard

Build failure

Open SolarAquarion opened this issue 6 years ago • 5 comments

/home/solaraquarion/build/freshplayerplugin-git/src/freshplayerplugin-git/src/ppb_video_decoder.c:119:12: warning: ‘vaapi_context’ is deprecated [-Wdeprecated-declarations]
     struct vaapi_context    va_context;
            ^~~~~~~~~~~~~
In file included from /home/solaraquarion/build/freshplayerplugin-git/src/freshplayerplugin-git/src/ppb_video_decoder.c:45:0:
/usr/include/libavcodec/vaapi.h:56:29: note: declared here
 struct attribute_deprecated vaapi_context {
                             ^~~~~~~~~~~~~
/home/solaraquarion/build/freshplayerplugin-git/src/freshplayerplugin-git/src/ppb_video_decoder.c: In function ‘initialize_decoder’:
/home/solaraquarion/build/freshplayerplugin-git/src/freshplayerplugin-git/src/ppb_video_decoder.c:623:37: error: ‘CODEC_CAP_TRUNCATED’ undeclared (first use in this function); did you mean ‘AV_CODEC_CAP_TRUNCATED’?
     if (vd->avcodec->capabilities & CODEC_CAP_TRUNCATED) {
                                     ^~~~~~~~~~~~~~~~~~~
                                     AV_CODEC_CAP_TRUNCATED
/home/solaraquarion/build/freshplayerplugin-git/src/freshplayerplugin-git/src/ppb_video_decoder.c:623:37: note: each undeclared identifier is reported only once for each function it appears in
/home/solaraquarion/build/freshplayerplugin-git/src/freshplayerplugin-git/src/ppb_video_decoder.c:625:29: error: ‘CODEC_FLAG_TRUNCATED’ undeclared (first use in this function); did you mean ‘CODEC_CAP_TRUNCATED’?
         vd->avctx->flags |= CODEC_FLAG_TRUNCATED;
                             ^~~~~~~~~~~~~~~~~~~~
                             CODEC_CAP_TRUNCATED
/home/solaraquarion/build/freshplayerplugin-git/src/freshplayerplugin-git/src/ppb_video_decoder.c:634:5: warning: ‘refcounted_frames’ is deprecated [-Wdeprecated-declarations]
     vd->avctx->refcounted_frames = 1;
     ^~
In file included from /home/solaraquarion/build/freshplayerplugin-git/src/freshplayerplugin-git/src/ppb_video_decoder.c:44:0:
/usr/include/libavcodec/avcodec.h:2328:9: note: declared here
     int refcounted_frames;
         ^~~~~~~~~~~~~~~~~
/home/solaraquarion/build/freshplayerplugin-git/src/freshplayerplugin-git/src/ppb_video_decoder.c: In function ‘issue_frame’:
/home/solaraquarion/build/freshplayerplugin-git/src/freshplayerplugin-git/src/ppb_video_decoder.c:787:5: warning: ‘pkt_pts’ is deprecated [-Wdeprecated-declarations]
     int32_t  bitstream_buffer_id = (int32_t)frame->pkt_pts;
     ^~~~~~~
In file included from /usr/include/libavcodec/avcodec.h:38:0,
                 from /home/solaraquarion/build/freshplayerplugin-git/src/freshplayerplugin-git/src/ppb_video_decoder.c:44:
/usr/include/libavutil/frame.h:302:13: note: declared here
     int64_t pkt_pts;
             ^~~~~~~
/home/solaraquarion/build/freshplayerplugin-git/src/freshplayerplugin-git/src/ppb_video_decoder.c: In function ‘decode_frame’:
/home/solaraquarion/build/freshplayerplugin-git/src/freshplayerplugin-git/src/ppb_video_decoder.c:871:5: warning: ‘avcodec_decode_video2’ is deprecated [-Wdeprecated-declarations]
     int len = avcodec_decode_video2(vd->avctx, vd->avframe, &got_frame, &packet);
     ^~~
In file included from /home/solaraquarion/build/freshplayerplugin-git/src/freshplayerplugin-git/src/ppb_video_decoder.c:44:0:
/usr/include/libavcodec/avcodec.h:4664:5: note: declared here
 int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
     ^~~~~~~~~~~~~~~~~~~~~
make[2]: *** [src/CMakeFiles/freshwrapper-obj.dir/build.make:1911: src/CMakeFiles/freshwrapper-obj.dir/ppb_video_decoder.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:322: src/CMakeFiles/freshwrapper-obj.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

SolarAquarion avatar Dec 25 '17 21:12 SolarAquarion

Try the latest version from master branch. I think, https://github.com/i-rinat/freshplayerplugin/commit/934aa9c24d34f8203744b56e4ac6e8599446ca02 should fix the build.

i-rinat avatar Dec 26 '17 13:12 i-rinat

I have these too, but if only if I'm building from a different directory than src

BlackMage2 avatar Dec 27 '17 16:12 BlackMage2

but if only if I'm building from a different directory than src

That's odd. Although I don't test building from the source directory and always build in a separate directory (usually named build), it shouldn't matter.

As far as I can tell, the issue is related to the FFmpeg headers. There is a transition started years ago, names of various constants got AV_ prefix, i.e. CODEC_CAP_TRUNCATED becoming AV_CODEC_CAP_TRUNCATED and so on. Both sets were there, so applications using FFmpeg were buildable. And now they started to remove old names. I think that will affect other applications too.

I use the latest release of FFmpeg, 3.4.1, and CODEC_CAP_TRUNCATED and the like are still there in the headers. But I think, next release won't have them. Probably, @SolarAquarion is using some development version from their source control repository.

i-rinat avatar Dec 27 '17 17:12 i-rinat

with me, I get exactly these errors only when I build from a different directory than freshplayerplugin/src

when I build in ${i-rinat/freshplayerplugin_REPO_ROOT}/src everything compiles without problems

Summary: when i build in ${i-rinat/freshplayerplugin_REPO_ROOT}/src it compiles good when i build ${i-rinat/freshplayerplugin_REPO_ROOT}/ I get the mistakes above

BlackMage2 avatar Dec 27 '17 17:12 BlackMage2

when i build in ${i-rinat/freshplayerplugin_REPO_ROOT}/src it compiles good when i build ${i-rinat/freshplayerplugin_REPO_ROOT}/ I get the mistakes above

That shouldn't matter, unless there are some remainders from previous configurations. CMake projects are not really reconfigurable. So if you some older copy of sources, run cmake there, then update sources and continue to build, there could be build issues. The easiest way is to remove everything CMake generated and start again. That's why README recommends to make directory build and configure/build there. That way all generated files may be removed easily. If one builds directly in source root, generated files are created right there, and may be hard to locate then when one wants to cleanup.

I believe that if you start with a fresh copy of sources, build should succeed in both cases.

i-rinat avatar Feb 11 '18 11:02 i-rinat