ssr-wlroots icon indicating copy to clipboard operation
ssr-wlroots copied to clipboard

Fails to Compile on Arch (ffmpeg related)

Open Iron-Squid opened this issue 2 years ago • 2 comments

I believe AudioEncoder.cpp requires an update to AVCodecContext::channels and AVCodecContext::channel_layout.

Here is the output from the attempted compilation. I believe only the part after [28%] is of use, but I included the rest just in case.

-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/lib/ccache/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/lib/ccache/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Found X11: /usr/include   
-- Looking for XOpenDisplay in /usr/lib/libX11.so;/usr/lib/libXext.so
-- Looking for XOpenDisplay in /usr/lib/libX11.so;/usr/lib/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
CMake Warning (dev) at /usr/share/cmake/Modules/FindOpenGL.cmake:315 (message):
  Policy CMP0072 is not set: FindOpenGL prefers GLVND by default when
  available.  Run "cmake --help-policy CMP0072" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  FindOpenGL found both a legacy GL library:

    OPENGL_gl_LIBRARY: /usr/lib/libGL.so

  and GLVND libraries for OpenGL and GLX:

    OPENGL_opengl_LIBRARY: /usr/lib/libOpenGL.so
    OPENGL_glx_LIBRARY: /usr/lib/libGLX.so

  OpenGL_GL_PREFERENCE has not been set to "GLVND" or "LEGACY", so for
  compatibility with CMake 3.10 and below the legacy GL library will be used.
Call Stack (most recent call first):
  glinject/CMakeLists.txt:5 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found OpenGL: /usr/lib/libOpenGL.so   
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.8.0") 
-- Checking for module 'wayland-client>=1.13.0'
--   Found wayland-client, version 1.21.0
-- Found WaylandProtocols: //usr/share/wayland-protocols (found version "")  
-- Checking for modules 'libavformat;libavcodec;libavutil;libswscale'
--   Found libavformat, version 59.27.100
--   Found libavcodec, version 59.37.100
--   Found libavutil, version 57.28.100
--   Found libswscale, version 6.7.100
CMake Warning (dev) at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
  The package name passed to `find_package_handle_standard_args` (AVFormat)
  does not match the name of the calling package (FFmpeg).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  cmake/FindFFmpeg.cmake:19 (find_package_handle_standard_args)
  src/CMakeLists.txt:6 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found AVFormat: /usr/lib/libavformat.so  
CMake Warning (dev) at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
  The package name passed to `find_package_handle_standard_args` (AVCodec)
  does not match the name of the calling package (FFmpeg).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  cmake/FindFFmpeg.cmake:20 (find_package_handle_standard_args)
  src/CMakeLists.txt:6 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found AVCodec: /usr/lib/libavcodec.so  
CMake Warning (dev) at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
  The package name passed to `find_package_handle_standard_args` (AVUtil)
  does not match the name of the calling package (FFmpeg).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  cmake/FindFFmpeg.cmake:21 (find_package_handle_standard_args)
  src/CMakeLists.txt:6 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found AVUtil: /usr/lib/libavutil.so  
CMake Warning (dev) at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
  The package name passed to `find_package_handle_standard_args` (SWScale)
  does not match the name of the calling package (FFmpeg).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  cmake/FindFFmpeg.cmake:22 (find_package_handle_standard_args)
  src/CMakeLists.txt:6 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found SWScale: /usr/lib/libswscale.so  
-- Found ALSA: /usr/lib/libasound.so (found version "1.2.7.2") 
-- Checking for module 'libpulse'
--   Found libpulse, version 16.1
-- Found PulseAudio: /usr/lib/libpulse.so  
-- Checking for module 'jack'
--   Found jack, version 1.9.17
-- Found Jack: /usr/lib/libjack.so  
-- The following REQUIRED packages have been found:

 * OpenGL
 * WaylandProtocols
 * Threads
 * FFmpeg
 * X11
 * ALSA
 * PulseAudio
 * PkgConfig
 * Jack
 * Qt5Core
 * Qt5Gui
 * Qt5Widgets
 * Qt5X11Extras
 * Qt5 (required version >= 5.7)

