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

Unified Diff: ppapi/cpp/dev/video_capture_dev.h

Issue 9234064: Implement device enumeration for PPB_VideoCapture_Dev. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 10 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
« no previous file with comments | « ppapi/c/dev/ppb_video_capture_dev.h ('k') | ppapi/cpp/dev/video_capture_dev.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/cpp/dev/video_capture_dev.h
diff --git a/ppapi/cpp/dev/video_capture_dev.h b/ppapi/cpp/dev/video_capture_dev.h
index 16c9d2bf5a0beec26d0386d01919fc84e45bc3e2..1760cf745cf7ea19f45f8825472e978d442f0b9a 100644
--- a/ppapi/cpp/dev/video_capture_dev.h
+++ b/ppapi/cpp/dev/video_capture_dev.h
@@ -1,15 +1,19 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef PPAPI_CPP_DEV_VIDEO_CAPTURE_DEV_H_
#define PPAPI_CPP_DEV_VIDEO_CAPTURE_DEV_H_
+#include <vector>
+
#include "ppapi/c/dev/pp_video_capture_dev.h"
#include "ppapi/cpp/resource.h"
namespace pp {
+class CompletionCallback;
+class DeviceRef_Dev;
class Instance;
class VideoCapture_Dev : public Resource {
@@ -18,13 +22,37 @@ class VideoCapture_Dev : public Resource {
VideoCapture_Dev(PP_Resource resource);
VideoCapture_Dev(const VideoCapture_Dev& other);
+ virtual ~VideoCapture_Dev();
+
+ VideoCapture_Dev& operator=(const VideoCapture_Dev& other);
+
// Returns true if the required interface is available.
static bool IsAvailable();
- int32_t StartCapture(const PP_VideoCaptureDeviceInfo_Dev& requested_info,
- uint32_t buffer_count);
+ // |devices| must stay alive until either this VideoCapture_Dev object goes
+ // away or |callback| is run.
+ int32_t EnumerateDevices(std::vector<DeviceRef_Dev>* devices,
+ const CompletionCallback& callback);
+ int32_t Open(const DeviceRef_Dev& device_ref,
+ const PP_VideoCaptureDeviceInfo_Dev& requested_info,
+ uint32_t buffer_count,
+ const CompletionCallback& callback);
+ int32_t StartCapture();
int32_t ReuseBuffer(uint32_t buffer);
int32_t StopCapture();
+ void Close();
+
+ private:
+ struct EnumerateDevicesState;
+
+ void AbortEnumerateDevices();
+
+ // |user_data| is an EnumerateDevicesState object. It is this method's
+ // responsibility to delete it.
+ static void OnEnumerateDevicesComplete(void* user_data, int32_t result);
+
+ // Not owned by this object.
+ EnumerateDevicesState* enum_state_;
};
} // namespace pp
« no previous file with comments | « ppapi/c/dev/ppb_video_capture_dev.h ('k') | ppapi/cpp/dev/video_capture_dev.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698