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

Unified Diff: webrtc/media/engine/webrtcvideocapturer.cc

Issue 2534553002: Replace VideoCaptureDataCallback by VideoSinkInterface. (Closed)
Patch Set: Break overlong lines. Created 4 years 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/media/engine/webrtcvideocapturer.h ('k') | webrtc/media/engine/webrtcvideocapturer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/engine/webrtcvideocapturer.cc
diff --git a/webrtc/media/engine/webrtcvideocapturer.cc b/webrtc/media/engine/webrtcvideocapturer.cc
index 66b167e1cf3d70b9debb88e1ed5f96d6d886072b..044cfcb6d0b81f0f11a8ebe59e1e699d900ca3c7 100644
--- a/webrtc/media/engine/webrtcvideocapturer.cc
+++ b/webrtc/media/engine/webrtcvideocapturer.cc
@@ -47,12 +47,11 @@ static kVideoFourCCEntry kSupportedFourCCs[] = {
class WebRtcVcmFactory : public WebRtcVcmFactoryInterface {
public:
virtual rtc::scoped_refptr<webrtc::VideoCaptureModule> Create(
- int id,
const char* device) {
- return webrtc::VideoCaptureFactory::Create(id, device);
+ return webrtc::VideoCaptureFactory::Create(device);
}
- virtual webrtc::VideoCaptureModule::DeviceInfo* CreateDeviceInfo(int id) {
- return webrtc::VideoCaptureFactory::CreateDeviceInfo(id);
+ virtual webrtc::VideoCaptureModule::DeviceInfo* CreateDeviceInfo() {
+ return webrtc::VideoCaptureFactory::CreateDeviceInfo();
}
virtual void DestroyDeviceInfo(webrtc::VideoCaptureModule::DeviceInfo* info) {
delete info;
@@ -129,7 +128,7 @@ bool WebRtcVideoCapturer::Init(const Device& device) {
return false;
}
- webrtc::VideoCaptureModule::DeviceInfo* info = factory_->CreateDeviceInfo(0);
+ webrtc::VideoCaptureModule::DeviceInfo* info = factory_->CreateDeviceInfo();
if (!info) {
return false;
}
@@ -179,7 +178,7 @@ bool WebRtcVideoCapturer::Init(const Device& device) {
return false;
}
- module_ = factory_->Create(0, vcm_id);
+ module_ = factory_->Create(vcm_id);
if (!module_) {
LOG(LS_ERROR) << "Failed to create capturer for id: " << device.id;
return false;
@@ -273,7 +272,7 @@ CaptureState WebRtcVideoCapturer::Start(const VideoFormat& capture_format) {
}
int64_t start = rtc::TimeMillis();
- module_->RegisterCaptureDataCallback(*this);
+ module_->RegisterCaptureDataCallback(this);
if (module_->StartCapture(cap) != 0) {
LOG(LS_ERROR) << "Camera '" << GetId() << "' failed to start";
module_->DeRegisterCaptureDataCallback();
@@ -337,8 +336,7 @@ bool WebRtcVideoCapturer::GetPreferredFourccs(std::vector<uint32_t>* fourccs) {
return true;
}
-void WebRtcVideoCapturer::OnIncomingCapturedFrame(
- const int32_t id,
+void WebRtcVideoCapturer::OnFrame(
const webrtc::VideoFrame& sample) {
// This can only happen between Start() and Stop().
RTC_DCHECK(start_thread_);
@@ -352,12 +350,7 @@ void WebRtcVideoCapturer::OnIncomingCapturedFrame(
<< ". Expected format " << GetCaptureFormat()->ToString();
}
- OnFrame(sample, sample.width(), sample.height());
-}
-
-void WebRtcVideoCapturer::OnCaptureDelayChanged(const int32_t id,
- const int32_t delay) {
- LOG(LS_INFO) << "Capture delay changed to " << delay << " ms";
+ VideoCapturer::OnFrame(sample, sample.width(), sample.height());
}
} // namespace cricket
« no previous file with comments | « webrtc/media/engine/webrtcvideocapturer.h ('k') | webrtc/media/engine/webrtcvideocapturer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698