check for needed version of libavcode, libavformat and libavutil
ClosedPublic

Authored by mgallien on Jun 3 2018, 1:29 PM.

Details

Summary

check for needed version of libavcode, libavformat and libavutil

modify FindFFmpeg.cmake to better handle the components of ffmpeg and
allow to check the version of a component

ask for the versions of each component in the 3.1 version of ffmpeg

versions check do not work, so we manually checks that AVstream
structure has codecpar member

Test Plan

the check for codecpar member in AVStream structure works fine

Diff Detail

Repository
R286 KFileMetaData
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
mgallien created this revision.Jun 3 2018, 1:29 PM
Restricted Application added projects: Frameworks, Baloo. · View Herald TranscriptJun 3 2018, 1:29 PM
Restricted Application added subscribers: Baloo, kde-frameworks-devel. · View Herald Transcript
mgallien requested review of this revision.Jun 3 2018, 1:29 PM
mgallien updated this revision to Diff 35456.Jun 3 2018, 1:52 PM
  • check AVStrean structure have codecpar member

working check for codecpar member in AVStream structure

should I try to make the result variable be not in the cmake cache ?

mgallien retitled this revision from [WIP] check for needed version of libavcode, libavformat and libavutil to check for needed version of libavcode, libavformat and libavutil.Jun 3 2018, 1:53 PM
mgallien edited the test plan for this revision. (Show Details)
mgallien updated this revision to Diff 35457.Jun 3 2018, 2:00 PM
  • prefer usage of CHECK_STRUCT_HAS_MEMBER instead of having test code

the test is shorter with CHECK_STRUCT_HAS_MEMBER (thanks @adridg for the help)

I tried this patch on Neon with FFmpeg 2.8.14.

KFileMetaData builds now because it detects that the FFmpeg module version numbers are too low.

CMake log: P230

Few remarks:

  • In the log it says 3 times Could NOT find FFmpeg (missing: HAVE_AVSTREAM_CODECPAR) (Required is at least version "<version number>") with <version number> being different values.
  • In the log it shows now nowhere 2.8.14 for FFmpeg anymore. In the end it falsely says: FFmpeg (required version >= 55.27)
  • Instead of building on Neon without FFmpeg support KFileMetaData should just fall back to using the deprecated function name AVCodecContext or better we should revert 037208a787e0 and 3415015e3d45 as long as Neon is not with FFmpeg >= 3.1 (but improving the FFmpeg version detection as tried with this patch here would still be good of course).
mgallien updated this revision to Diff 35712.EditedJun 6 2018, 8:18 PM
  • checks if FFmpeg provides the new API and use it only in this case

extend the existing configure header to allow to compile both versions of the code in the FFmpeg extractor

in case the new API exists, we prefer it and we also support compilation with the old one

kept the code checking for the new versions even we do not know how to properly check for it (pkg-config is only used to get an hint before searching headers and libraries and only on platforms with pkg-config)

jriddell accepted this revision.Jun 7 2018, 9:36 AM
jriddell added a subscriber: jriddell.

latest patch works well in neon

This revision is now accepted and ready to land.Jun 7 2018, 9:36 AM
This revision was automatically updated to reflect the committed changes.