-- Configuring done
-- Generating done
-- Build files have been written to: /home/squid/.cache/yay/simplescreenrecorder-wlroots-git/src/ssr-wlroots/build
[  1%] Generating xdg-output-unstable-v1 protocol source code
[  2%] Generating wlr-screencopy-unstable-v1 protocol header
[  3%] Generating wlr-screencopy-unstable-v1 protocol source code
[  4%] Generating xdg-output-unstable-v1 protocol header
[  5%] Building C object CMakeFiles/wayland-proto.dir/wlr-screencopy-unstable-v1-protocol.c.o
[  6%] Building C object CMakeFiles/wayland-proto.dir/xdg-output-unstable-v1-protocol.c.o
[  7%] Linking C static library libwayland-proto.a
[  7%] Built target wayland-proto
[  9%] Building C object glinject/CMakeFiles/ssr-glinject.dir/elfhacks.c.o
[ 10%] Building CXX object glinject/CMakeFiles/ssr-glinject.dir/GLInject.cpp.o
[ 11%] Building CXX object glinject/CMakeFiles/ssr-glinject.dir/GLXFrameGrabber.cpp.o
[ 12%] Building CXX object glinject/CMakeFiles/ssr-glinject.dir/Hook.cpp.o
[ 13%] Building CXX object glinject/CMakeFiles/ssr-glinject.dir/SSRVideoStreamWriter.cpp.o
[ 14%] Linking CXX shared library libssr-glinject.so
[ 14%] Built target ssr-glinject
[ 15%] Automatic MOC for target simplescreenrecorder
[ 15%] Built target simplescreenrecorder_autogen
[ 17%] Generating qrc_resources.cpp
[ 18%] Building CXX object src/CMakeFiles/simplescreenrecorder.dir/simplescreenrecorder_autogen/mocs_compilation.cpp.o
In file included from /home/squid/.cache/yay/simplescreenrecorder-wlroots-git/src/ssr-wlroots/build/src/simplescreenrecorder_autogen/2LCCYRVYXB/moc_ElidedLabel.cpp:10,
                 from /home/squid/.cache/yay/simplescreenrecorder-wlroots-git/src/ssr-wlroots/build/src/simplescreenrecorder_autogen/mocs_compilation.cpp:5:
/home/squid/.cache/yay/simplescreenrecorder-wlroots-git/src/ssr-wlroots/build/src/simplescreenrecorder_autogen/2LCCYRVYXB/../../../../src/GUI/ElidedLabel.h:37:65: warning: ‘constexpr QFlags<T>::QFlags(Zero) [with Enum = Qt::WindowType; Zero = int QFlags<Qt::WindowType>::Private::*]’ is deprecated: Use default constructor instead [-Wdeprecated-declarations]
   37 |         ElidedLabel(QWidget* parent = NULL, Qt::WindowFlags f = 0);
      |                                                                 ^
In file included from /usr/include/qt/QtCore/qglobal.h:1299,
                 from /usr/include/qt/QtCore/QtCore:4,
                 from /usr/include/qt/QtGui/QtGuiDepends:3,
                 from /usr/include/qt/QtGui/QtGui:3,
                 from /home/squid/.cache/yay/simplescreenrecorder-wlroots-git/src/ssr-wlroots/src/Global.h:23,
                 from /home/squid/.cache/yay/simplescreenrecorder-wlroots-git/src/ssr-wlroots/build/src/simplescreenrecorder_autogen/GPQNCQLT6Y/../../../../src/AV/Output/SyncDiagram.h:21,
                 from /home/squid/.cache/yay/simplescreenrecorder-wlroots-git/src/ssr-wlroots/build/src/simplescreenrecorder_autogen/GPQNCQLT6Y/moc_SyncDiagram.cpp:10,
                 from /home/squid/.cache/yay/simplescreenrecorder-wlroots-git/src/ssr-wlroots/build/src/simplescreenrecorder_autogen/mocs_compilation.cpp:2:
/usr/include/qt/QtCore/qflags.h:123:80: note: declared here
  123 |     QT_DEPRECATED_X("Use default constructor instead") Q_DECL_CONSTEXPR inline QFlags(Zero) noexcept : i(0) {}
      |                                                                                ^~~~~~
/home/squid/.cache/yay/simplescreenrecorder-wlroots-git/src/ssr-wlroots/build/src/simplescreenrecorder_autogen/2LCCYRVYXB/../../../../src/GUI/ElidedLabel.h:38:85: warning: ‘constexpr QFlags<T>::QFlags(Zero) [with Enum = Qt::WindowType; Zero = int QFlags<Qt::WindowType>::Private::*]’ is deprecated: Use default constructor instead [-Wdeprecated-declarations]
   38 |         ElidedLabel(const QString& txt, QWidget* parent = NULL, Qt::WindowFlags f = 0);
      |                                                                                     ^
/usr/include/qt/QtCore/qflags.h:123:80: note: declared here
  123 |     QT_DEPRECATED_X("Use default constructor instead") Q_DECL_CONSTEXPR inline QFlags(Zero) noexcept : i(0) {}
      |                                                                                ^~~~~~
