aboutsummaryrefslogtreecommitdiff
path: root/webrtc/video/video_capture_input.cc
diff options
context:
space:
mode:
Diffstat (limited to 'webrtc/video/video_capture_input.cc')
-rw-r--r--webrtc/video/video_capture_input.cc34
1 files changed, 15 insertions, 19 deletions
diff --git a/webrtc/video/video_capture_input.cc b/webrtc/video/video_capture_input.cc
index 42bc65f05f..1c5f299291 100644
--- a/webrtc/video/video_capture_input.cc
+++ b/webrtc/video/video_capture_input.cc
@@ -13,18 +13,17 @@
#include "webrtc/base/checks.h"
#include "webrtc/base/logging.h"
#include "webrtc/base/trace_event.h"
-#include "webrtc/modules/interface/module_common_types.h"
-#include "webrtc/modules/utility/interface/process_thread.h"
-#include "webrtc/modules/video_capture/include/video_capture_factory.h"
-#include "webrtc/modules/video_processing/main/interface/video_processing.h"
-#include "webrtc/modules/video_render/include/video_render_defines.h"
+#include "webrtc/modules/include/module_common_types.h"
+#include "webrtc/modules/utility/include/process_thread.h"
+#include "webrtc/modules/video_capture/video_capture_factory.h"
+#include "webrtc/modules/video_processing/include/video_processing.h"
+#include "webrtc/modules/video_render/video_render_defines.h"
#include "webrtc/system_wrappers/include/clock.h"
#include "webrtc/system_wrappers/include/critical_section_wrapper.h"
-#include "webrtc/system_wrappers/include/event_wrapper.h"
#include "webrtc/system_wrappers/include/tick_util.h"
+#include "webrtc/video/overuse_frame_detector.h"
#include "webrtc/video/send_statistics_proxy.h"
-#include "webrtc/video_engine/overuse_frame_detector.h"
-#include "webrtc/video_engine/vie_encoder.h"
+#include "webrtc/video/vie_encoder.h"
namespace webrtc {
@@ -42,10 +41,8 @@ VideoCaptureInput::VideoCaptureInput(
local_renderer_(local_renderer),
stats_proxy_(stats_proxy),
incoming_frame_cs_(CriticalSectionWrapper::CreateCriticalSection()),
- encoder_thread_(ThreadWrapper::CreateThread(EncoderThreadFunction,
- this,
- "EncoderThread")),
- capture_event_(EventWrapper::Create()),
+ encoder_thread_(EncoderThreadFunction, this, "EncoderThread"),
+ capture_event_(false, false),
stop_(0),
last_captured_timestamp_(0),
delta_ntp_internal_ms_(
@@ -56,8 +53,8 @@ VideoCaptureInput::VideoCaptureInput(
overuse_observer,
stats_proxy)),
encoding_time_observer_(encoding_time_observer) {
- encoder_thread_->Start();
- encoder_thread_->SetPriority(kHighPriority);
+ encoder_thread_.Start();
+ encoder_thread_.SetPriority(rtc::kHighPriority);
module_process_thread_->RegisterModule(overuse_detector_.get());
}
@@ -66,8 +63,8 @@ VideoCaptureInput::~VideoCaptureInput() {
// Stop the thread.
rtc::AtomicOps::ReleaseStore(&stop_, 1);
- capture_event_->Set();
- encoder_thread_->Stop();
+ capture_event_.Set();
+ encoder_thread_.Stop();
}
void VideoCaptureInput::IncomingCapturedFrame(const VideoFrame& video_frame) {
@@ -118,7 +115,7 @@ void VideoCaptureInput::IncomingCapturedFrame(const VideoFrame& video_frame) {
TRACE_EVENT_ASYNC_BEGIN1("webrtc", "Video", video_frame.render_time_ms(),
"render_time", video_frame.render_time_ms());
- capture_event_->Set();
+ capture_event_.Set();
}
bool VideoCaptureInput::EncoderThreadFunction(void* obj) {
@@ -128,7 +125,7 @@ bool VideoCaptureInput::EncoderThreadFunction(void* obj) {
bool VideoCaptureInput::EncoderProcess() {
static const int kThreadWaitTimeMs = 100;
int64_t capture_time = -1;
- if (capture_event_->Wait(kThreadWaitTimeMs) == kEventSignaled) {
+ if (capture_event_.Wait(kThreadWaitTimeMs)) {
if (rtc::AtomicOps::AcquireLoad(&stop_))
return false;
@@ -150,7 +147,6 @@ bool VideoCaptureInput::EncoderProcess() {
if (encode_start_time != -1) {
int encode_time_ms = static_cast<int>(
Clock::GetRealTimeClock()->TimeInMilliseconds() - encode_start_time);
- overuse_detector_->FrameEncoded(encode_time_ms);
stats_proxy_->OnEncodedFrame(encode_time_ms);
if (encoding_time_observer_) {
encoding_time_observer_->OnReportEncodedTime(