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

Side by Side Diff: talk/app/webrtc/androidvideocapturer.cc

Issue 1414703002: passing |buffer| by reference in AndroidVideoCapturer::OnIncomingFrame (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: fix for formatting Created 5 years, 2 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 * libjingle 2 * libjingle
3 * Copyright 2015 Google Inc. 3 * Copyright 2015 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 return; 204 return;
205 current_state_ = new_state; 205 current_state_ = new_state;
206 206
207 // TODO(perkj): SetCaptureState can not be used since it posts to |thread_|. 207 // TODO(perkj): SetCaptureState can not be used since it posts to |thread_|.
208 // But |thread_ | is currently just the thread that happened to create the 208 // But |thread_ | is currently just the thread that happened to create the
209 // cricket::VideoCapturer. 209 // cricket::VideoCapturer.
210 SignalStateChange(this, new_state); 210 SignalStateChange(this, new_state);
211 } 211 }
212 212
213 void AndroidVideoCapturer::OnIncomingFrame( 213 void AndroidVideoCapturer::OnIncomingFrame(
214 rtc::scoped_refptr<webrtc::VideoFrameBuffer> buffer, 214 const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& buffer,
215 int rotation, 215 int rotation,
216 int64_t time_stamp) { 216 int64_t time_stamp) {
217 RTC_CHECK(thread_checker_.CalledOnValidThread()); 217 RTC_CHECK(thread_checker_.CalledOnValidThread());
218 frame_factory_->UpdateCapturedFrame(buffer, rotation, time_stamp); 218 frame_factory_->UpdateCapturedFrame(buffer, rotation, time_stamp);
219 SignalFrameCaptured(this, frame_factory_->GetCapturedFrame()); 219 SignalFrameCaptured(this, frame_factory_->GetCapturedFrame());
220 frame_factory_->ClearCapturedFrame(); 220 frame_factory_->ClearCapturedFrame();
221 } 221 }
222 222
223 void AndroidVideoCapturer::OnOutputFormatRequest( 223 void AndroidVideoCapturer::OnOutputFormatRequest(
224 int width, int height, int fps) { 224 int width, int height, int fps) {
225 RTC_CHECK(thread_checker_.CalledOnValidThread()); 225 RTC_CHECK(thread_checker_.CalledOnValidThread());
226 const cricket::VideoFormat& current = video_adapter()->output_format(); 226 const cricket::VideoFormat& current = video_adapter()->output_format();
227 cricket::VideoFormat format( 227 cricket::VideoFormat format(
228 width, height, cricket::VideoFormat::FpsToInterval(fps), current.fourcc); 228 width, height, cricket::VideoFormat::FpsToInterval(fps), current.fourcc);
229 video_adapter()->OnOutputFormatRequest(format); 229 video_adapter()->OnOutputFormatRequest(format);
230 } 230 }
231 231
232 bool AndroidVideoCapturer::GetBestCaptureFormat( 232 bool AndroidVideoCapturer::GetBestCaptureFormat(
233 const cricket::VideoFormat& desired, 233 const cricket::VideoFormat& desired,
234 cricket::VideoFormat* best_format) { 234 cricket::VideoFormat* best_format) {
235 // Delegate this choice to VideoCapturerAndroid.startCapture(). 235 // Delegate this choice to VideoCapturerAndroid.startCapture().
236 *best_format = desired; 236 *best_format = desired;
237 return true; 237 return true;
238 } 238 }
239 239
240 } // namespace webrtc 240 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698