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

Side by Side Diff: media/video/capture/linux/video_capture_device_linux.cc

Issue 15906019: Hook up EncodedVideoSource on the browser side (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@screencast_cl_6
Patch Set: 516738a8 IPC/struct changes, courtesy hshi@ Created 7 years, 6 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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/video/capture/linux/video_capture_device_linux.h" 5 #include "media/video/capture/linux/video_capture_device_linux.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <fcntl.h> 8 #include <fcntl.h>
9 #if defined(OS_OPENBSD) 9 #if defined(OS_OPENBSD)
10 #include <sys/videoio.h> 10 #include <sys/videoio.h>
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 // Check if the thread is running. 166 // Check if the thread is running.
167 // This means that the device have not been DeAllocated properly. 167 // This means that the device have not been DeAllocated properly.
168 DCHECK(!v4l2_thread_.IsRunning()); 168 DCHECK(!v4l2_thread_.IsRunning());
169 169
170 v4l2_thread_.Stop(); 170 v4l2_thread_.Stop();
171 if (device_fd_ >= 0) { 171 if (device_fd_ >= 0) {
172 close(device_fd_); 172 close(device_fd_);
173 } 173 }
174 } 174 }
175 175
176 VideoEncodingCapabilities VideoCaptureDeviceLinux::GetEncodingCapabilities() {
177 return VideoEncodingCapabilities();
178 }
179
180 void VideoCaptureDeviceLinux::TryConfigureEncodedBitstream(
181 const RuntimeVideoEncodingParameters& params) {
182 }
183
176 void VideoCaptureDeviceLinux::Allocate(int width, 184 void VideoCaptureDeviceLinux::Allocate(int width,
177 int height, 185 int height,
178 int frame_rate, 186 int frame_rate,
179 EventHandler* observer) { 187 EventHandler* observer) {
180 if (v4l2_thread_.IsRunning()) { 188 if (v4l2_thread_.IsRunning()) {
181 return; // Wrong state. 189 return; // Wrong state.
182 } 190 }
183 v4l2_thread_.Start(); 191 v4l2_thread_.Start();
184 v4l2_thread_.message_loop()->PostTask( 192 v4l2_thread_.message_loop()->PostTask(
185 FROM_HERE, 193 FROM_HERE,
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 buffer_pool_size_ = 0; 541 buffer_pool_size_ = 0;
534 } 542 }
535 543
536 void VideoCaptureDeviceLinux::SetErrorState(const std::string& reason) { 544 void VideoCaptureDeviceLinux::SetErrorState(const std::string& reason) {
537 DVLOG(1) << reason; 545 DVLOG(1) << reason;
538 state_ = kError; 546 state_ = kError;
539 observer_->OnError(); 547 observer_->OnError();
540 } 548 }
541 549
542 } // namespace media 550 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698