build fixes for Ubuntu 16.04.2#11
Conversation
|
+1 |
|
broken for me on archlinux with those versions: ➜ ffmpeg --version
ffmpeg version 3.4.2 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 7.3.0 (GCC)
configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-avisynth --enable-avresample --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libass --enable-libbluray --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-shared --enable-version3 --enable-omx
libavutil 55. 78.100 / 55. 78.100
libavcodec 57.107.100 / 57.107.100
libavformat 57. 83.100 / 57. 83.100
libavdevice 57. 10.100 / 57. 10.100
libavfilter 6.107.100 / 6.107.100
libavresample 3. 7. 0 / 3. 7. 0
libswscale 4. 8.100 / 4. 8.100
libswresample 2. 9.100 / 2. 9.100
libpostproc 54. 7.100 / 54. 7.100 |
| #if LIBAVCODEC_VERSION_MAJOR < 54 | ||
| #define MAX_AUDIO_FRAME_SIZE AVCODEC_MAX_AUDIO_FRAME_SIZE | ||
| #else | ||
| #define MAX_AUDIO_FRAME_SIZE 192000 |
There was a problem hiding this comment.
where this sample rate come from?
There was a problem hiding this comment.
This is defined in the linked PR, nothing I added.
But it seems to be a generic hard coded limit for whatever reason and represents "1 second of 48khz 32-bit audio"
https://www.ffmpeg.org/doxygen/3.2/libavformat_2dvenc_8c_source.html#l00045
https://lists.ffmpeg.org/pipermail/ffmpeg-cvslog/2012-August/053785.html
| !defined(DISTRO_UBUNTU1111) && !defined(DISTRO_UBUNTU1204) && \ | ||
| !defined(DISTRO_DEBIAN7) && !defined(DISTRO_UBUNTU1404) && \ | ||
| !defined(DISTRO_DEBIAN8) | ||
| !defined(DISTRO_UBUNTU1604) && !defined(DISTRO_DEBIAN8) |
| } | ||
|
|
||
| INLINE void freerdp_color_split_rgb(uint32* color, int bpp, uint8* red, uint8* green, uint8* blue, uint8* alpha, HCLRCONV clrconv) | ||
| static INLINE void freerdp_color_split_rgb(uint32* color, int bpp, uint8* red, uint8* green, uint8* blue, uint8* alpha, HCLRCONV clrconv) |
There was a problem hiding this comment.
seems like those changes are irrelevant to this PR (not an ffmpeg api fixes)
either split it to another PR or remove them for now.
There was a problem hiding this comment.
Yes makes sense.
Will try to make an own PR for these changes.
|
|
||
| int media_type; | ||
| enum CodecID codec_id; | ||
| #if LIBAVCODEC_VERSION_MAJOR < 55 |
There was a problem hiding this comment.
I prefer not to pollute the code with inline ifdefs
we should use the latest API and backport it using our own defines (at the head of this file or smthg).
For example
#if LIBAVCODEC_VERSION_MAJOR < 55
#define AVCodecID CodecID
#endif| mdecoder->codec_context->channels = media_type->Channels; | ||
| mdecoder->codec_context->block_align = media_type->BlockAlign; | ||
|
|
||
| #if LIBAVCODEC_VERSION_MAJOR < 55 |
There was a problem hiding this comment.
same applies here.
lets make a wrapper for av_set_cpu_flags_mask and backport its code for older api.
(maybe even copy their implementation)
|
|
||
| if (mdecoder->decoded_size_max == 0) | ||
| mdecoder->decoded_size_max = AVCODEC_MAX_AUDIO_FRAME_SIZE + 16; | ||
| mdecoder->decoded_size_max = MAX_AUDIO_FRAME_SIZE + 16; |
There was a problem hiding this comment.
MAX_AUDIO_FRAME_SIZE shouldnt be defined by us
we should find another way to backport this code
| AVFrame *audio_frame; | ||
| AVFrame *video_frame; | ||
| #if defined(DISTRO_DEBIAN8) | ||
| #if defined(DISTRO_DEBIAN8) || defined(DISTRO_UBUNTU1604) |
There was a problem hiding this comment.
I know its already there but I don't like those DISTRO_xxx backport style. its very specific.
we should backport the code so it builds everywhere with this ffmpeg libs
there's not really an dependency/change on a specific distro
There was a problem hiding this comment.
you can keep it like this for now. meh.
fixes #7
based on PR from github user "eroen": FreeRDP/FreeRDP#1610
changed INLINE -> static INLINE
(this pull request again as single change without revert)