2011-08-25 21:40:11 +00:00
|
|
|
/*
|
2011-07-07 08:21:25 +00:00
|
|
|
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
|
|
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
2023-03-10 08:15:08 +01:00
|
|
|
#include "modules/video_coding/deprecated/event_wrapper.h"
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "rtc_base/event.h"
|
2015-04-08 11:24:19 +02:00
|
|
|
|
2011-07-07 08:21:25 +00:00
|
|
|
namespace webrtc {
|
2015-04-08 11:24:19 +02:00
|
|
|
|
|
|
|
|
class EventWrapperImpl : public EventWrapper {
|
|
|
|
|
public:
|
|
|
|
|
~EventWrapperImpl() override {}
|
|
|
|
|
|
|
|
|
|
bool Set() override {
|
|
|
|
|
event_.Set();
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2022-08-19 08:16:48 +00:00
|
|
|
// TODO(bugs.webrtc.org/14366): Migrate to TimeDelta.
|
2020-03-05 15:31:10 +01:00
|
|
|
EventTypeWrapper Wait(int max_time_ms) override {
|
2022-08-19 08:16:48 +00:00
|
|
|
return event_.Wait(TimeDelta::Millis(max_time_ms)) ? kEventSignaled
|
|
|
|
|
: kEventTimeout;
|
2015-04-08 11:24:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
rtc::Event event_;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// static
|
2012-12-10 10:44:37 +00:00
|
|
|
EventWrapper* EventWrapper::Create() {
|
2015-04-08 11:24:19 +02:00
|
|
|
return new EventWrapperImpl();
|
2011-07-07 08:21:25 +00:00
|
|
|
}
|
2015-04-08 11:24:19 +02:00
|
|
|
|
2013-07-03 15:12:26 +00:00
|
|
|
} // namespace webrtc
|