Skip to content

Commit

Permalink
Fix warnings with GCC on Ubuntu 20.04 (#149)
Browse files Browse the repository at this point in the history
* Fix warnings with GCC on Ubuntu 20.04

* Replace MacOS 12 with MacOS 13 in CI, as GitHub MacOS 12 runners are deprecated

* Fix MacOS 13 CI
  • Loading branch information
philippewarren authored Dec 18, 2024
1 parent 92a0625 commit 7f1ef54
Show file tree
Hide file tree
Showing 23 changed files with 145 additions and 114 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/cpp-python-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,13 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-22.04, macos-12]
os: [ubuntu-20.04, ubuntu-22.04, macos-13]
python-version: ["3.8", "3.9", "3.10"]
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:
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.5
1.2.6
1 change: 1 addition & 0 deletions opentera-webrtc-native-client/3rdParty/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,17 @@ if(WIN32)
set(webrtc_native_LIBRARY ${CMAKE_CURRENT_BINARY_DIR}/${extracted_directory_name}/lib/webrtc.lib CACHE INTERNAL "")
set(libyuv_LIBRARY ${CMAKE_CURRENT_BINARY_DIR}/${extracted_directory_name}/lib/libyuv_internal.lib CACHE INTERNAL "")
else()
set(boringssl_LIBRARY ${CMAKE_CURRENT_BINARY_DIR}/${extracted_directory_name}/lib/libboringssl.a CACHE INTERNAL "")
set(libyuv_LIBRARY ${CMAKE_CURRENT_BINARY_DIR}/${extracted_directory_name}/lib/libyuv_internal.a CACHE INTERNAL "")
# TODO: this is a patch because these two thin archives do not link on MacOS 13 in CI.
if(APPLE)
file(GLOB boringssl_object_files ${CMAKE_CURRENT_BINARY_DIR}/${extracted_directory_name}/lib/boringssl/*.o)
set(boringssl_LIBRARY ${boringssl_object_files} CACHE INTERNAL "")

file(GLOB libyuv_object_files ${CMAKE_CURRENT_BINARY_DIR}/${extracted_directory_name}/lib/libyuv_internal/*.o)
set(libyuv_LIBRARY ${libyuv_object_files} CACHE INTERNAL "")
else()
set(boringssl_LIBRARY ${CMAKE_CURRENT_BINARY_DIR}/${extracted_directory_name}/lib/libboringssl.a CACHE INTERNAL "")
set(libyuv_LIBRARY ${CMAKE_CURRENT_BINARY_DIR}/${extracted_directory_name}/lib/libyuv_internal.a CACHE INTERNAL "")
endif()

if(APPLE)
set(webrtc_native_LIBRARY ${CMAKE_CURRENT_BINARY_DIR}/${extracted_directory_name}/lib/libwebrtc.a "-framework Foundation" "-framework AVFoundation" "-framework CoreAudio" "-framework AudioToolbox" "-framework CoreGraphics" CACHE INTERNAL "")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<webrtc::DataChannelInterface> dataChannel) {}
void PeerConnectionHandler::OnDataChannel([[maybe_unused]] rtc::scoped_refptr<webrtc::DataChannelInterface> dataChannel)
{
}

void PeerConnectionHandler::OnTrack(rtc::scoped_refptr<webrtc::RtpTransceiverInterface> transceiver) {}
void PeerConnectionHandler::OnTrack([[maybe_unused]] rtc::scoped_refptr<webrtc::RtpTransceiverInterface> transceiver) {}

void PeerConnectionHandler::OnRemoveTrack(rtc::scoped_refptr<webrtc::RtpReceiverInterface> receiver) {}
void PeerConnectionHandler::OnRemoveTrack([[maybe_unused]] rtc::scoped_refptr<webrtc::RtpReceiverInterface> 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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ StreamPeerConnectionHandler::StreamPeerConnectionHandler(
move(onClientConnected),
move(onClientDisconnected),
move(onClientConnectionFailed)),
m_offerToReceiveAudio(hasOnMixedAudioFrameReceivedCallback || onAudioFrameReceived),
m_offerToReceiveVideo(static_cast<bool>(onVideoFrameReceived)),
m_offerToReceiveAudio(hasOnMixedAudioFrameReceivedCallback || onAudioFrameReceived),
m_videoTrack(move(videoTrack)),
m_audioTrack(move(audioTrack)),
m_onAddRemoteStream(move(onAddRemoteStream)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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])
{
Expand All @@ -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])
{
Expand All @@ -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)
{
Expand All @@ -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)
{
Expand All @@ -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)
{
Expand All @@ -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)
{
Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand All @@ -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;
}
Expand All @@ -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;
}
Expand All @@ -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;
}
Expand All @@ -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;
}
Expand All @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,9 @@ unique_ptr<PeerConnectionHandler>
rtc::scoped_refptr<webrtc::VideoTrackInterface> videoTrack = nullptr;
if (m_videoSource != nullptr)
{
videoTrack = m_peerConnectionFactory->CreateVideoTrack("stream_video", m_videoSource.get());
videoTrack = m_peerConnectionFactory->CreateVideoTrack(
rtc::scoped_refptr<webrtc::VideoTrackSourceInterface>(m_videoSource.get()),
"stream_video");
videoTrack->set_enabled(!m_isLocalVideoMuted);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ bool WebrtcClient::getCallAcceptance(const string& id)
}

unique_ptr<PeerConnectionHandler>
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(),
Expand Down
Loading

0 comments on commit 7f1ef54

Please sign in to comment.