/home/squid/.cache/yay/simplescreenrecorder-wlroots-git/src/ssr-wlroots/build/src/simplescreenrecorder_autogen/2LCCYRVYXB/../../../../src/GUI/ElidedLabel.h:39:131: warning: ‘constexpr QFlags<T>::QFlags(Zero) [with Enum = Qt::WindowType; Zero = int QFlags<Qt::WindowType>::Private::*]’ is deprecated: Use default constructor instead [-Wdeprecated-declarations]
   39 |         ElidedLabel(const QString& txt, Qt::TextElideMode elideMode = Qt::ElideRight, QWidget* parent = NULL, Qt::WindowFlags f = 0);
      |                                                                                                                                   ^
/usr/include/qt/QtCore/qflags.h:123:80: note: declared here
  123 |     QT_DEPRECATED_X("Use default constructor instead") Q_DECL_CONSTEXPR inline QFlags(Zero) noexcept : i(0) {}
      |                                                                                ^~~~~~
[ 19%] Building CXX object src/CMakeFiles/simplescreenrecorder.dir/AV/Input/ALSAInput.cpp.o
[ 20%] Building CXX object src/CMakeFiles/simplescreenrecorder.dir/AV/Input/GLInjectInput.cpp.o
[ 21%] Building CXX object src/CMakeFiles/simplescreenrecorder.dir/AV/Input/JACKInput.cpp.o
[ 22%] Building CXX object src/CMakeFiles/simplescreenrecorder.dir/AV/Input/PulseAudioInput.cpp.o
[ 23%] Building CXX object src/CMakeFiles/simplescreenrecorder.dir/AV/Input/SSRVideoStreamReader.cpp.o
[ 25%] Building CXX object src/CMakeFiles/simplescreenrecorder.dir/AV/Input/SSRVideoStreamWatcher.cpp.o
[ 26%] Building CXX object src/CMakeFiles/simplescreenrecorder.dir/AV/Input/X11Input.cpp.o
[ 27%] Building CXX object src/CMakeFiles/simplescreenrecorder.dir/AV/Input/WlrInput.cpp.o
[ 28%] Building CXX object src/CMakeFiles/simplescreenrecorder.dir/AV/Output/AudioEncoder.cpp.o
/home/squid/.cache/yay/simplescreenrecorder-wlroots-git/src/ssr-wlroots/src/AV/Output/AudioEncoder.cpp: In member function ‘unsigned int AudioEncoder::GetChannels()’:
/home/squid/.cache/yay/simplescreenrecorder-wlroots-git/src/ssr-wlroots/src/AV/Output/AudioEncoder.cpp:72:35: warning: ‘AVCodecContext::channels’ is deprecated [-Wdeprecated-declarations]
   72 |         return GetCodecContext()->channels;
      |                                   ^~~~~~~~
In file included from /home/squid/.cache/yay/simplescreenrecorder-wlroots-git/src/ssr-wlroots/src/Global.h:97,
                 from /home/squid/.cache/yay/simplescreenrecorder-wlroots-git/src/ssr-wlroots/src/AV/Output/AudioEncoder.h:21,
                 from /home/squid/.cache/yay/simplescreenrecorder-wlroots-git/src/ssr-wlroots/src/AV/Output/AudioEncoder.cpp:20:
/usr/include/libavcodec/avcodec.h:1006:9: note: declared here
 1006 |     int channels;
      |         ^~~~~~~~
/home/squid/.cache/yay/simplescreenrecorder-wlroots-git/src/ssr-wlroots/src/AV/Output/AudioEncoder.cpp:72:35: warning: ‘AVCodecContext::channels’ is deprecated [-Wdeprecated-declarations]
   72 |         return GetCodecContext()->channels;
      |                                   ^~~~~~~~
/usr/include/libavcodec/avcodec.h:1006:9: note: declared here
 1006 |     int channels;
      |         ^~~~~~~~
/home/squid/.cache/yay/simplescreenrecorder-wlroots-git/src/ssr-wlroots/src/AV/Output/AudioEncoder.cpp:72:35: warning: ‘AVCodecContext::channels’ is deprecated [-Wdeprecated-declarations]
   72 |         return GetCodecContext()->channels;
      |                                   ^~~~~~~~
/usr/include/libavcodec/avcodec.h:1006:9: note: declared here
 1006 |     int channels;
      |         ^~~~~~~~
