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

Side by Side Diff: webrtc/modules/video_capture/linux/video_capture_linux.cc

Issue 1476453002: Clean up PlatformThread. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: IsRunning DCHECK Created 5 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 if (!AllocateVideoBuffers()) 273 if (!AllocateVideoBuffers())
274 { 274 {
275 WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, _id, 275 WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, _id,
276 "failed to allocate video capture buffers"); 276 "failed to allocate video capture buffers");
277 return -1; 277 return -1;
278 } 278 }
279 279
280 //start capture thread; 280 //start capture thread;
281 if (!_captureThread) 281 if (!_captureThread)
282 { 282 {
283 _captureThread = PlatformThread::CreateThread( 283 _captureThread.reset(new rtc::PlatformThread(
284 VideoCaptureModuleV4L2::CaptureThread, this, "CaptureThread"); 284 VideoCaptureModuleV4L2::CaptureThread, this, "CaptureThread"));
285 _captureThread->Start(); 285 _captureThread->Start();
286 _captureThread->SetPriority(kHighPriority); 286 _captureThread->SetPriority(rtc::kHighPriority);
287 } 287 }
288 288
289 // Needed to start UVC camera - from the uvcview application 289 // Needed to start UVC camera - from the uvcview application
290 enum v4l2_buf_type type; 290 enum v4l2_buf_type type;
291 type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 291 type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
292 if (ioctl(_deviceFd, VIDIOC_STREAMON, &type) == -1) 292 if (ioctl(_deviceFd, VIDIOC_STREAMON, &type) == -1)
293 { 293 {
294 WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, _id, 294 WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, _id,
295 "Failed to turn on stream"); 295 "Failed to turn on stream");
296 return -1; 296 return -1;
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 { 483 {
484 settings.width = _currentWidth; 484 settings.width = _currentWidth;
485 settings.height = _currentHeight; 485 settings.height = _currentHeight;
486 settings.maxFPS = _currentFrameRate; 486 settings.maxFPS = _currentFrameRate;
487 settings.rawType=_captureVideoType; 487 settings.rawType=_captureVideoType;
488 488
489 return 0; 489 return 0;
490 } 490 }
491 } // namespace videocapturemodule 491 } // namespace videocapturemodule
492 } // namespace webrtc 492 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698