kclyu / rpi-webrtc-streamer

This repo's objective is providing something like Web Cam server on the most popular Raspberry PI hardware. By integrating [WebRTC](https://webrtc.org/native-code/) and Raspberry PI, we can stream the Raspberry camera feed to browser or native client which talks WebRTC.
Other
617 stars 108 forks source link

error cross compiling #102

Closed jonspieg closed 4 years ago

jonspieg commented 4 years ago

I followed the great cross compiling readme, but unfortunately I got stuck on the last and most important task - building RWS :o I'm using webrtc from the commit mentioned here https://github.com/kclyu/rpi-webrtc-streamer/commit/8ff2e5d6a92fdfd70b19d38def379b5833362467 I noticed that the trigger for this error (which is EncoderSelectorInterface) was added in the last commit to raspi_encoder.h Any help would be appreciated

Thanks!

This is the output from the make command:

~/Workspace/rpi-webrtc-streamer/src$ make arm-linux-gnueabihf-g++ -I. -DINSTALL_DIR=\"/opt/rws\" -Wno-deprecated-declarations -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -pipe -pthread -march=armv7-a -mfloat-abi=hard -mtune=cortex-a7 -mfpu=neon -mthumb -Wall -Wno-psabi -Wno-unused-local-typedefs -Wno-maybe-uninitialized -Wno-deprecated-declarations -Wno-comments -Wno-packed-not-aligned -Wno-missing-field-initializers -Wno-unused-parameter -O2 -fno-ident -fdata-sections -ffunction-sections -fno-omit-frame-pointer -gdwarf-3 -g2 -fvisibility=hidden -isystem/opt/rpi_rootfs/rootfs/usr/include/gtk-3.0 -isystem/opt/rpi_rootfs/rootfs/usr/include/at-spi2-atk/2.0 -isystem/opt/rpi_rootfs/rootfs/usr/include/at-spi-2.0 -isystem/opt/rpi_rootfs/rootfs/usr/include/dbus-1.0 -isystem/opt/rpi_rootfs/rootfs/usr/lib/arm-linux-gnueabihf/dbus-1.0/include -isystem/opt/rpi_rootfs/rootfs/usr/include/gtk-3.0 -isystem/opt/rpi_rootfs/rootfs/usr/include/gio-unix-2.0 -isystem/opt/rpi_rootfs/rootfs/usr/include/cairo -isystem/opt/rpi_rootfs/rootfs/usr/include/pango-1.0 -isystem/opt/rpi_rootfs/rootfs/usr/include/harfbuzz -isystem/opt/rpi_rootfs/rootfs/usr/include/pango-1.0 -isystem/opt/rpi_rootfs/rootfs/usr/include/fribidi -isystem/opt/rpi_rootfs/rootfs/usr/include/atk-1.0 -isystem/opt/rpi_rootfs/rootfs/usr/include/cairo -isystem/opt/rpi_rootfs/rootfs/usr/include/pixman-1 -isystem/opt/rpi_rootfs/rootfs/usr/include/freetype2 -isystem/opt/rpi_rootfs/rootfs/usr/include/libpng16 -isystem/opt/rpi_rootfs/rootfs/usr/include/gdk-pixbuf-2.0 -isystem/opt/rpi_rootfs/rootfs/usr/include/libmount -isystem/opt/rpi_rootfs/rootfs/usr/include/blkid -isystem/opt/rpi_rootfs/rootfs/usr/include/uuid -isystem/opt/rpi_rootfs/rootfs/usr/include/glib-2.0 -isystem/opt/rpi_rootfs/rootfs/usr/lib/arm-linux-gnueabihf/glib-2.0/include -DINSTALL_DIR=\"/opt/rws\" -Wall -fvisibility=hidden -pthread -std=gnu++14 -Wno-narrowing -Wno-class-memaccess -fno-exceptions -fno-rtti --sysroot=../../../../../../../opt/rpi_rootfs/rootfs -fvisibility-inlines-hidden -Wnon-virtual-dtor -Woverloaded-virtual -Wno-deprecated-declarations -Wno-deprecated-declarations -Wno-undef -D__RWS_VERSION__=\"v0.74-5-g5024551f9d0cb1ff\" -D__WEBRTC_VERSION__="\"9bac68c0cc4444b8,>>>>Cr-Commit-Position:refs/heads/master@{#30284} >>>Cr-Commit-Position:refs/heads/master@{#30292} >>Cr-Commit-Position:refs/heads/master@{#30348} >Cr-Commit-Position:refs/heads/master@{#30360} Cr-Commit-Position:refs/heads/master@{#30367}\"" -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -D_LINUX -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -U_FORTIFY_SOURCE -Wall -g -DHAVE_LIBOPENMAX=2 -DOMX -DOMX_SKIP64BIT -ftree-vectorize -pipe -DUSE_EXTERNAL_OMX -DHAVE_LIBBCM_HOST -DUSE_EXTERNAL_LIBBCM_HOST -DUSE_VCHIQ_ARM -I/home/jonathan/Workspace/rpi-webrtc-streamer/lib/libwebsockets/arm_build -I/home/jonathan/Workspace/rpi-webrtc-streamer/lib/libwebsockets/arm_build/include -I/home/jonathan/Workspace/rpi-webrtc-streamer/lib/libwebsockets -DUSE_UDEV -DUSE_AURA=1 -DUSE_NSS_CERTS=1 -DUSE_OZONE=1 -DOFFICIAL_BUILD -DGOOGLE_CHROME_BUILD -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DNO_UNWIND_TABLES -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FORTIFY_SOURCE=2 -DCR_SYSROOT_HASH=917c75b57e18baf9e34c8dfd493bcf555df4f183 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DWEBRTC_ENABLE_PROTOBUF=0 -DWEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE -DRTC_ENABLE_VP9 -DHAVE_SCTP -DWEBRTC_USE_H264 -DWEBRTC_ARCH_ARM -DWEBRTC_ARCH_ARM_V7 -DWEBRTC_HAS_NEON -DWEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS=0 -DWEBRTC_POSIX -DWEBRTC_LINUX -DABSL_ALLOCATOR_NOTHROW=1 -DABSL_FLAGS_STRIP_NAMES=0 -DHAVE_WEBRTC_VIDEO -I/home/jonathan/Workspace/webrtc/src -I/home/jonathan/Workspace/webrtc/src -I/home/jonathan/Workspace/webrtc/src/out/gen -I/home/jonathan/Workspace/webrtc/src/third_party/abseil-cpp -I/home/jonathan/Workspace/webrtc/src/third_party/libyuv/include -I/home/jonathan/Workspace/webrtc/src/third_party/jsoncpp/source/include -I/home/jonathan/Workspace/webrtc/src/third_party/jsoncpp/generated -I/opt/rpi_rootfs/rootfs/opt/vc/include/interface/vcos/pthreads -I/opt/rpi_rootfs/rootfs/opt/vc/include/interface/vmcs_host/linux -I/opt/rpi_rootfs/rootfs/opt/vc/include/interface/vmcs_host -I/opt/rpi_rootfs/rootfs/opt/vc/include/interface/vchiq_arm -I/opt/rpi_rootfs/rootfs/opt/vc/include -I/opt/rpi_rootfs/rootfs/opt/vc/include/interface/mmal -I/opt/rpi_rootfs/rootfs/usr/include -I/opt/rpi_rootfs/rootfs/usr/include/arm-linux-gnueabihf -I/home/jonathan/Workspace/webrtc/src/third_party/abseil-cpp/ -c raspi_encoder.cc -o raspi_encoder.o In file included from raspi_encoder.cc:30: raspi_encoder.h:74:21: error: ‘EncoderSelectorInterface’ was not declared in this scope std::unique_ptr<EncoderSelectorInterface> GetEncoderSelector() ^~~~~~~~~~~~~~~~~~~~~~~~ raspi_encoder.h:74:21: note: suggested alternative: ‘EncodedImageBufferInterface’ std::unique_ptr<EncoderSelectorInterface> GetEncoderSelector() ^~~~~~~~~~~~~~~~~~~~~~~~ EncodedImageBufferInterface raspi_encoder.h:74:45: error: template argument 1 is invalid std::unique_ptr<EncoderSelectorInterface> GetEncoderSelector() ^ raspi_encoder.h:74:45: error: template argument 2 is invalid raspi_encoder.h:74:47: error: ‘int webrtc::RaspiVideoEncoderFactory::GetEncoderSelector() const’ marked ‘override’, but does not override std::unique_ptr<EncoderSelectorInterface> GetEncoderSelector() ^~~~~~~~~~~~~~~~~~ In file included from raspi_encoder.h:37, from raspi_encoder.cc:30: /home/jonathan/Workspace/webrtc/src/api/video_codecs/video_encoder.h:346:40: warning: ‘virtual int32_t webrtc::VideoEncoder::InitEncode(const webrtc::VideoCodec*, int32_t, size_t)’ was hidden [-Woverloaded-virtual] /* RTC_DEPRECATED */ virtual int32_t InitEncode( ^~~~~~~~~~ In file included from raspi_encoder.cc:42: raspi_encoder_impl.h:78:13: warning: by ‘virtual int32_t webrtc::RaspiEncoderImpl::InitEncode(const webrtc::VideoCodec*, const webrtc::VideoEncoder::Settings&)’ [-Woverloaded-virtual] int32_t InitEncode(const VideoCodec* codec_settings, ^~~~~~~~~~ raspi_encoder.cc:151:38: error: ‘EncoderSelectorInterface’ is not a member of ‘webrtc::VideoEncoderFactory’ std::unique_ptr<VideoEncoderFactory::EncoderSelectorInterface> ^~~~~~~~~~~~~~~~~~~~~~~~ raspi_encoder.cc:151:38: error: ‘EncoderSelectorInterface’ is not a member of ‘webrtc::VideoEncoderFactory’ raspi_encoder.cc:151:62: error: template argument 1 is invalid std::unique_ptr<VideoEncoderFactory::EncoderSelectorInterface> ^ raspi_encoder.cc:151:62: error: template argument 2 is invalid raspi_encoder.cc: In member function ‘int webrtc::RaspiVideoEncoderFactory::GetEncoderSelector() const’: raspi_encoder.cc:154:12: error: cannot convert ‘std::nullptr_t’ to ‘int’ in return return nullptr; ^~~~~~~ Makefile:97: recipe for target 'raspi_encoder.o' failed make: *** [raspi_encoder.o] Error 1

jonspieg commented 4 years ago

Ok got it I was on the wrong webrtc native branch switched to the one mentioned here https://github.com/kclyu/rpi-webrtc-streamer/commit/4a64301c886d953b72792b6f6f0082d45b672c72 and it compiles now