/home/squid/.cache/yay/simplescreenrecorder-wlroots-git/src/ssr-wlroots/src/AV/Output/AudioEncoder.cpp: In static member function ‘static bool AudioEncoder::AVCodecIsSupported(const QString&)’:
/home/squid/.cache/yay/simplescreenrecorder-wlroots-git/src/ssr-wlroots/src/AV/Output/AudioEncoder.cpp:80:54: error: invalid conversion from ‘const AVCodec*’ to ‘AVCodec*’ [-fpermissive]
   80 |         AVCodec *codec = avcodec_find_encoder_by_name(codec_name.toUtf8().constData());
      |                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                      |
      |                                                      const AVCodec*
/home/squid/.cache/yay/simplescreenrecorder-wlroots-git/src/ssr-wlroots/src/AV/Output/AudioEncoder.cpp: In static member function ‘static void AudioEncoder::PrepareStream(AVStream*, AVCodecContext*, AVCodec*, AVDictionary**, const std::vector<std::pair<QString, QString> >&, unsigned int, unsigned int, unsigned int)’:
/home/squid/.cache/yay/simplescreenrecorder-wlroots-git/src/ssr-wlroots/src/AV/Output/AudioEncoder.cpp:109:24: warning: ‘AVCodecContext::channels’ is deprecated [-Wdeprecated-declarations]
  109 |         codec_context->channels = channels;
      |                        ^~~~~~~~
/usr/include/libavcodec/avcodec.h:1006:9: note: declared here
 1006 |     int channels;
      |         ^~~~~~~~
/home/squid/.cache/yay/simplescreenrecorder-wlroots-git/src/ssr-wlroots/src/AV/Output/AudioEncoder.cpp:109:24: warning: ‘AVCodecContext::channels’ is deprecated [-Wdeprecated-declarations]
  109 |         codec_context->channels = channels;
      |                        ^~~~~~~~
/usr/include/libavcodec/avcodec.h:1006:9: note: declared here
 1006 |     int channels;
      |         ^~~~~~~~
/home/squid/.cache/yay/simplescreenrecorder-wlroots-git/src/ssr-wlroots/src/AV/Output/AudioEncoder.cpp:109:24: warning: ‘AVCodecContext::channels’ is deprecated [-Wdeprecated-declarations]
  109 |         codec_context->channels = channels;
      |                        ^~~~~~~~
/usr/include/libavcodec/avcodec.h:1006:9: note: declared here
 1006 |     int channels;
      |         ^~~~~~~~
/home/squid/.cache/yay/simplescreenrecorder-wlroots-git/src/ssr-wlroots/src/AV/Output/AudioEncoder.cpp:110:24: warning: ‘AVCodecContext::channel_layout’ is deprecated [-Wdeprecated-declarations]
  110 |         codec_context->channel_layout = (channels == 1)? AV_CH_LAYOUT_MONO : AV_CH_LAYOUT_STEREO;
      |                        ^~~~~~~~~~~~~~
/usr/include/libavcodec/avcodec.h:1060:14: note: declared here
 1060 |     uint64_t channel_layout;
      |              ^~~~~~~~~~~~~~
/home/squid/.cache/yay/simplescreenrecorder-wlroots-git/src/ssr-wlroots/src/AV/Output/AudioEncoder.cpp:110:24: warning: ‘AVCodecContext::channel_layout’ is deprecated [-Wdeprecated-declarations]
  110 |         codec_context->channel_layout = (channels == 1)? AV_CH_LAYOUT_MONO : AV_CH_LAYOUT_STEREO;
      |                        ^~~~~~~~~~~~~~
/usr/include/libavcodec/avcodec.h:1060:14: note: declared here
 1060 |     uint64_t channel_layout;
      |              ^~~~~~~~~~~~~~
/home/squid/.cache/yay/simplescreenrecorder-wlroots-git/src/ssr-wlroots/src/AV/Output/AudioEncoder.cpp:110:24: warning: ‘AVCodecContext::channel_layout’ is deprecated [-Wdeprecated-declarations]
  110 |         codec_context->channel_layout = (channels == 1)? AV_CH_LAYOUT_MONO : AV_CH_LAYOUT_STEREO;
      |                        ^~~~~~~~~~~~~~
/usr/include/libavcodec/avcodec.h:1060:14: note: declared here
 1060 |     uint64_t channel_layout;
      |              ^~~~~~~~~~~~~~
make[2]: *** [src/CMakeFiles/simplescreenrecorder.dir/build.make:209: src/CMakeFiles/simplescreenrecorder.dir/AV/Output/AudioEncoder.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:190: src/CMakeFiles/simplescreenrecorder.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

Iron-Squid avatar Aug 31 '22 00:08 Iron-Squid

same issue

gaetan1903 avatar Sep 12 '22 07:09 gaetan1903

Ugh, the whole fork probably needs to be rebased on top of upstream but that would be hell of a task.

foxcpp avatar Sep 12 '22 19:09 foxcpp