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

Side by Side Diff: webrtc/api/androidvideocapturer.cc

Issue 1987663002: android: Don't do a thread jump for incoming frames. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Delete VideoBroadcaster thread checker Created 4 years, 7 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2015 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 if (new_state == current_state_) 173 if (new_state == current_state_)
174 return; 174 return;
175 current_state_ = new_state; 175 current_state_ = new_state;
176 SetCaptureState(new_state); 176 SetCaptureState(new_state);
177 } 177 }
178 178
179 void AndroidVideoCapturer::OnIncomingFrame( 179 void AndroidVideoCapturer::OnIncomingFrame(
180 const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& buffer, 180 const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& buffer,
181 int rotation, 181 int rotation,
182 int64_t time_stamp) { 182 int64_t time_stamp) {
183 RTC_CHECK(thread_checker_.CalledOnValidThread()); 183 // NOTE: Calls to this method may come on any thread, but they are
magjed_webrtc 2016/05/18 15:12:50 They come from the Java thread. It's the same thre
nisse-webrtc 2016/05/18 15:31:31 Should be ok, then. Would it make sense with a thr
184 // syncronized by the caller, using
185 // AndroidVideoCapturerJni:capturer_lock_.
184 frame_factory_->UpdateCapturedFrame(buffer, rotation, time_stamp); 186 frame_factory_->UpdateCapturedFrame(buffer, rotation, time_stamp);
185 SignalFrameCaptured(this, frame_factory_->GetCapturedFrame()); 187 SignalFrameCaptured(this, frame_factory_->GetCapturedFrame());
186 frame_factory_->ClearCapturedFrame(); 188 frame_factory_->ClearCapturedFrame();
187 } 189 }
188 190
189 void AndroidVideoCapturer::OnOutputFormatRequest( 191 void AndroidVideoCapturer::OnOutputFormatRequest(
190 int width, int height, int fps) { 192 int width, int height, int fps) {
191 RTC_CHECK(thread_checker_.CalledOnValidThread()); 193 RTC_CHECK(thread_checker_.CalledOnValidThread());
192 cricket::VideoFormat format(width, height, 194 cricket::VideoFormat format(width, height,
193 cricket::VideoFormat::FpsToInterval(fps), 0); 195 cricket::VideoFormat::FpsToInterval(fps), 0);
194 video_adapter()->OnOutputFormatRequest(format); 196 video_adapter()->OnOutputFormatRequest(format);
195 } 197 }
196 198
197 bool AndroidVideoCapturer::GetBestCaptureFormat( 199 bool AndroidVideoCapturer::GetBestCaptureFormat(
198 const cricket::VideoFormat& desired, 200 const cricket::VideoFormat& desired,
199 cricket::VideoFormat* best_format) { 201 cricket::VideoFormat* best_format) {
200 // Delegate this choice to VideoCapturer.startCapture(). 202 // Delegate this choice to VideoCapturer.startCapture().
201 *best_format = desired; 203 *best_format = desired;
202 return true; 204 return true;
203 } 205 }
204 206
205 } // namespace webrtc 207 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/api/java/jni/androidvideocapturer_jni.cc » ('j') | webrtc/api/java/jni/androidvideocapturer_jni.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698