Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1068)

Unified Diff: webrtc/test/vcm_capturer.cc

Issue 2764133002: Revert of Add framerate to VideoSinkWants and ability to signal on overuse (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/test/vcm_capturer.h ('k') | webrtc/test/video_capturer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/test/vcm_capturer.cc
diff --git a/webrtc/test/vcm_capturer.cc b/webrtc/test/vcm_capturer.cc
index d66cf232ff6d9fc83582a88117589ef7911f77c9..535e9bf219db24f370bd547e4d617eb8df724c1d 100644
--- a/webrtc/test/vcm_capturer.cc
+++ b/webrtc/test/vcm_capturer.cc
@@ -10,18 +10,17 @@
#include "webrtc/test/vcm_capturer.h"
-#include "webrtc/base/logging.h"
#include "webrtc/modules/video_capture/video_capture_factory.h"
#include "webrtc/video_send_stream.h"
namespace webrtc {
namespace test {
-VcmCapturer::VcmCapturer() : started_(false), sink_(nullptr), vcm_(nullptr) {}
+VcmCapturer::VcmCapturer() : started_(false), sink_(nullptr), vcm_(NULL) {}
bool VcmCapturer::Init(size_t width, size_t height, size_t target_fps) {
- std::unique_ptr<VideoCaptureModule::DeviceInfo> device_info(
- VideoCaptureFactory::CreateDeviceInfo());
+ VideoCaptureModule::DeviceInfo* device_info =
+ VideoCaptureFactory::CreateDeviceInfo();
char device_name[256];
char unique_name[256];
@@ -36,6 +35,7 @@
vcm_->RegisterCaptureDataCallback(this);
device_info->GetCapability(vcm_->CurrentDeviceName(), 0, capability_);
+ delete device_info;
capability_.width = static_cast<int32_t>(width);
capability_.height = static_cast<int32_t>(height);
@@ -47,7 +47,7 @@
return false;
}
- RTC_CHECK(vcm_->CaptureStarted());
+ assert(vcm_->CaptureStarted());
return true;
}
@@ -55,13 +55,13 @@
VcmCapturer* VcmCapturer::Create(size_t width,
size_t height,
size_t target_fps) {
- std::unique_ptr<VcmCapturer> vcm_capturer(new VcmCapturer());
+ VcmCapturer* vcm_capturer = new VcmCapturer();
if (!vcm_capturer->Init(width, height, target_fps)) {
- LOG(LS_WARNING) << "Failed to create VcmCapturer(w = " << width
- << ", h = " << height << ", fps = " << target_fps << ")";
- return nullptr;
+ // TODO(pbos): Log a warning that this failed.
+ delete vcm_capturer;
+ return NULL;
}
- return vcm_capturer.release();
+ return vcm_capturer;
}
@@ -80,7 +80,6 @@
rtc::CritScope lock(&crit_);
RTC_CHECK(!sink_ || sink_ == sink);
sink_ = sink;
- VideoCapturer::AddOrUpdateSink(sink, wants);
}
void VcmCapturer::RemoveSink(rtc::VideoSinkInterface<VideoFrame>* sink) {
@@ -103,11 +102,8 @@
void VcmCapturer::OnFrame(const VideoFrame& frame) {
rtc::CritScope lock(&crit_);
- if (started_ && sink_) {
- rtc::Optional<VideoFrame> out_frame = AdaptFrame(frame);
- if (out_frame)
- sink_->OnFrame(*out_frame);
- }
+ if (started_ && sink_)
+ sink_->OnFrame(frame);
}
} // test
« no previous file with comments | « webrtc/test/vcm_capturer.h ('k') | webrtc/test/video_capturer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698