Skip to content

Commit

Permalink
webrtc M86: critical_section.h replaced by mutex.h
Browse files Browse the repository at this point in the history
  • Loading branch information
ludocosmo committed Jan 17, 2021
1 parent a8ca4c6 commit fca8655
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions plugins/obs-outputs/AudioDeviceModuleWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ bool AudioDeviceModuleWrapper::Initialized() const
void AudioDeviceModuleWrapper::onIncomingData(uint8_t *data,
size_t samples_per_channel)
{
_critSect.Enter();
_critSect.Lock();
if (!audioTransport)
return;
_critSect.Leave();
_critSect.Unlock();

// Get audio
audio_t *audio = obs_get_audio();
Expand Down
4 changes: 2 additions & 2 deletions plugins/obs-outputs/AudioDeviceModuleWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <api/scoped_refptr.h>
#include <modules/audio_device/include/audio_device_default.h>
#include <rtc_base/checks.h>
#include <rtc_base/critical_section.h>
#include <rtc_base/synchronization/mutex.h>
#include <rtc_base/ref_counted_object.h>

#include <stdio.h>
Expand Down Expand Up @@ -83,7 +83,7 @@ class AudioDeviceModuleWrapper

public:
bool _initialized;
rtc::CriticalSection _critSect;
webrtc::Mutex _critSect;
AudioTransport *audioTransport;
uint8_t pending[640 * 2 * 2];
size_t pendingLength;
Expand Down
3 changes: 1 addition & 2 deletions plugins/obs-outputs/WebRTCStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include "common_video/libyuv/include/webrtc_libyuv.h"
#include "pc/rtc_stats_collector.h"
#include "rtc_base/checks.h"
#include "rtc_base/critical_section.h"
#include <libyuv.h>

#include <algorithm>
Expand Down Expand Up @@ -887,7 +886,7 @@ void WebRTCStream::getStats()

rtc::scoped_refptr<const webrtc::RTCStatsReport> WebRTCStream::NewGetStats()
{
rtc::CritScope lock(&crit_);
webrtc::MutexLock lock(&crit_);

if (nullptr == pc) {
return nullptr;
Expand Down
4 changes: 2 additions & 2 deletions plugins/obs-outputs/WebRTCStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "api/scoped_refptr.h"
#include "api/set_remote_description_observer_interface.h"
#include "modules/audio_processing/include/audio_processing.h"
#include "rtc_base/critical_section.h"
#include "rtc_base/synchronization/mutex.h"
#include "rtc_base/ref_counted_object.h"
#include "rtc_base/thread.h"
#include "rtc_base/timestamp_aligner.h"
Expand Down Expand Up @@ -176,7 +176,7 @@ class WebRTCStream : public rtc::RefCountedObject<WebRTCStreamInterface> {

std::thread thread_closeAsync;

rtc::CriticalSection crit_;
webrtc::Mutex crit_;

// Audio Wrapper
rtc::scoped_refptr<AudioDeviceModuleWrapper> adm;
Expand Down

0 comments on commit fca8655

Please sign in to comment.