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

Unified Diff: media/video/capture/linux/video_capture_device_linux.h

Issue 25388002: Eliminates the use of VideoCaptureDevice1 in VideoCaptureDeviceLinux. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: media/video/capture/linux/video_capture_device_linux.h
diff --git a/media/video/capture/linux/video_capture_device_linux.h b/media/video/capture/linux/video_capture_device_linux.h
index e06804f90c644f800126c0172bffc6d1a7729d84..f019af15fcccefcdf7bed7b2db6e003b2913e461 100644
--- a/media/video/capture/linux/video_capture_device_linux.h
+++ b/media/video/capture/linux/video_capture_device_linux.h
@@ -18,23 +18,20 @@
namespace media {
-class VideoCaptureDeviceLinux : public VideoCaptureDevice1 {
+class VideoCaptureDeviceLinux : public VideoCaptureDevice {
public:
explicit VideoCaptureDeviceLinux(const Name& device_name);
virtual ~VideoCaptureDeviceLinux();
// VideoCaptureDevice implementation.
- virtual void Allocate(const VideoCaptureCapability& capture_format,
- VideoCaptureDevice::Client* client) OVERRIDE;
- virtual void Start() OVERRIDE;
- virtual void Stop() OVERRIDE;
- virtual void DeAllocate() OVERRIDE;
- virtual const Name& device_name() OVERRIDE;
+ virtual void AllocateAndStart(const VideoCaptureCapability& capture_format,
+ scoped_ptr<Client> client) OVERRIDE;
+
+ virtual void StopAndDeAllocate() OVERRIDE;
private:
enum InternalState {
kIdle, // The device driver is opened but camera is not in use.
- kAllocated, // The camera has been allocated and can be started.
kCapturing, // Video is being captured.
kError // Error accessing HW functions.
// User needs to recover by destroying the object.
@@ -48,13 +45,11 @@ class VideoCaptureDeviceLinux : public VideoCaptureDevice1 {
};
// Called on the v4l2_thread_.
- void OnAllocate(int width,
- int height,
- int frame_rate,
- VideoCaptureDevice::Client* client);
- void OnStart();
- void OnStop();
- void OnDeAllocate();
+ void OnAllocateAndStart(int width,
+ int height,
+ int frame_rate,
+ scoped_ptr<Client> client);
+ void OnStopAndDeAllocate();
void OnCaptureTask();
bool AllocateVideoBuffers();
@@ -62,7 +57,7 @@ class VideoCaptureDeviceLinux : public VideoCaptureDevice1 {
void SetErrorState(const std::string& reason);
InternalState state_;
- VideoCaptureDevice::Client* client_;
+ scoped_ptr<VideoCaptureDevice::Client> client_;
Name device_name_;
int device_fd_; // File descriptor for the opened camera device.
base::Thread v4l2_thread_; // Thread used for reading data from the device.

Powered by Google App Engine
This is Rietveld 408576698