Revert "Split EventWrapper in twain."
This reverts commit 9509fbfc301dd5412804ce5731afedc81480f2f8. This is to debug a Chromium issue that WebRTC hangs if there is > 1 PeerConnection active in the browser on Win XP. BUG= TBR=tommi@webrtc.org Review URL: https://webrtc-codereview.appspot.com/43019004 Cr-Commit-Position: refs/heads/master@{#8912}
This commit is contained in:
parent
31331cfd2d
commit
cf3c83e76c
@ -247,14 +247,14 @@ int16_t APITest::SetUp() {
|
||||
|
||||
//--- EVENT TIMERS
|
||||
// A
|
||||
_pullEventA = EventTimerWrapper::Create();
|
||||
_pushEventA = EventTimerWrapper::Create();
|
||||
_processEventA = EventTimerWrapper::Create();
|
||||
_pullEventA = EventWrapper::Create();
|
||||
_pushEventA = EventWrapper::Create();
|
||||
_processEventA = EventWrapper::Create();
|
||||
_apiEventA = EventWrapper::Create();
|
||||
// B
|
||||
_pullEventB = EventTimerWrapper::Create();
|
||||
_pushEventB = EventTimerWrapper::Create();
|
||||
_processEventB = EventTimerWrapper::Create();
|
||||
_pullEventB = EventWrapper::Create();
|
||||
_pushEventB = EventWrapper::Create();
|
||||
_processEventB = EventWrapper::Create();
|
||||
_apiEventB = EventWrapper::Create();
|
||||
|
||||
//--- I/O params
|
||||
@ -682,7 +682,7 @@ void APITest::TestDelay(char side) {
|
||||
AudioCodingModule* myACM;
|
||||
Channel* myChannel;
|
||||
int32_t* myMinDelay;
|
||||
EventTimerWrapper* myEvent = EventTimerWrapper::Create();
|
||||
EventWrapper* myEvent = EventWrapper::Create();
|
||||
|
||||
uint32_t inTimestamp = 0;
|
||||
uint32_t outTimestamp = 0;
|
||||
|
@ -109,14 +109,14 @@ class APITest : public ACMTest {
|
||||
bool _writeToFile;
|
||||
//--- Events
|
||||
// A
|
||||
EventTimerWrapper* _pullEventA; // pulling data from ACM
|
||||
EventTimerWrapper* _pushEventA; // pushing data to ACM
|
||||
EventTimerWrapper* _processEventA; // process
|
||||
EventWrapper* _pullEventA; // pulling data from ACM
|
||||
EventWrapper* _pushEventA; // pushing data to ACM
|
||||
EventWrapper* _processEventA; // process
|
||||
EventWrapper* _apiEventA; // API calls
|
||||
// B
|
||||
EventTimerWrapper* _pullEventB; // pulling data from ACM
|
||||
EventTimerWrapper* _pushEventB; // pushing data to ACM
|
||||
EventTimerWrapper* _processEventB; // process
|
||||
EventWrapper* _pullEventB; // pulling data from ACM
|
||||
EventWrapper* _pushEventB; // pushing data to ACM
|
||||
EventWrapper* _processEventB; // process
|
||||
EventWrapper* _apiEventB; // API calls
|
||||
|
||||
// keep track of the codec in either side.
|
||||
|
@ -292,7 +292,7 @@ void ISACTest::EncodeDecode(int testNr, ACMTestISACConfig& wbISACConfig,
|
||||
|
||||
char currentTime[500];
|
||||
CodecInst sendCodec;
|
||||
EventTimerWrapper* myEvent = EventTimerWrapper::Create();
|
||||
EventWrapper* myEvent = EventWrapper::Create();
|
||||
EXPECT_TRUE(myEvent->StartTimer(true, 10));
|
||||
while (!(_inFileA.EndOfFile() || _inFileA.Rewinded())) {
|
||||
Run10ms();
|
||||
|
@ -47,7 +47,7 @@ namespace webrtc {
|
||||
AudioDeviceWindowsWave::AudioDeviceWindowsWave(const int32_t id) :
|
||||
_ptrAudioBuffer(NULL),
|
||||
_critSect(*CriticalSectionWrapper::CreateCriticalSection()),
|
||||
_timeEvent(*EventTimerWrapper::Create()),
|
||||
_timeEvent(*EventWrapper::Create()),
|
||||
_recStartEvent(*EventWrapper::Create()),
|
||||
_playStartEvent(*EventWrapper::Create()),
|
||||
_hGetCaptureVolumeThread(NULL),
|
||||
|
@ -18,7 +18,6 @@
|
||||
#pragma comment( lib, "winmm.lib" )
|
||||
|
||||
namespace webrtc {
|
||||
class EventTimerWrapper;
|
||||
class EventWrapper;
|
||||
|
||||
const uint32_t TIMER_PERIOD_MS = 2;
|
||||
@ -212,7 +211,7 @@ private:
|
||||
AudioDeviceBuffer* _ptrAudioBuffer;
|
||||
|
||||
CriticalSectionWrapper& _critSect;
|
||||
EventTimerWrapper& _timeEvent;
|
||||
EventWrapper& _timeEvent;
|
||||
EventWrapper& _recStartEvent;
|
||||
EventWrapper& _playStartEvent;
|
||||
|
||||
|
@ -39,7 +39,7 @@ IncomingVideoStream::IncomingVideoStream(const int32_t module_id,
|
||||
thread_critsect_(*CriticalSectionWrapper::CreateCriticalSection()),
|
||||
buffer_critsect_(*CriticalSectionWrapper::CreateCriticalSection()),
|
||||
incoming_render_thread_(),
|
||||
deliver_buffer_event_(*EventTimerWrapper::Create()),
|
||||
deliver_buffer_event_(*EventWrapper::Create()),
|
||||
running_(false),
|
||||
external_callback_(NULL),
|
||||
render_callback_(NULL),
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
namespace webrtc {
|
||||
class CriticalSectionWrapper;
|
||||
class EventTimerWrapper;
|
||||
class EventWrapper;
|
||||
class ThreadWrapper;
|
||||
class VideoRenderCallback;
|
||||
class VideoRenderFrames;
|
||||
@ -73,7 +73,7 @@ class IncomingVideoStream : public VideoRenderCallback {
|
||||
CriticalSectionWrapper& thread_critsect_;
|
||||
CriticalSectionWrapper& buffer_critsect_;
|
||||
rtc::scoped_ptr<ThreadWrapper> incoming_render_thread_;
|
||||
EventTimerWrapper& deliver_buffer_event_;
|
||||
EventWrapper& deliver_buffer_event_;
|
||||
bool running_;
|
||||
|
||||
VideoRenderCallback* external_callback_;
|
||||
|
@ -22,7 +22,7 @@
|
||||
namespace webrtc {
|
||||
|
||||
class CriticalSectionWrapper;
|
||||
class EventTimerWrapper;
|
||||
class EventWrapper;
|
||||
|
||||
class VideoRenderIosGles20 {
|
||||
public:
|
||||
@ -63,7 +63,7 @@ class VideoRenderIosGles20 {
|
||||
|
||||
private:
|
||||
rtc::scoped_ptr<CriticalSectionWrapper> gles_crit_sec_;
|
||||
EventTimerWrapper* screen_update_event_;
|
||||
EventWrapper* screen_update_event_;
|
||||
rtc::scoped_ptr<ThreadWrapper> screen_update_thread_;
|
||||
|
||||
VideoRenderIosView* view_;
|
||||
|
@ -34,7 +34,7 @@ VideoRenderIosGles20::VideoRenderIosGles20(VideoRenderIosView* view,
|
||||
is_rendering_(true) {
|
||||
screen_update_thread_ = ThreadWrapper::CreateThread(
|
||||
ScreenUpdateThreadProc, this, "ScreenUpdateGles20");
|
||||
screen_update_event_ = EventTimerWrapper::Create();
|
||||
screen_update_event_ = EventWrapper::Create();
|
||||
GetWindowRect(window_rect_);
|
||||
}
|
||||
|
||||
|
@ -31,13 +31,16 @@
|
||||
class Trace;
|
||||
|
||||
namespace webrtc {
|
||||
class EventTimerWrapper;
|
||||
class EventWrapper;
|
||||
class ThreadWrapper;
|
||||
class VideoRenderNSOpenGL;
|
||||
class CriticalSectionWrapper;
|
||||
|
||||
class VideoChannelNSOpenGL : public VideoRenderCallback {
|
||||
class VideoChannelNSOpenGL : public VideoRenderCallback
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
VideoChannelNSOpenGL(NSOpenGLContext *nsglContext, int iId, VideoRenderNSOpenGL* owner);
|
||||
virtual ~VideoChannelNSOpenGL();
|
||||
|
||||
@ -167,7 +170,7 @@ private: // variables
|
||||
int _id;
|
||||
CriticalSectionWrapper& _nsglContextCritSec;
|
||||
rtc::scoped_ptr<ThreadWrapper> _screenUpdateThread;
|
||||
EventTimerWrapper* _screenUpdateEvent;
|
||||
EventWrapper* _screenUpdateEvent;
|
||||
NSOpenGLContext* _nsglContext;
|
||||
NSOpenGLContext* _nsglFullScreenContext;
|
||||
CocoaFullScreenWindow* _fullScreenWindow;
|
||||
|
@ -367,7 +367,7 @@ _windowRef( (CocoaRenderView*)windowRef),
|
||||
_fullScreen( fullScreen),
|
||||
_id( iId),
|
||||
_nsglContextCritSec( *CriticalSectionWrapper::CreateCriticalSection()),
|
||||
_screenUpdateEvent(EventTimerWrapper::Create()),
|
||||
_screenUpdateEvent( 0),
|
||||
_nsglContext( 0),
|
||||
_nsglFullScreenContext( 0),
|
||||
_fullScreenWindow( nil),
|
||||
@ -382,6 +382,7 @@ _windowRefSuperViewFrame(NSMakeRect(0,0,0,0))
|
||||
{
|
||||
_screenUpdateThread = ThreadWrapper::CreateThread(ScreenUpdateThreadProc,
|
||||
this, "ScreenUpdateNSOpenGL");
|
||||
_screenUpdateEvent = EventWrapper::Create();
|
||||
}
|
||||
|
||||
int VideoRenderNSOpenGL::ChangeWindow(CocoaRenderView* newWindowRef)
|
||||
|
@ -297,7 +297,7 @@ VideoRenderDirect3D9::VideoRenderDirect3D9(Trace* trace,
|
||||
{
|
||||
_screenUpdateThread = ThreadWrapper::CreateThread(
|
||||
ScreenUpdateThreadProc, this, "ScreenUpdateThread");
|
||||
_screenUpdateEvent = EventTimerWrapper::Create();
|
||||
_screenUpdateEvent = EventWrapper::Create();
|
||||
SetRect(&_originalHwndRect, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@
|
||||
|
||||
namespace webrtc {
|
||||
class CriticalSectionWrapper;
|
||||
class EventTimerWrapper;
|
||||
class EventWrapper;
|
||||
class Trace;
|
||||
|
||||
class D3D9Channel: public VideoRenderCallback
|
||||
@ -205,7 +205,7 @@ private:
|
||||
CriticalSectionWrapper& _refD3DCritsect;
|
||||
Trace* _trace;
|
||||
rtc::scoped_ptr<ThreadWrapper> _screenUpdateThread;
|
||||
EventTimerWrapper* _screenUpdateEvent;
|
||||
EventWrapper* _screenUpdateEvent;
|
||||
|
||||
HWND _hWnd;
|
||||
bool _fullScreen;
|
||||
|
@ -65,11 +65,11 @@ static_library("system_wrappers") {
|
||||
"source/critical_section_win.h",
|
||||
"source/data_log_c.cc",
|
||||
"source/event.cc",
|
||||
"source/event_timer_posix.cc",
|
||||
"source/event_timer_posix.h",
|
||||
"source/event_timer_win.cc",
|
||||
"source/event_timer_win.h",
|
||||
"source/event_posix.cc",
|
||||
"source/event_posix.h",
|
||||
"source/event_tracer.cc",
|
||||
"source/event_win.cc",
|
||||
"source/event_win.h",
|
||||
"source/file_impl.cc",
|
||||
"source/file_impl.h",
|
||||
"source/logging.cc",
|
||||
|
@ -18,15 +18,13 @@ enum EventTypeWrapper {
|
||||
kEventTimeout = 3
|
||||
};
|
||||
|
||||
#define WEBRTC_EVENT_10_SEC 10000
|
||||
#define WEBRTC_EVENT_INFINITE 0xffffffff
|
||||
|
||||
class EventTimerWrapper;
|
||||
|
||||
class EventWrapper {
|
||||
public:
|
||||
// Factory method. Constructor disabled.
|
||||
static EventWrapper* Create();
|
||||
|
||||
virtual ~EventWrapper() {}
|
||||
|
||||
// Releases threads who are calling Wait() and has started waiting. Please
|
||||
@ -45,11 +43,6 @@ class EventWrapper {
|
||||
// be released. It is possible that multiple (random) threads are released
|
||||
// Depending on timing.
|
||||
virtual EventTypeWrapper Wait(unsigned long max_time) = 0;
|
||||
};
|
||||
|
||||
class EventTimerWrapper : public EventWrapper {
|
||||
public:
|
||||
static EventTimerWrapper* Create();
|
||||
|
||||
// Starts a timer that will call a non-sticky version of Set() either once
|
||||
// or periodically. If the timer is periodic it ensures that there is no
|
||||
@ -59,7 +52,6 @@ class EventTimerWrapper : public EventWrapper {
|
||||
virtual bool StopTimer() = 0;
|
||||
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_EVENT_WRAPPER_H_
|
||||
|
@ -12,43 +12,22 @@
|
||||
|
||||
#if defined(_WIN32)
|
||||
#include <windows.h>
|
||||
#include "webrtc/system_wrappers/source/event_timer_win.h"
|
||||
#include "webrtc/system_wrappers/source/event_win.h"
|
||||
#elif defined(WEBRTC_MAC) && !defined(WEBRTC_IOS)
|
||||
#include <ApplicationServices/ApplicationServices.h>
|
||||
#include <pthread.h>
|
||||
#include "webrtc/system_wrappers/source/event_timer_posix.h"
|
||||
#include "webrtc/system_wrappers/source/event_posix.h"
|
||||
#else
|
||||
#include <pthread.h>
|
||||
#include "webrtc/system_wrappers/source/event_timer_posix.h"
|
||||
#include "webrtc/system_wrappers/source/event_posix.h"
|
||||
#endif
|
||||
|
||||
#include "webrtc/base/event.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
class EventWrapperImpl : public EventWrapper {
|
||||
public:
|
||||
EventWrapperImpl() : event_(false, false) {}
|
||||
~EventWrapperImpl() override {}
|
||||
|
||||
bool Set() override {
|
||||
event_.Set();
|
||||
return true;
|
||||
}
|
||||
|
||||
EventTypeWrapper Wait(unsigned long max_time) override {
|
||||
int to_wait = max_time == WEBRTC_EVENT_INFINITE ?
|
||||
rtc::Event::kForever : static_cast<int>(max_time);
|
||||
return event_.Wait(to_wait) ? kEventSignaled : kEventTimeout;
|
||||
}
|
||||
|
||||
private:
|
||||
rtc::Event event_;
|
||||
};
|
||||
|
||||
// static
|
||||
EventWrapper* EventWrapper::Create() {
|
||||
return new EventWrapperImpl();
|
||||
#if defined(_WIN32)
|
||||
return new EventWindows();
|
||||
#else
|
||||
return EventPosix::Create();
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
@ -8,7 +8,7 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include "webrtc/system_wrappers/source/event_timer_posix.h"
|
||||
#include "webrtc/system_wrappers/source/event_posix.h"
|
||||
|
||||
#include <errno.h>
|
||||
#include <pthread.h>
|
||||
@ -22,17 +22,17 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
// static
|
||||
EventTimerWrapper* EventTimerWrapper::Create() {
|
||||
return new EventTimerPosix();
|
||||
}
|
||||
|
||||
const long int E6 = 1000000;
|
||||
const long int E9 = 1000 * E6;
|
||||
|
||||
EventTimerPosix::EventTimerPosix()
|
||||
EventWrapper* EventPosix::Create() {
|
||||
return new EventPosix();
|
||||
}
|
||||
|
||||
EventPosix::EventPosix()
|
||||
: event_set_(false),
|
||||
timer_thread_(nullptr),
|
||||
timer_event_(0),
|
||||
created_at_(),
|
||||
periodic_(false),
|
||||
time_(0),
|
||||
@ -52,14 +52,14 @@ EventTimerPosix::EventTimerPosix()
|
||||
#endif
|
||||
}
|
||||
|
||||
EventTimerPosix::~EventTimerPosix() {
|
||||
EventPosix::~EventPosix() {
|
||||
StopTimer();
|
||||
pthread_cond_destroy(&cond_);
|
||||
pthread_mutex_destroy(&mutex_);
|
||||
}
|
||||
|
||||
// TODO(pbos): Make this void.
|
||||
bool EventTimerPosix::Set() {
|
||||
bool EventPosix::Set() {
|
||||
CHECK_EQ(0, pthread_mutex_lock(&mutex_));
|
||||
event_set_ = true;
|
||||
pthread_cond_signal(&cond_);
|
||||
@ -67,7 +67,7 @@ bool EventTimerPosix::Set() {
|
||||
return true;
|
||||
}
|
||||
|
||||
EventTypeWrapper EventTimerPosix::Wait(unsigned long timeout) {
|
||||
EventTypeWrapper EventPosix::Wait(unsigned long timeout) {
|
||||
int ret_val = 0;
|
||||
CHECK_EQ(0, pthread_mutex_lock(&mutex_));
|
||||
|
||||
@ -115,7 +115,7 @@ EventTypeWrapper EventTimerPosix::Wait(unsigned long timeout) {
|
||||
return ret_val == 0 ? kEventSignaled : kEventTimeout;
|
||||
}
|
||||
|
||||
EventTypeWrapper EventTimerPosix::Wait(timespec* end_at) {
|
||||
EventTypeWrapper EventPosix::Wait(timespec* end_at) {
|
||||
int ret_val = 0;
|
||||
CHECK_EQ(0, pthread_mutex_lock(&mutex_));
|
||||
|
||||
@ -134,7 +134,7 @@ EventTypeWrapper EventTimerPosix::Wait(timespec* end_at) {
|
||||
return ret_val == 0 ? kEventSignaled : kEventTimeout;
|
||||
}
|
||||
|
||||
bool EventTimerPosix::StartTimer(bool periodic, unsigned long time) {
|
||||
bool EventPosix::StartTimer(bool periodic, unsigned long time) {
|
||||
pthread_mutex_lock(&mutex_);
|
||||
if (timer_thread_) {
|
||||
if (periodic_) {
|
||||
@ -152,7 +152,7 @@ bool EventTimerPosix::StartTimer(bool periodic, unsigned long time) {
|
||||
}
|
||||
|
||||
// Start the timer thread
|
||||
timer_event_.reset(new EventTimerPosix());
|
||||
timer_event_ = static_cast<EventPosix*>(EventWrapper::Create());
|
||||
const char* thread_name = "WebRtc_event_timer_thread";
|
||||
timer_thread_ = ThreadWrapper::CreateThread(Run, this, thread_name);
|
||||
periodic_ = periodic;
|
||||
@ -164,11 +164,11 @@ bool EventTimerPosix::StartTimer(bool periodic, unsigned long time) {
|
||||
return started;
|
||||
}
|
||||
|
||||
bool EventTimerPosix::Run(void* obj) {
|
||||
return static_cast<EventTimerPosix*>(obj)->Process();
|
||||
bool EventPosix::Run(void* obj) {
|
||||
return static_cast<EventPosix*>(obj)->Process();
|
||||
}
|
||||
|
||||
bool EventTimerPosix::Process() {
|
||||
bool EventPosix::Process() {
|
||||
pthread_mutex_lock(&mutex_);
|
||||
if (created_at_.tv_sec == 0) {
|
||||
#ifndef WEBRTC_MAC
|
||||
@ -210,7 +210,7 @@ bool EventTimerPosix::Process() {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool EventTimerPosix::StopTimer() {
|
||||
bool EventPosix::StopTimer() {
|
||||
if (timer_event_) {
|
||||
timer_event_->Set();
|
||||
}
|
||||
@ -220,7 +220,10 @@ bool EventTimerPosix::StopTimer() {
|
||||
}
|
||||
timer_thread_.reset();
|
||||
}
|
||||
timer_event_.reset();
|
||||
if (timer_event_) {
|
||||
delete timer_event_;
|
||||
timer_event_ = 0;
|
||||
}
|
||||
|
||||
// Set time to zero to force new reference time for the timer.
|
||||
memset(&created_at_, 0, sizeof(created_at_));
|
@ -25,10 +25,11 @@ enum State {
|
||||
kDown = 2
|
||||
};
|
||||
|
||||
class EventTimerPosix : public EventTimerWrapper {
|
||||
class EventPosix : public EventWrapper {
|
||||
public:
|
||||
EventTimerPosix();
|
||||
~EventTimerPosix() override;
|
||||
static EventWrapper* Create();
|
||||
|
||||
~EventPosix() override;
|
||||
|
||||
EventTypeWrapper Wait(unsigned long max_time) override;
|
||||
bool Set() override;
|
||||
@ -37,6 +38,8 @@ class EventTimerPosix : public EventTimerWrapper {
|
||||
bool StopTimer() override;
|
||||
|
||||
private:
|
||||
EventPosix();
|
||||
|
||||
static bool Run(void* obj);
|
||||
bool Process();
|
||||
EventTypeWrapper Wait(timespec* end_at);
|
||||
@ -47,7 +50,7 @@ class EventTimerPosix : public EventTimerWrapper {
|
||||
bool event_set_;
|
||||
|
||||
rtc::scoped_ptr<ThreadWrapper> timer_thread_;
|
||||
rtc::scoped_ptr<EventTimerPosix> timer_event_;
|
||||
EventPosix* timer_event_;
|
||||
timespec created_at_;
|
||||
|
||||
bool periodic_;
|
@ -8,18 +8,13 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include "webrtc/system_wrappers/source/event_timer_win.h"
|
||||
#include "webrtc/system_wrappers/source/event_win.h"
|
||||
|
||||
#include "Mmsystem.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
// static
|
||||
EventTimerWrapper* EventTimerWrapper::Create() {
|
||||
return new EventTimerWin();
|
||||
}
|
||||
|
||||
EventTimerWin::EventTimerWin()
|
||||
EventWindows::EventWindows()
|
||||
: event_(::CreateEvent(NULL, // security attributes
|
||||
FALSE, // manual reset
|
||||
FALSE, // initial state
|
||||
@ -27,17 +22,17 @@ EventTimerWin::EventTimerWin()
|
||||
timerID_(NULL) {
|
||||
}
|
||||
|
||||
EventTimerWin::~EventTimerWin() {
|
||||
EventWindows::~EventWindows() {
|
||||
StopTimer();
|
||||
CloseHandle(event_);
|
||||
}
|
||||
|
||||
bool EventTimerWin::Set() {
|
||||
bool EventWindows::Set() {
|
||||
// Note: setting an event that is already set has no effect.
|
||||
return SetEvent(event_) == 1;
|
||||
}
|
||||
|
||||
EventTypeWrapper EventTimerWin::Wait(unsigned long max_time) {
|
||||
EventTypeWrapper EventWindows::Wait(unsigned long max_time) {
|
||||
unsigned long res = WaitForSingleObject(event_, max_time);
|
||||
switch (res) {
|
||||
case WAIT_OBJECT_0:
|
||||
@ -49,7 +44,7 @@ EventTypeWrapper EventTimerWin::Wait(unsigned long max_time) {
|
||||
}
|
||||
}
|
||||
|
||||
bool EventTimerWin::StartTimer(bool periodic, unsigned long time) {
|
||||
bool EventWindows::StartTimer(bool periodic, unsigned long time) {
|
||||
if (timerID_ != NULL) {
|
||||
timeKillEvent(timerID_);
|
||||
timerID_ = NULL;
|
||||
@ -66,7 +61,7 @@ bool EventTimerWin::StartTimer(bool periodic, unsigned long time) {
|
||||
return timerID_ != NULL;
|
||||
}
|
||||
|
||||
bool EventTimerWin::StopTimer() {
|
||||
bool EventWindows::StopTimer() {
|
||||
if (timerID_ != NULL) {
|
||||
timeKillEvent(timerID_);
|
||||
timerID_ = NULL;
|
@ -19,10 +19,10 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
class EventTimerWin : public EventTimerWrapper {
|
||||
class EventWindows : public EventWrapper {
|
||||
public:
|
||||
EventTimerWin();
|
||||
virtual ~EventTimerWin();
|
||||
EventWindows();
|
||||
virtual ~EventWindows();
|
||||
|
||||
virtual EventTypeWrapper Wait(unsigned long max_time);
|
||||
virtual bool Set();
|
@ -75,11 +75,11 @@
|
||||
'source/data_log_c.cc',
|
||||
'source/data_log_no_op.cc',
|
||||
'source/event.cc',
|
||||
'source/event_timer_posix.cc',
|
||||
'source/event_timer_posix.h',
|
||||
'source/event_timer_win.cc',
|
||||
'source/event_timer_win.h',
|
||||
'source/event_posix.cc',
|
||||
'source/event_posix.h',
|
||||
'source/event_tracer.cc',
|
||||
'source/event_win.cc',
|
||||
'source/event_win.h',
|
||||
'source/file_impl.cc',
|
||||
'source/file_impl.h',
|
||||
'source/logcat_trace_context.cc',
|
||||
|
@ -30,7 +30,7 @@ FakeAudioDevice::FakeAudioDevice(Clock* clock, const std::string& filename)
|
||||
playout_buffer_(),
|
||||
last_playout_ms_(-1),
|
||||
clock_(clock),
|
||||
tick_(EventTimerWrapper::Create()),
|
||||
tick_(EventWrapper::Create()),
|
||||
lock_(CriticalSectionWrapper::CreateCriticalSection()),
|
||||
file_utility_(new ModuleFileUtility(0)),
|
||||
input_stream_(FileWrapper::Create()) {
|
||||
|
@ -20,7 +20,7 @@ namespace webrtc {
|
||||
|
||||
class Clock;
|
||||
class CriticalSectionWrapper;
|
||||
class EventTimerWrapper;
|
||||
class EventWrapper;
|
||||
class FileWrapper;
|
||||
class ModuleFileUtility;
|
||||
class ThreadWrapper;
|
||||
@ -57,7 +57,7 @@ class FakeAudioDevice : public FakeAudioDeviceModule {
|
||||
int64_t last_playout_ms_;
|
||||
|
||||
Clock* clock_;
|
||||
rtc::scoped_ptr<EventTimerWrapper> tick_;
|
||||
rtc::scoped_ptr<EventWrapper> tick_;
|
||||
rtc::scoped_ptr<CriticalSectionWrapper> lock_;
|
||||
rtc::scoped_ptr<ThreadWrapper> thread_;
|
||||
rtc::scoped_ptr<ModuleFileUtility> file_utility_;
|
||||
|
@ -65,7 +65,7 @@ FrameGeneratorCapturer::FrameGeneratorCapturer(Clock* clock,
|
||||
: VideoCapturer(input),
|
||||
clock_(clock),
|
||||
sending_(false),
|
||||
tick_(EventTimerWrapper::Create()),
|
||||
tick_(EventWrapper::Create()),
|
||||
lock_(CriticalSectionWrapper::CreateCriticalSection()),
|
||||
frame_generator_(frame_generator),
|
||||
target_fps_(target_fps),
|
||||
|
@ -19,7 +19,7 @@
|
||||
namespace webrtc {
|
||||
|
||||
class CriticalSectionWrapper;
|
||||
class EventTimerWrapper;
|
||||
class EventWrapper;
|
||||
class ThreadWrapper;
|
||||
|
||||
namespace test {
|
||||
@ -60,7 +60,7 @@ class FrameGeneratorCapturer : public VideoCapturer {
|
||||
Clock* const clock_;
|
||||
bool sending_;
|
||||
|
||||
rtc::scoped_ptr<EventTimerWrapper> tick_;
|
||||
rtc::scoped_ptr<EventWrapper> tick_;
|
||||
rtc::scoped_ptr<CriticalSectionWrapper> lock_;
|
||||
rtc::scoped_ptr<ThreadWrapper> thread_;
|
||||
rtc::scoped_ptr<FrameGenerator> frame_generator_;
|
||||
|
Loading…
x
Reference in New Issue
Block a user