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

Unified Diff: talk/app/webrtc/androidvideocapturer.cc

Issue 1308953004: AndroidVideoCapturer: Delegate framerate choice to VideoCapturerAndroid.java (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: return true Created 5 years, 4 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
Index: talk/app/webrtc/androidvideocapturer.cc
diff --git a/talk/app/webrtc/androidvideocapturer.cc b/talk/app/webrtc/androidvideocapturer.cc
index e2270228227750027ab5e59e3438a63af786c795..cc7821760c9edaeb4a35d95811e2b143c88a391c 100644
--- a/talk/app/webrtc/androidvideocapturer.cc
+++ b/talk/app/webrtc/androidvideocapturer.cc
@@ -137,18 +137,17 @@ AndroidVideoCapturer::~AndroidVideoCapturer() {
cricket::CaptureState AndroidVideoCapturer::Start(
const cricket::VideoFormat& capture_format) {
- LOG(LS_INFO) << " AndroidVideoCapturer::Start w = " << capture_format.width
- << " h = " << capture_format.height;
CHECK(thread_checker_.CalledOnValidThread());
CHECK(!running_);
+ const int fps = cricket::VideoFormat::IntervalToFps(capture_format.interval);
+ LOG(LS_INFO) << " AndroidVideoCapturer::Start " << capture_format.width << "x"
+ << capture_format.height << "@" << fps;
frame_factory_ = new AndroidVideoCapturer::FrameFactory(delegate_.get());
set_frame_factory(frame_factory_);
running_ = true;
- delegate_->Start(
- capture_format.width, capture_format.height,
- cricket::VideoFormat::IntervalToFps(capture_format.interval), this);
+ delegate_->Start(capture_format.width, capture_format.height, fps, this);
SetCaptureFormat(&capture_format);
current_state_ = cricket::CS_STARTING;
return current_state_;
@@ -210,4 +209,12 @@ void AndroidVideoCapturer::OnOutputFormatRequest(
video_adapter()->OnOutputFormatRequest(format);
}
+bool AndroidVideoCapturer::GetBestCaptureFormat(
+ const cricket::VideoFormat& desired,
+ cricket::VideoFormat* best_format) {
+ // Delegate this choice to VideoCapturerAndroid.startCapture().
+ *best_format = desired;
+ return true;
+}
+
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698