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

Side by Side Diff: talk/media/webrtc/webrtcvideocapturer.cc

Issue 1241973002: Use std::string references instead of copying contents. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fix use-after-free Created 5 years, 5 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
« no previous file with comments | « talk/app/webrtc/webrtcsdp.cc ('k') | talk/media/webrtc/webrtcvideoengine2.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 << best_format->ToString(); 258 << best_format->ToString();
259 } 259 }
260 return true; 260 return true;
261 } 261 }
262 bool WebRtcVideoCapturer::SetApplyRotation(bool enable) { 262 bool WebRtcVideoCapturer::SetApplyRotation(bool enable) {
263 // Can't take lock here as this will cause deadlock with 263 // Can't take lock here as this will cause deadlock with
264 // OnIncomingCapturedFrame. In fact, the whole method, including methods it 264 // OnIncomingCapturedFrame. In fact, the whole method, including methods it
265 // calls, can't take lock. 265 // calls, can't take lock.
266 DCHECK(module_); 266 DCHECK(module_);
267 267
268 const std::string group_name = 268 const std::string& group_name =
269 webrtc::field_trial::FindFullName("WebRTC-CVO"); 269 webrtc::field_trial::FindFullName("WebRTC-CVO");
270 270
271 if (group_name == "Disabled") { 271 if (group_name == "Disabled") {
272 return true; 272 return true;
273 } 273 }
274 274
275 if (!VideoCapturer::SetApplyRotation(enable)) { 275 if (!VideoCapturer::SetApplyRotation(enable)) {
276 return false; 276 return false;
277 } 277 }
278 return module_->SetApplyRotation(enable); 278 return module_->SetApplyRotation(enable);
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 elapsed_time = sample.render_time_ms() * rtc::kNumNanosecsPerMillisec; 437 elapsed_time = sample.render_time_ms() * rtc::kNumNanosecsPerMillisec;
438 time_stamp = elapsed_time; 438 time_stamp = elapsed_time;
439 data_size = rtc::checked_cast<uint32>(length); 439 data_size = rtc::checked_cast<uint32>(length);
440 data = buffer; 440 data = buffer;
441 rotation = sample.rotation(); 441 rotation = sample.rotation();
442 } 442 }
443 443
444 } // namespace cricket 444 } // namespace cricket
445 445
446 #endif // HAVE_WEBRTC_VIDEO 446 #endif // HAVE_WEBRTC_VIDEO
OLDNEW
« no previous file with comments | « talk/app/webrtc/webrtcsdp.cc ('k') | talk/media/webrtc/webrtcvideoengine2.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698