diff --git a/.github/workflows/cpp-python-tests.yml b/.github/workflows/cpp-python-tests.yml index dd3cc6aa..b601d5d6 100644 --- a/.github/workflows/cpp-python-tests.yml +++ b/.github/workflows/cpp-python-tests.yml @@ -20,15 +20,16 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-20.04, ubuntu-22.04, macos-12] - python-version: ["3.8", "3.9", "3.10"] - build-type: [Debug, Release] + os: [macos-13] + # os: [ubuntu-20.04, ubuntu-22.04, macos-13] + python-version: ["3.10"] + # python-version: ["3.8", "3.9", "3.10"] + build-type: [Debug] + # build-type: [Debug, Release] enable-gstreamer: [ON, OFF] enable-system-opencv: [OFF] exclude: - - os: macos-11 - enable-gstreamer: ON - - os: macos-12 + - os: macos-13 enable-gstreamer: ON steps: @@ -143,7 +144,19 @@ jobs: -DPython_ROOT_DIR="${{ env.pythonLocation }}" \ -DOPENTERA_WEBRTC_ENABLE_GSTREAMER=${{ matrix.enable-gstreamer }} \ -DOPENTERA_WEBRTC_USE_SYSTEM_OPENCV=${{ matrix.enable-system-opencv }} - make + + file opentera-webrtc-native-client/3rdParty/webrtc_native/webrtc-native-build-6422.8505a9.224-Debug/lib/libboringssl.a + file opentera-webrtc-native-client/3rdParty/webrtc_native/webrtc-native-build-6422.8505a9.224-Debug/lib/libyuv_internal.a + + for file in opentera-webrtc-native-client/3rdParty/webrtc_native/webrtc-native-build-6422.8505a9.224-Debug/lib/libboringssl/*; do + file "$file" + done + + for file in opentera-webrtc-native-client/3rdParty/webrtc_native/webrtc-native-build-6422.8505a9.224-Debug/lib/libyuv_internal/*; do + file "$file" + done + + VERBOSE=1 make make install - name: Python native_client build cleanup diff --git a/VERSION b/VERSION index c813fe11..3c43790f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.2.5 +1.2.6 diff --git a/opentera-webrtc-native-client/3rdParty/CMakeLists.txt b/opentera-webrtc-native-client/3rdParty/CMakeLists.txt index 9c0f8c06..6ad185f6 100644 --- a/opentera-webrtc-native-client/3rdParty/CMakeLists.txt +++ b/opentera-webrtc-native-client/3rdParty/CMakeLists.txt @@ -18,6 +18,7 @@ set(OPENSSL_INCLUDE_DIR ${boringssl_INCLUDE}) set(OPENSSL_LIBRARIES ${boringssl_LIBRARY}) add_subdirectory(IXWebSocket) set_property(TARGET ixwebsocket PROPERTY CXX_STANDARD 17) +target_compile_options(ixwebsocket PRIVATE -w) if (OPENTERA_WEBRTC_ENABLE_TESTS) add_subdirectory(googletest) diff --git a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/src/Json.cpp b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/src/Json.cpp index 1d190351..1bf0dad1 100644 --- a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/src/Json.cpp +++ b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/python/src/Json.cpp @@ -107,6 +107,9 @@ py::object opentera::jsonToPyObject(const nlohmann::json& json) } return dict; } + + case nlohmann::detail::value_t::discarded: + return py::none(); } return py::none(); diff --git a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/src/Handlers/PeerConnectionHandler.cpp b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/src/Handlers/PeerConnectionHandler.cpp index 3cfca346..8200525a 100644 --- a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/src/Handlers/PeerConnectionHandler.cpp +++ b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/src/Handlers/PeerConnectionHandler.cpp @@ -162,15 +162,22 @@ void PeerConnectionHandler::OnIceCandidate(const webrtc::IceCandidateInterface* m_signalingClient.sendIceCandidate(candidate->sdp_mid(), candidate->sdp_mline_index(), sdp, m_peerClient.id()); } -void PeerConnectionHandler::OnDataChannel(rtc::scoped_refptr dataChannel) {} +void PeerConnectionHandler::OnDataChannel([[maybe_unused]] rtc::scoped_refptr dataChannel) +{ +} -void PeerConnectionHandler::OnTrack(rtc::scoped_refptr transceiver) {} +void PeerConnectionHandler::OnTrack([[maybe_unused]] rtc::scoped_refptr transceiver) {} -void PeerConnectionHandler::OnRemoveTrack(rtc::scoped_refptr receiver) {} +void PeerConnectionHandler::OnRemoveTrack([[maybe_unused]] rtc::scoped_refptr receiver) {} -void PeerConnectionHandler::OnSignalingChange(webrtc::PeerConnectionInterface::SignalingState newState) {} +void PeerConnectionHandler::OnSignalingChange([[maybe_unused]] webrtc::PeerConnectionInterface::SignalingState newState) +{ +} -void PeerConnectionHandler::OnIceGatheringChange(webrtc::PeerConnectionInterface::IceGatheringState newState) {} +void PeerConnectionHandler::OnIceGatheringChange( + [[maybe_unused]] webrtc::PeerConnectionInterface::IceGatheringState newState) +{ +} void PeerConnectionHandler::OnCreateSessionDescriptionObserverSuccess(webrtc::SessionDescriptionInterface* desc) { diff --git a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/src/Handlers/StreamPeerConnectionHandler.cpp b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/src/Handlers/StreamPeerConnectionHandler.cpp index 8ad408aa..fb793104 100644 --- a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/src/Handlers/StreamPeerConnectionHandler.cpp +++ b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/src/Handlers/StreamPeerConnectionHandler.cpp @@ -35,8 +35,8 @@ StreamPeerConnectionHandler::StreamPeerConnectionHandler( move(onClientConnected), move(onClientDisconnected), move(onClientConnectionFailed)), - m_offerToReceiveAudio(hasOnMixedAudioFrameReceivedCallback || onAudioFrameReceived), m_offerToReceiveVideo(static_cast(onVideoFrameReceived)), + m_offerToReceiveAudio(hasOnMixedAudioFrameReceivedCallback || onAudioFrameReceived), m_videoTrack(move(videoTrack)), m_audioTrack(move(audioTrack)), m_onAddRemoteStream(move(onAddRemoteStream)), diff --git a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/src/OpenteraAudioDeviceModule.cpp b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/src/OpenteraAudioDeviceModule.cpp index e1e16d32..d0ff294d 100644 --- a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/src/OpenteraAudioDeviceModule.cpp +++ b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/src/OpenteraAudioDeviceModule.cpp @@ -65,7 +65,7 @@ void OpenteraAudioDeviceModule::sendFrame( newMicLevel); // New mic volume (not used) } -int32_t OpenteraAudioDeviceModule::ActiveAudioLayer(AudioLayer* audioLayer) const +int32_t OpenteraAudioDeviceModule::ActiveAudioLayer([[maybe_unused]] AudioLayer* audioLayer) const { return 0; } @@ -113,7 +113,7 @@ int16_t OpenteraAudioDeviceModule::RecordingDevices() } int32_t OpenteraAudioDeviceModule::PlayoutDeviceName( - uint16_t index, + [[maybe_unused]] uint16_t index, char name[webrtc::kAdmMaxDeviceNameSize], char guid[webrtc::kAdmMaxGuidSize]) { @@ -123,7 +123,7 @@ int32_t OpenteraAudioDeviceModule::PlayoutDeviceName( } int32_t OpenteraAudioDeviceModule::RecordingDeviceName( - uint16_t index, + [[maybe_unused]] uint16_t index, char name[webrtc::kAdmMaxDeviceNameSize], char guid[webrtc::kAdmMaxGuidSize]) { @@ -132,7 +132,7 @@ int32_t OpenteraAudioDeviceModule::RecordingDeviceName( return 0; } -int32_t OpenteraAudioDeviceModule::SetPlayoutDevice(uint16_t index) +int32_t OpenteraAudioDeviceModule::SetPlayoutDevice([[maybe_unused]] uint16_t index) { if (m_isPlayoutInitialized) { @@ -141,7 +141,7 @@ int32_t OpenteraAudioDeviceModule::SetPlayoutDevice(uint16_t index) return 0; } -int32_t OpenteraAudioDeviceModule::SetPlayoutDevice(WindowsDeviceType device) +int32_t OpenteraAudioDeviceModule::SetPlayoutDevice([[maybe_unused]] WindowsDeviceType device) { if (m_isPlayoutInitialized) { @@ -151,7 +151,7 @@ int32_t OpenteraAudioDeviceModule::SetPlayoutDevice(WindowsDeviceType device) return 0; } -int32_t OpenteraAudioDeviceModule::SetRecordingDevice(uint16_t index) +int32_t OpenteraAudioDeviceModule::SetRecordingDevice([[maybe_unused]] uint16_t index) { if (m_isRecordingInitialized) { @@ -161,7 +161,7 @@ int32_t OpenteraAudioDeviceModule::SetRecordingDevice(uint16_t index) return 0; } -int32_t OpenteraAudioDeviceModule::SetRecordingDevice(WindowsDeviceType device) +int32_t OpenteraAudioDeviceModule::SetRecordingDevice([[maybe_unused]] WindowsDeviceType device) { if (m_isRecordingInitialized) { @@ -277,22 +277,22 @@ int32_t OpenteraAudioDeviceModule::SpeakerVolumeIsAvailable(bool* available) return 0; } -int32_t OpenteraAudioDeviceModule::SetSpeakerVolume(uint32_t volume) +int32_t OpenteraAudioDeviceModule::SetSpeakerVolume([[maybe_unused]] uint32_t volume) { return -1; } -int32_t OpenteraAudioDeviceModule::SpeakerVolume(uint32_t* volume) const +int32_t OpenteraAudioDeviceModule::SpeakerVolume([[maybe_unused]] uint32_t* volume) const { return -1; } -int32_t OpenteraAudioDeviceModule::MaxSpeakerVolume(uint32_t* maxVolume) const +int32_t OpenteraAudioDeviceModule::MaxSpeakerVolume([[maybe_unused]] uint32_t* maxVolume) const { return -1; } -int32_t OpenteraAudioDeviceModule::MinSpeakerVolume(uint32_t* minVolume) const +int32_t OpenteraAudioDeviceModule::MinSpeakerVolume([[maybe_unused]] uint32_t* minVolume) const { return -1; } @@ -303,22 +303,22 @@ int32_t OpenteraAudioDeviceModule::MicrophoneVolumeIsAvailable(bool* available) return 0; } -int32_t OpenteraAudioDeviceModule::SetMicrophoneVolume(uint32_t volume) +int32_t OpenteraAudioDeviceModule::SetMicrophoneVolume([[maybe_unused]] uint32_t volume) { return -1; } -int32_t OpenteraAudioDeviceModule::MicrophoneVolume(uint32_t* volume) const +int32_t OpenteraAudioDeviceModule::MicrophoneVolume([[maybe_unused]] uint32_t* volume) const { return -1; } -int32_t OpenteraAudioDeviceModule::MaxMicrophoneVolume(uint32_t* maxVolume) const +int32_t OpenteraAudioDeviceModule::MaxMicrophoneVolume([[maybe_unused]] uint32_t* maxVolume) const { return -1; } -int32_t OpenteraAudioDeviceModule::MinMicrophoneVolume(uint32_t* minVolume) const +int32_t OpenteraAudioDeviceModule::MinMicrophoneVolume([[maybe_unused]] uint32_t* minVolume) const { return -1; } @@ -329,12 +329,12 @@ int32_t OpenteraAudioDeviceModule::SpeakerMuteIsAvailable(bool* available) return 0; } -int32_t OpenteraAudioDeviceModule::SetSpeakerMute(bool enable) +int32_t OpenteraAudioDeviceModule::SetSpeakerMute([[maybe_unused]] bool enable) { return -1; } -int32_t OpenteraAudioDeviceModule::SpeakerMute(bool* enabled) const +int32_t OpenteraAudioDeviceModule::SpeakerMute([[maybe_unused]] bool* enabled) const { return -1; } @@ -345,12 +345,12 @@ int32_t OpenteraAudioDeviceModule::MicrophoneMuteIsAvailable(bool* available) return 0; } -int32_t OpenteraAudioDeviceModule::SetMicrophoneMute(bool enable) +int32_t OpenteraAudioDeviceModule::SetMicrophoneMute([[maybe_unused]] bool enable) { return -1; } -int32_t OpenteraAudioDeviceModule::MicrophoneMute(bool* enabled) const +int32_t OpenteraAudioDeviceModule::MicrophoneMute([[maybe_unused]] bool* enabled) const { return -1; } @@ -361,12 +361,12 @@ int32_t OpenteraAudioDeviceModule::StereoPlayoutIsAvailable(bool* available) con return 0; } -int32_t OpenteraAudioDeviceModule::SetStereoPlayout(bool enable) +int32_t OpenteraAudioDeviceModule::SetStereoPlayout([[maybe_unused]] bool enable) { return -1; } -int32_t OpenteraAudioDeviceModule::StereoPlayout(bool* enabled) const +int32_t OpenteraAudioDeviceModule::StereoPlayout([[maybe_unused]] bool* enabled) const { return -1; } @@ -377,12 +377,12 @@ int32_t OpenteraAudioDeviceModule::StereoRecordingIsAvailable(bool* available) c return 0; } -int32_t OpenteraAudioDeviceModule::SetStereoRecording(bool enable) +int32_t OpenteraAudioDeviceModule::SetStereoRecording([[maybe_unused]] bool enable) { return -1; } -int32_t OpenteraAudioDeviceModule::StereoRecording(bool* enabled) const +int32_t OpenteraAudioDeviceModule::StereoRecording([[maybe_unused]] bool* enabled) const { return -1; } @@ -408,17 +408,17 @@ bool OpenteraAudioDeviceModule::BuiltInNSIsAvailable() const return false; } -int32_t OpenteraAudioDeviceModule::EnableBuiltInAEC(bool enable) +int32_t OpenteraAudioDeviceModule::EnableBuiltInAEC([[maybe_unused]] bool enable) { return -1; } -int32_t OpenteraAudioDeviceModule::EnableBuiltInAGC(bool enable) +int32_t OpenteraAudioDeviceModule::EnableBuiltInAGC([[maybe_unused]] bool enable) { return -1; } -int32_t OpenteraAudioDeviceModule::EnableBuiltInNS(bool enable) +int32_t OpenteraAudioDeviceModule::EnableBuiltInNS([[maybe_unused]] bool enable) { return -1; } diff --git a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/src/Sources/AudioSource.cpp b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/src/Sources/AudioSource.cpp index 7ef5d70e..35e82eb8 100644 --- a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/src/Sources/AudioSource.cpp +++ b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/src/Sources/AudioSource.cpp @@ -55,12 +55,12 @@ AudioSource::AudioSource( /** * Do nothing. */ -void AudioSource::AddSink(webrtc::AudioTrackSinkInterface* sink) {} +void AudioSource::AddSink([[maybe_unused]] webrtc::AudioTrackSinkInterface* sink) {} /** * Do nothing. */ -void AudioSource::RemoveSink(webrtc::AudioTrackSinkInterface* sink) {} +void AudioSource::RemoveSink([[maybe_unused]] webrtc::AudioTrackSinkInterface* sink) {} /** * @brief Indicates if this source is remote diff --git a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/src/StreamClient.cpp b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/src/StreamClient.cpp index b327757f..47e99197 100644 --- a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/src/StreamClient.cpp +++ b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/src/StreamClient.cpp @@ -185,7 +185,9 @@ unique_ptr rtc::scoped_refptr videoTrack = nullptr; if (m_videoSource != nullptr) { - videoTrack = m_peerConnectionFactory->CreateVideoTrack("stream_video", m_videoSource.get()); + videoTrack = m_peerConnectionFactory->CreateVideoTrack( + rtc::scoped_refptr(m_videoSource.get()), + "stream_video"); videoTrack->set_enabled(!m_isLocalVideoMuted); } diff --git a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/src/WebrtcClient.cpp b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/src/WebrtcClient.cpp index 3fa75682..ecccbf95 100644 --- a/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/src/WebrtcClient.cpp +++ b/opentera-webrtc-native-client/OpenteraWebrtcNativeClient/src/WebrtcClient.cpp @@ -508,7 +508,7 @@ bool WebrtcClient::getCallAcceptance(const string& id) } unique_ptr - WebrtcClient::createConnection(const string& peerId, const Client& peerClient, bool isCaller) + WebrtcClient::createConnection([[maybe_unused]] const string& peerId, const Client& peerClient, bool isCaller) { return callSync( m_internalClientThread.get(), diff --git a/opentera-webrtc-native-client/OpenteraWebrtcNativeGStreamer/include/OpenteraWebrtcNativeGStreamer/Encoders/H264GStreamerVideoEncoders.h b/opentera-webrtc-native-client/OpenteraWebrtcNativeGStreamer/include/OpenteraWebrtcNativeGStreamer/Encoders/H264GStreamerVideoEncoders.h index 63db246d..47a5d0d1 100644 --- a/opentera-webrtc-native-client/OpenteraWebrtcNativeGStreamer/include/OpenteraWebrtcNativeGStreamer/Encoders/H264GStreamerVideoEncoders.h +++ b/opentera-webrtc-native-client/OpenteraWebrtcNativeGStreamer/include/OpenteraWebrtcNativeGStreamer/Encoders/H264GStreamerVideoEncoders.h @@ -28,7 +28,7 @@ namespace opentera public: H264GStreamerVideoEncoder( - const webrtc::SdpVideoFormat::Parameters& parameters, + const webrtc::CodecParameterMap& parameters, std::string encoderPipeline, std::string encoderBitratePropertyName, BitRateUnit bitRatePropertyUnit, @@ -36,11 +36,11 @@ namespace opentera const char* additionalMediaTypeCaps = ""); ~H264GStreamerVideoEncoder() override = default; - static std::string mediaTypeCaps(const webrtc::SdpVideoFormat::Parameters& parameters); + static std::string mediaTypeCaps(const webrtc::CodecParameterMap& parameters); static const char* codecName(); - static bool isProfileBaselineOrMain(const webrtc::SdpVideoFormat::Parameters& parameters); - static bool isProfileBaselineOrMainOrHigh444(const webrtc::SdpVideoFormat::Parameters& parameters); + static bool isProfileBaselineOrMain(const webrtc::CodecParameterMap& parameters); + static bool isProfileBaselineOrMainOrHigh444(const webrtc::CodecParameterMap& parameters); protected: int getKeyframeInterval(const webrtc::VideoCodec& codecSettings) override; @@ -53,69 +53,69 @@ namespace opentera class SoftwareH264GStreamerVideoEncoder : public H264GStreamerVideoEncoder { public: - explicit SoftwareH264GStreamerVideoEncoder(const webrtc::SdpVideoFormat::Parameters& parameters); + explicit SoftwareH264GStreamerVideoEncoder(const webrtc::CodecParameterMap& parameters); ~SoftwareH264GStreamerVideoEncoder() override = default; [[nodiscard]] webrtc::VideoEncoder::EncoderInfo GetEncoderInfo() const override; static bool isSupported(); static bool isHardwareAccelerated(); - static bool areParametersSupported(const webrtc::SdpVideoFormat::Parameters& parameters); + static bool areParametersSupported(const webrtc::CodecParameterMap& parameters); }; class VaapiH264GStreamerVideoEncoder : public H264GStreamerVideoEncoder { public: - explicit VaapiH264GStreamerVideoEncoder(const webrtc::SdpVideoFormat::Parameters& parameters); + explicit VaapiH264GStreamerVideoEncoder(const webrtc::CodecParameterMap& parameters); ~VaapiH264GStreamerVideoEncoder() override = default; [[nodiscard]] webrtc::VideoEncoder::EncoderInfo GetEncoderInfo() const override; static bool isSupported(); static bool isHardwareAccelerated(); - static bool areParametersSupported(const webrtc::SdpVideoFormat::Parameters& parameters); + static bool areParametersSupported(const webrtc::CodecParameterMap& parameters); }; class TegraH264GStreamerVideoEncoder : public H264GStreamerVideoEncoder { public: - explicit TegraH264GStreamerVideoEncoder(const webrtc::SdpVideoFormat::Parameters& parameters); + explicit TegraH264GStreamerVideoEncoder(const webrtc::CodecParameterMap& parameters); ~TegraH264GStreamerVideoEncoder() override = default; [[nodiscard]] webrtc::VideoEncoder::EncoderInfo GetEncoderInfo() const override; static bool isSupported(); static bool isHardwareAccelerated(); - static bool areParametersSupported(const webrtc::SdpVideoFormat::Parameters& parameters); + static bool areParametersSupported(const webrtc::CodecParameterMap& parameters); private: - static std::string profileFromParameters(const webrtc::SdpVideoFormat::Parameters& parameters); + static std::string profileFromParameters(const webrtc::CodecParameterMap& parameters); }; class V4l2H264GStreamerVideoEncoder : public H264GStreamerVideoEncoder { public: - explicit V4l2H264GStreamerVideoEncoder(const webrtc::SdpVideoFormat::Parameters& parameters); + explicit V4l2H264GStreamerVideoEncoder(const webrtc::CodecParameterMap& parameters); ~V4l2H264GStreamerVideoEncoder() override = default; [[nodiscard]] webrtc::VideoEncoder::EncoderInfo GetEncoderInfo() const override; static bool isSupported(); static bool isHardwareAccelerated(); - static bool areParametersSupported(const webrtc::SdpVideoFormat::Parameters& parameters); + static bool areParametersSupported(const webrtc::CodecParameterMap& parameters); }; class AppleMediaH264GStreamerVideoEncoder : public H264GStreamerVideoEncoder { public: - explicit AppleMediaH264GStreamerVideoEncoder(const webrtc::SdpVideoFormat::Parameters& parameters); + explicit AppleMediaH264GStreamerVideoEncoder(const webrtc::CodecParameterMap& parameters); ~AppleMediaH264GStreamerVideoEncoder() override = default; [[nodiscard]] webrtc::VideoEncoder::EncoderInfo GetEncoderInfo() const override; static bool isSupported(); static bool isHardwareAccelerated(); - static bool areParametersSupported(const webrtc::SdpVideoFormat::Parameters& parameters); + static bool areParametersSupported(const webrtc::CodecParameterMap& parameters); }; } diff --git a/opentera-webrtc-native-client/OpenteraWebrtcNativeGStreamer/include/OpenteraWebrtcNativeGStreamer/Encoders/Vp8GStreamerVideoEncoders.h b/opentera-webrtc-native-client/OpenteraWebrtcNativeGStreamer/include/OpenteraWebrtcNativeGStreamer/Encoders/Vp8GStreamerVideoEncoders.h index 698ad26a..48dcdee1 100644 --- a/opentera-webrtc-native-client/OpenteraWebrtcNativeGStreamer/include/OpenteraWebrtcNativeGStreamer/Encoders/Vp8GStreamerVideoEncoders.h +++ b/opentera-webrtc-native-client/OpenteraWebrtcNativeGStreamer/include/OpenteraWebrtcNativeGStreamer/Encoders/Vp8GStreamerVideoEncoders.h @@ -46,40 +46,40 @@ namespace opentera class SoftwareVp8GStreamerVideoEncoder : public Vp8GStreamerVideoEncoder { public: - explicit SoftwareVp8GStreamerVideoEncoder(const webrtc::SdpVideoFormat::Parameters& parameters); + explicit SoftwareVp8GStreamerVideoEncoder(const webrtc::CodecParameterMap& parameters); ~SoftwareVp8GStreamerVideoEncoder() override = default; [[nodiscard]] webrtc::VideoEncoder::EncoderInfo GetEncoderInfo() const override; static bool isSupported(); static bool isHardwareAccelerated(); - static bool areParametersSupported(const webrtc::SdpVideoFormat::Parameters& parameters); + static bool areParametersSupported(const webrtc::CodecParameterMap& parameters); }; class VaapiVp8GStreamerVideoEncoder : public Vp8GStreamerVideoEncoder { public: - explicit VaapiVp8GStreamerVideoEncoder(const webrtc::SdpVideoFormat::Parameters& parameters); + explicit VaapiVp8GStreamerVideoEncoder(const webrtc::CodecParameterMap& parameters); ~VaapiVp8GStreamerVideoEncoder() override = default; [[nodiscard]] webrtc::VideoEncoder::EncoderInfo GetEncoderInfo() const override; static bool isSupported(); static bool isHardwareAccelerated(); - static bool areParametersSupported(const webrtc::SdpVideoFormat::Parameters& parameters); + static bool areParametersSupported(const webrtc::CodecParameterMap& parameters); }; class TegraVp8GStreamerVideoEncoder : public Vp8GStreamerVideoEncoder { public: - explicit TegraVp8GStreamerVideoEncoder(const webrtc::SdpVideoFormat::Parameters& parameters); + explicit TegraVp8GStreamerVideoEncoder(const webrtc::CodecParameterMap& parameters); ~TegraVp8GStreamerVideoEncoder() override = default; [[nodiscard]] webrtc::VideoEncoder::EncoderInfo GetEncoderInfo() const override; static bool isSupported(); static bool isHardwareAccelerated(); - static bool areParametersSupported(const webrtc::SdpVideoFormat::Parameters& parameters); + static bool areParametersSupported(const webrtc::CodecParameterMap& parameters); }; } diff --git a/opentera-webrtc-native-client/OpenteraWebrtcNativeGStreamer/include/OpenteraWebrtcNativeGStreamer/Encoders/Vp9GStreamerVideoEncoders.h b/opentera-webrtc-native-client/OpenteraWebrtcNativeGStreamer/include/OpenteraWebrtcNativeGStreamer/Encoders/Vp9GStreamerVideoEncoders.h index e40d273a..185634a2 100644 --- a/opentera-webrtc-native-client/OpenteraWebrtcNativeGStreamer/include/OpenteraWebrtcNativeGStreamer/Encoders/Vp9GStreamerVideoEncoders.h +++ b/opentera-webrtc-native-client/OpenteraWebrtcNativeGStreamer/include/OpenteraWebrtcNativeGStreamer/Encoders/Vp9GStreamerVideoEncoders.h @@ -28,7 +28,7 @@ namespace opentera public: Vp9GStreamerVideoEncoder( - const webrtc::SdpVideoFormat::Parameters& parameters, + const webrtc::CodecParameterMap& parameters, std::string encoderPipeline, std::string encoderBitratePropertyName, BitRateUnit bitRatePropertyUnit, @@ -37,10 +37,10 @@ namespace opentera int InitEncode(const webrtc::VideoCodec* codecSettings, const Settings& settings) override; - static std::string mediaTypeCaps(const webrtc::SdpVideoFormat::Parameters& parameters); + static std::string mediaTypeCaps(const webrtc::CodecParameterMap& parameters); static const char* codecName(); - static bool isProfile0123OrNone(const webrtc::SdpVideoFormat::Parameters& parameters); + static bool isProfile0123OrNone(const webrtc::CodecParameterMap& parameters); protected: int getKeyframeInterval(const webrtc::VideoCodec& codecSettings) override; @@ -53,27 +53,27 @@ namespace opentera class SoftwareVp9GStreamerVideoEncoder : public Vp9GStreamerVideoEncoder { public: - explicit SoftwareVp9GStreamerVideoEncoder(const webrtc::SdpVideoFormat::Parameters& parameters); + explicit SoftwareVp9GStreamerVideoEncoder(const webrtc::CodecParameterMap& parameters); ~SoftwareVp9GStreamerVideoEncoder() override = default; [[nodiscard]] webrtc::VideoEncoder::EncoderInfo GetEncoderInfo() const override; static bool isSupported(); static bool isHardwareAccelerated(); - static bool areParametersSupported(const webrtc::SdpVideoFormat::Parameters& parameters); + static bool areParametersSupported(const webrtc::CodecParameterMap& parameters); }; class TegraVp9GStreamerVideoEncoder : public Vp9GStreamerVideoEncoder { public: - explicit TegraVp9GStreamerVideoEncoder(const webrtc::SdpVideoFormat::Parameters& parameters); + explicit TegraVp9GStreamerVideoEncoder(const webrtc::CodecParameterMap& parameters); ~TegraVp9GStreamerVideoEncoder() override = default; [[nodiscard]] webrtc::VideoEncoder::EncoderInfo GetEncoderInfo() const override; static bool isSupported(); static bool isHardwareAccelerated(); - static bool areParametersSupported(const webrtc::SdpVideoFormat::Parameters& parameters); + static bool areParametersSupported(const webrtc::CodecParameterMap& parameters); }; } diff --git a/opentera-webrtc-native-client/OpenteraWebrtcNativeGStreamer/include/OpenteraWebrtcNativeGStreamer/Factories/WebRtcGStreamerVideoDecoderFactory.h b/opentera-webrtc-native-client/OpenteraWebrtcNativeGStreamer/include/OpenteraWebrtcNativeGStreamer/Factories/WebRtcGStreamerVideoDecoderFactory.h index 3bd0dcf4..d9cc2e88 100644 --- a/opentera-webrtc-native-client/OpenteraWebrtcNativeGStreamer/include/OpenteraWebrtcNativeGStreamer/Factories/WebRtcGStreamerVideoDecoderFactory.h +++ b/opentera-webrtc-native-client/OpenteraWebrtcNativeGStreamer/include/OpenteraWebrtcNativeGStreamer/Factories/WebRtcGStreamerVideoDecoderFactory.h @@ -67,9 +67,10 @@ namespace opentera WebRtcGStreamerVideoDecoderFactory::DecoderFactory WebRtcGStreamerVideoDecoderFactory::createDecoderFactory(int priority) { - return {priority, Decoder::isHardwareAccelerated(), [](auto _env, auto _format) { - return std::make_unique(); - }}; + return { + priority, + Decoder::isHardwareAccelerated(), + []([[maybe_unused]] auto _env, [[maybe_unused]] auto _format) { return std::make_unique(); }}; } } diff --git a/opentera-webrtc-native-client/OpenteraWebrtcNativeGStreamer/include/OpenteraWebrtcNativeGStreamer/Factories/WebRtcGStreamerVideoEncoderFactory.h b/opentera-webrtc-native-client/OpenteraWebrtcNativeGStreamer/include/OpenteraWebrtcNativeGStreamer/Factories/WebRtcGStreamerVideoEncoderFactory.h index e6a3d316..2c930320 100644 --- a/opentera-webrtc-native-client/OpenteraWebrtcNativeGStreamer/include/OpenteraWebrtcNativeGStreamer/Factories/WebRtcGStreamerVideoEncoderFactory.h +++ b/opentera-webrtc-native-client/OpenteraWebrtcNativeGStreamer/include/OpenteraWebrtcNativeGStreamer/Factories/WebRtcGStreamerVideoEncoderFactory.h @@ -34,7 +34,7 @@ namespace opentera { int priority; bool isHardwareAccelerated; - std::function areParametersSupported; + std::function areParametersSupported; std::function< std::unique_ptr(const webrtc::Environment& env, const webrtc::SdpVideoFormat&)> factory; @@ -74,7 +74,7 @@ namespace opentera priority, Encoder::isHardwareAccelerated(), [](auto parameters) { return Encoder::areParametersSupported(parameters); }, - [](auto env, auto format) { return std::make_unique(format.parameters); }}; + []([[maybe_unused]] auto env, auto format) { return std::make_unique(format.parameters); }}; } } diff --git a/opentera-webrtc-native-client/OpenteraWebrtcNativeGStreamer/include/OpenteraWebrtcNativeGStreamer/Utils/GStreamerMessageHandling.h b/opentera-webrtc-native-client/OpenteraWebrtcNativeGStreamer/include/OpenteraWebrtcNativeGStreamer/Utils/GStreamerMessageHandling.h index 85eba0f1..9f109317 100644 --- a/opentera-webrtc-native-client/OpenteraWebrtcNativeGStreamer/include/OpenteraWebrtcNativeGStreamer/Utils/GStreamerMessageHandling.h +++ b/opentera-webrtc-native-client/OpenteraWebrtcNativeGStreamer/include/OpenteraWebrtcNativeGStreamer/Utils/GStreamerMessageHandling.h @@ -34,7 +34,7 @@ namespace opentera::internal switch (GST_MESSAGE_TYPE(message)) { case GST_MESSAGE_ERROR: - GST_ERROR_OBJECT(pipeline, "Got message: %" GST_PTR_FORMAT, message); + GST_ERROR_OBJECT(pipeline, "Got message: %" GST_PTR_FORMAT, static_cast(message)); { #ifdef DEBUG_GSTREAMER std::string dotFileName = std::string(GST_OBJECT_NAME(pipeline)) + "_error"; diff --git a/opentera-webrtc-native-client/OpenteraWebrtcNativeGStreamer/src/Decoders/GStreamerVideoDecoder.cpp b/opentera-webrtc-native-client/OpenteraWebrtcNativeGStreamer/src/Decoders/GStreamerVideoDecoder.cpp index dddbdc15..d32adc02 100644 --- a/opentera-webrtc-native-client/OpenteraWebrtcNativeGStreamer/src/Decoders/GStreamerVideoDecoder.cpp +++ b/opentera-webrtc-native-client/OpenteraWebrtcNativeGStreamer/src/Decoders/GStreamerVideoDecoder.cpp @@ -65,7 +65,10 @@ int32_t GStreamerVideoDecoder::Release() return WEBRTC_VIDEO_CODEC_OK; } -int32_t GStreamerVideoDecoder::Decode(const webrtc::EncodedImage& inputImage, bool missingFrames, int64_t renderTimeMs) +int32_t GStreamerVideoDecoder::Decode( + const webrtc::EncodedImage& inputImage, + [[maybe_unused]] bool missingFrames, + int64_t renderTimeMs) { if (m_keyframeNeeded) { @@ -88,7 +91,9 @@ int32_t GStreamerVideoDecoder::Decode(const webrtc::EncodedImage& inputImage, bo } if (m_resetPipelineOnSizeChanges && inputImage._frameType == webrtc::VideoFrameType::kVideoFrameKey && - m_width != 0 && m_height != 0 && (m_width != inputImage._encodedWidth || m_height != inputImage._encodedHeight)) + m_width != 0 && m_height != 0 && + (m_width != static_cast(inputImage._encodedWidth) || + m_height != static_cast(inputImage._encodedHeight))) { initializePipeline(); initializeBufferTimestamps(renderTimeMs, inputImage.RtpTimestamp()); diff --git a/opentera-webrtc-native-client/OpenteraWebrtcNativeGStreamer/src/Encoders/GStreamerVideoEncoder.cpp b/opentera-webrtc-native-client/OpenteraWebrtcNativeGStreamer/src/Encoders/GStreamerVideoEncoder.cpp index 50ba6741..b38fffe1 100644 --- a/opentera-webrtc-native-client/OpenteraWebrtcNativeGStreamer/src/Encoders/GStreamerVideoEncoder.cpp +++ b/opentera-webrtc-native-client/OpenteraWebrtcNativeGStreamer/src/Encoders/GStreamerVideoEncoder.cpp @@ -63,7 +63,9 @@ int32_t GStreamerVideoEncoder::Release() return WEBRTC_VIDEO_CODEC_OK; } -int GStreamerVideoEncoder::InitEncode(const webrtc::VideoCodec* codecSettings, const VideoEncoder::Settings& settings) +int GStreamerVideoEncoder::InitEncode( + const webrtc::VideoCodec* codecSettings, + [[maybe_unused]] const VideoEncoder::Settings& settings) { if (codecSettings == nullptr || codecSettings->maxFramerate < 1 || (codecSettings->maxBitrate > 0 && codecSettings->startBitrate > codecSettings->maxBitrate) || diff --git a/opentera-webrtc-native-client/OpenteraWebrtcNativeGStreamer/src/Encoders/H264GStreamerVideoEncoders.cpp b/opentera-webrtc-native-client/OpenteraWebrtcNativeGStreamer/src/Encoders/H264GStreamerVideoEncoders.cpp index 1048dbc0..cffe0e5b 100644 --- a/opentera-webrtc-native-client/OpenteraWebrtcNativeGStreamer/src/Encoders/H264GStreamerVideoEncoders.cpp +++ b/opentera-webrtc-native-client/OpenteraWebrtcNativeGStreamer/src/Encoders/H264GStreamerVideoEncoders.cpp @@ -32,7 +32,7 @@ constexpr const char* MainProfileLevelIdPrefix = "4f"; constexpr const char* High444ProfileLevelIdPrefix = "f4"; H264GStreamerVideoEncoder::H264GStreamerVideoEncoder( - const webrtc::SdpVideoFormat::Parameters& parameters, + const webrtc::CodecParameterMap& parameters, string encoderPipeline, string encoderBitratePropertyName, BitRateUnit bitRatePropertyUnit, @@ -56,7 +56,7 @@ H264GStreamerVideoEncoder::H264GStreamerVideoEncoder( } } -string H264GStreamerVideoEncoder::mediaTypeCaps(const webrtc::SdpVideoFormat::Parameters& parameters) +string H264GStreamerVideoEncoder::mediaTypeCaps(const webrtc::CodecParameterMap& parameters) { auto it = parameters.find(cricket::kH264FmtpProfileLevelId); if (it == parameters.end() || it->second.find(BaselineProfileLevelIdPrefix) == 0) @@ -82,7 +82,7 @@ const char* H264GStreamerVideoEncoder::codecName() return cricket::kH264CodecName; } -bool H264GStreamerVideoEncoder::isProfileBaselineOrMain(const webrtc::SdpVideoFormat::Parameters& parameters) +bool H264GStreamerVideoEncoder::isProfileBaselineOrMain(const webrtc::CodecParameterMap& parameters) { auto it = parameters.find(cricket::kH264FmtpProfileLevelId); if (it == parameters.end()) @@ -95,7 +95,7 @@ bool H264GStreamerVideoEncoder::isProfileBaselineOrMain(const webrtc::SdpVideoFo } } -bool H264GStreamerVideoEncoder::isProfileBaselineOrMainOrHigh444(const webrtc::SdpVideoFormat::Parameters& parameters) +bool H264GStreamerVideoEncoder::isProfileBaselineOrMainOrHigh444(const webrtc::CodecParameterMap& parameters) { auto it = parameters.find(cricket::kH264FmtpProfileLevelId); if (it == parameters.end()) @@ -116,15 +116,14 @@ int H264GStreamerVideoEncoder::getKeyframeInterval(const webrtc::VideoCodec& cod void H264GStreamerVideoEncoder::populateCodecSpecificInfo( webrtc::CodecSpecificInfo& codecSpecificInfo, - const webrtc::EncodedImage& encodedFrame) + [[maybe_unused]] const webrtc::EncodedImage& encodedFrame) { codecSpecificInfo.codecType = webrtc::kVideoCodecH264; codecSpecificInfo.codecSpecific.H264.packetization_mode = m_packetizationMode; } -SoftwareH264GStreamerVideoEncoder::SoftwareH264GStreamerVideoEncoder( - const webrtc::SdpVideoFormat::Parameters& parameters) +SoftwareH264GStreamerVideoEncoder::SoftwareH264GStreamerVideoEncoder(const webrtc::CodecParameterMap& parameters) : H264GStreamerVideoEncoder( parameters, "x264enc name=encoder tune=zerolatency ! h264parse", @@ -153,13 +152,13 @@ bool SoftwareH264GStreamerVideoEncoder::isHardwareAccelerated() return false; } -bool SoftwareH264GStreamerVideoEncoder::areParametersSupported(const webrtc::SdpVideoFormat::Parameters& parameters) +bool SoftwareH264GStreamerVideoEncoder::areParametersSupported(const webrtc::CodecParameterMap& parameters) { return isProfileBaselineOrMainOrHigh444(parameters); } -VaapiH264GStreamerVideoEncoder::VaapiH264GStreamerVideoEncoder(const webrtc::SdpVideoFormat::Parameters& parameters) +VaapiH264GStreamerVideoEncoder::VaapiH264GStreamerVideoEncoder(const webrtc::CodecParameterMap& parameters) : H264GStreamerVideoEncoder( parameters, "vaapih264enc name=encoder ! h264parse", @@ -188,13 +187,13 @@ bool VaapiH264GStreamerVideoEncoder::isHardwareAccelerated() return true; } -bool VaapiH264GStreamerVideoEncoder::areParametersSupported(const webrtc::SdpVideoFormat::Parameters& parameters) +bool VaapiH264GStreamerVideoEncoder::areParametersSupported(const webrtc::CodecParameterMap& parameters) { return isProfileBaselineOrMain(parameters); } -TegraH264GStreamerVideoEncoder::TegraH264GStreamerVideoEncoder(const webrtc::SdpVideoFormat::Parameters& parameters) +TegraH264GStreamerVideoEncoder::TegraH264GStreamerVideoEncoder(const webrtc::CodecParameterMap& parameters) : H264GStreamerVideoEncoder( parameters, "nvvidconv ! nvv4l2h264enc name=encoder profile=" + profileFromParameters(parameters) + " ! h264parse", @@ -224,12 +223,12 @@ bool TegraH264GStreamerVideoEncoder::isHardwareAccelerated() return true; } -bool TegraH264GStreamerVideoEncoder::areParametersSupported(const webrtc::SdpVideoFormat::Parameters& parameters) +bool TegraH264GStreamerVideoEncoder::areParametersSupported(const webrtc::CodecParameterMap& parameters) { return isProfileBaselineOrMain(parameters); } -string TegraH264GStreamerVideoEncoder::profileFromParameters(const webrtc::SdpVideoFormat::Parameters& parameters) +string TegraH264GStreamerVideoEncoder::profileFromParameters(const webrtc::CodecParameterMap& parameters) { auto it = parameters.find(cricket::kH264FmtpProfileLevelId); if (it != parameters.end() && it->second.find(MainProfileLevelIdPrefix) == 0) @@ -243,7 +242,7 @@ string TegraH264GStreamerVideoEncoder::profileFromParameters(const webrtc::SdpVi } -V4l2H264GStreamerVideoEncoder::V4l2H264GStreamerVideoEncoder(const webrtc::SdpVideoFormat::Parameters& parameters) +V4l2H264GStreamerVideoEncoder::V4l2H264GStreamerVideoEncoder(const webrtc::CodecParameterMap& parameters) : H264GStreamerVideoEncoder( parameters, "v4l2h264enc name=encoder ! h264parse", @@ -273,14 +272,13 @@ bool V4l2H264GStreamerVideoEncoder::isHardwareAccelerated() return true; } -bool V4l2H264GStreamerVideoEncoder::areParametersSupported(const webrtc::SdpVideoFormat::Parameters& parameters) +bool V4l2H264GStreamerVideoEncoder::areParametersSupported(const webrtc::CodecParameterMap& parameters) { return isProfileBaselineOrMain(parameters); } -AppleMediaH264GStreamerVideoEncoder::AppleMediaH264GStreamerVideoEncoder( - const webrtc::SdpVideoFormat::Parameters& parameters) +AppleMediaH264GStreamerVideoEncoder::AppleMediaH264GStreamerVideoEncoder(const webrtc::CodecParameterMap& parameters) : H264GStreamerVideoEncoder( parameters, "vtenc_h264 name=encoder ! h264parse", @@ -309,7 +307,7 @@ bool AppleMediaH264GStreamerVideoEncoder::isHardwareAccelerated() return true; } -bool AppleMediaH264GStreamerVideoEncoder::areParametersSupported(const webrtc::SdpVideoFormat::Parameters& parameters) +bool AppleMediaH264GStreamerVideoEncoder::areParametersSupported(const webrtc::CodecParameterMap& parameters) { return isProfileBaselineOrMain(parameters); } diff --git a/opentera-webrtc-native-client/OpenteraWebrtcNativeGStreamer/src/Encoders/Vp8GStreamerVideoEncoders.cpp b/opentera-webrtc-native-client/OpenteraWebrtcNativeGStreamer/src/Encoders/Vp8GStreamerVideoEncoders.cpp index 9877c56f..847f876c 100644 --- a/opentera-webrtc-native-client/OpenteraWebrtcNativeGStreamer/src/Encoders/Vp8GStreamerVideoEncoders.cpp +++ b/opentera-webrtc-native-client/OpenteraWebrtcNativeGStreamer/src/Encoders/Vp8GStreamerVideoEncoders.cpp @@ -67,7 +67,8 @@ void Vp8GStreamerVideoEncoder::populateCodecSpecificInfo( } -SoftwareVp8GStreamerVideoEncoder::SoftwareVp8GStreamerVideoEncoder(const webrtc::SdpVideoFormat::Parameters& parameters) +SoftwareVp8GStreamerVideoEncoder::SoftwareVp8GStreamerVideoEncoder( + [[maybe_unused]] const webrtc::CodecParameterMap& parameters) : Vp8GStreamerVideoEncoder( "vp8enc name=encoder deadline=1", "target-bitrate", @@ -95,13 +96,15 @@ bool SoftwareVp8GStreamerVideoEncoder::isHardwareAccelerated() return false; } -bool SoftwareVp8GStreamerVideoEncoder::areParametersSupported(const webrtc::SdpVideoFormat::Parameters& parameters) +bool SoftwareVp8GStreamerVideoEncoder::areParametersSupported( + [[maybe_unused]] const webrtc::CodecParameterMap& parameters) { return true; } -VaapiVp8GStreamerVideoEncoder::VaapiVp8GStreamerVideoEncoder(const webrtc::SdpVideoFormat::Parameters& parameters) +VaapiVp8GStreamerVideoEncoder::VaapiVp8GStreamerVideoEncoder( + [[maybe_unused]] const webrtc::CodecParameterMap& parameters) : Vp8GStreamerVideoEncoder("vaapivp8enc name=encoder", "bitrate", BitRateUnit::KBitPerSec, "keyframe-period") { } @@ -125,13 +128,14 @@ bool VaapiVp8GStreamerVideoEncoder::isHardwareAccelerated() return true; } -bool VaapiVp8GStreamerVideoEncoder::areParametersSupported(const webrtc::SdpVideoFormat::Parameters& parameters) +bool VaapiVp8GStreamerVideoEncoder::areParametersSupported([[maybe_unused]] const webrtc::CodecParameterMap& parameters) { return true; } -TegraVp8GStreamerVideoEncoder::TegraVp8GStreamerVideoEncoder(const webrtc::SdpVideoFormat::Parameters& parameters) +TegraVp8GStreamerVideoEncoder::TegraVp8GStreamerVideoEncoder( + [[maybe_unused]] const webrtc::CodecParameterMap& parameters) : Vp8GStreamerVideoEncoder( "nvvidconv ! nvv4l2vp8enc name=encoder", "bitrate", @@ -160,7 +164,7 @@ bool TegraVp8GStreamerVideoEncoder::isHardwareAccelerated() return true; } -bool TegraVp8GStreamerVideoEncoder::areParametersSupported(const webrtc::SdpVideoFormat::Parameters& parameters) +bool TegraVp8GStreamerVideoEncoder::areParametersSupported([[maybe_unused]] const webrtc::CodecParameterMap& parameters) { return true; } diff --git a/opentera-webrtc-native-client/OpenteraWebrtcNativeGStreamer/src/Encoders/Vp9GStreamerVideoEncoders.cpp b/opentera-webrtc-native-client/OpenteraWebrtcNativeGStreamer/src/Encoders/Vp9GStreamerVideoEncoders.cpp index 1a6c5927..38e6451c 100644 --- a/opentera-webrtc-native-client/OpenteraWebrtcNativeGStreamer/src/Encoders/Vp9GStreamerVideoEncoders.cpp +++ b/opentera-webrtc-native-client/OpenteraWebrtcNativeGStreamer/src/Encoders/Vp9GStreamerVideoEncoders.cpp @@ -24,7 +24,7 @@ using namespace std; // TODO fix VP9 Vp9GStreamerVideoEncoder::Vp9GStreamerVideoEncoder( - const webrtc::SdpVideoFormat::Parameters& parameters, + const webrtc::CodecParameterMap& parameters, string encoderPipeline, string encoderBitratePropertyName, BitRateUnit bitRatePropertyUnit, @@ -38,7 +38,7 @@ Vp9GStreamerVideoEncoder::Vp9GStreamerVideoEncoder( { } -string Vp9GStreamerVideoEncoder::mediaTypeCaps(const webrtc::SdpVideoFormat::Parameters& parameters) +string Vp9GStreamerVideoEncoder::mediaTypeCaps(const webrtc::CodecParameterMap& parameters) { auto it = parameters.find(cricket::kVP9ProfileId); if (it == parameters.end()) @@ -56,7 +56,7 @@ const char* Vp9GStreamerVideoEncoder::codecName() return cricket::kVp9CodecName; } -bool Vp9GStreamerVideoEncoder::isProfile0123OrNone(const webrtc::SdpVideoFormat::Parameters& parameters) +bool Vp9GStreamerVideoEncoder::isProfile0123OrNone(const webrtc::CodecParameterMap& parameters) { if (parameters.size() > 1) { @@ -81,7 +81,7 @@ int Vp9GStreamerVideoEncoder::getKeyframeInterval(const webrtc::VideoCodec& code void Vp9GStreamerVideoEncoder::populateCodecSpecificInfo( webrtc::CodecSpecificInfo& codecSpecificInfo, - const webrtc::EncodedImage& encodedFrame) + [[maybe_unused]] const webrtc::EncodedImage& encodedFrame) { codecSpecificInfo.codecType = webrtc::kVideoCodecVP9; @@ -101,7 +101,7 @@ int Vp9GStreamerVideoEncoder::InitEncode( } -SoftwareVp9GStreamerVideoEncoder::SoftwareVp9GStreamerVideoEncoder(const webrtc::SdpVideoFormat::Parameters& parameters) +SoftwareVp9GStreamerVideoEncoder::SoftwareVp9GStreamerVideoEncoder(const webrtc::CodecParameterMap& parameters) : Vp9GStreamerVideoEncoder( parameters, "vp9enc name=encoder deadline=1", @@ -130,13 +130,13 @@ bool SoftwareVp9GStreamerVideoEncoder::isHardwareAccelerated() return false; } -bool SoftwareVp9GStreamerVideoEncoder::areParametersSupported(const webrtc::SdpVideoFormat::Parameters& parameters) +bool SoftwareVp9GStreamerVideoEncoder::areParametersSupported(const webrtc::CodecParameterMap& parameters) { return isProfile0123OrNone(parameters); } -TegraVp9GStreamerVideoEncoder::TegraVp9GStreamerVideoEncoder(const webrtc::SdpVideoFormat::Parameters& parameters) +TegraVp9GStreamerVideoEncoder::TegraVp9GStreamerVideoEncoder(const webrtc::CodecParameterMap& parameters) : Vp9GStreamerVideoEncoder( parameters, "nvvidconv ! nvv4l2vp9enc name=encoder", @@ -166,7 +166,7 @@ bool TegraVp9GStreamerVideoEncoder::isHardwareAccelerated() return true; } -bool TegraVp9GStreamerVideoEncoder::areParametersSupported(const webrtc::SdpVideoFormat::Parameters& parameters) +bool TegraVp9GStreamerVideoEncoder::areParametersSupported(const webrtc::CodecParameterMap& parameters) { return isProfile0123OrNone(parameters); } diff --git a/opentera-webrtc-native-client/OpenteraWebrtcNativeGStreamer/src/Factories/WebRtcGStreamerVideoEncoderFactory.cpp b/opentera-webrtc-native-client/OpenteraWebrtcNativeGStreamer/src/Factories/WebRtcGStreamerVideoEncoderFactory.cpp index dad0e858..283f0708 100644 --- a/opentera-webrtc-native-client/OpenteraWebrtcNativeGStreamer/src/Factories/WebRtcGStreamerVideoEncoderFactory.cpp +++ b/opentera-webrtc-native-client/OpenteraWebrtcNativeGStreamer/src/Factories/WebRtcGStreamerVideoEncoderFactory.cpp @@ -156,7 +156,8 @@ void WebRtcGStreamerVideoEncoderFactory::addVp8Encoders( } void WebRtcGStreamerVideoEncoderFactory::addVp9Encoders( - bool forceHardwareAcceleration, + // TODO Remove maybe_unused when VP9 works. + [[maybe_unused]] bool forceHardwareAcceleration, bool useGStreamerSoftwareEncoder) { auto VP9_CODEC_NAME = Vp9GStreamerVideoEncoder::codecName(); @@ -200,7 +201,7 @@ WebRtcGStreamerVideoEncoderFactory::EncoderFactory return { priority, false, - [](const webrtc::SdpVideoFormat::Parameters& parameters) { return true; }, + []([[maybe_unused]] const webrtc::CodecParameterMap& parameters) { return true; }, [this](const webrtc::Environment& env, const webrtc::SdpVideoFormat& format) { return m_builtinVideoEncoderFactory->Create(env, format); }}; }