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

Unified Diff: ppapi/shared_impl/ppb_video_capture_shared.h

Issue 11274036: Refactor video capture to new design (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 2 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: ppapi/shared_impl/ppb_video_capture_shared.h
diff --git a/ppapi/shared_impl/ppb_video_capture_shared.h b/ppapi/shared_impl/ppb_video_capture_shared.h
index 80b29fe970424f5e39c3aa3bd841e6bba16f8e9b..65d0a0ee642892e45bb2b1fd5c6ac320a7b68a96 100644
--- a/ppapi/shared_impl/ppb_video_capture_shared.h
+++ b/ppapi/shared_impl/ppb_video_capture_shared.h
@@ -7,45 +7,21 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
-#include "base/memory/ref_counted.h"
+#include "ppapi/c/dev/pp_video_capture_dev.h"
#include "ppapi/shared_impl/ppapi_shared_export.h"
-#include "ppapi/shared_impl/resource.h"
-#include "ppapi/shared_impl/tracked_callback.h"
-#include "ppapi/thunk/ppb_video_capture_api.h"
namespace ppapi {
-class PPAPI_SHARED_EXPORT PPB_VideoCapture_Shared
- : public Resource,
- NON_EXPORTED_BASE(public thunk::PPB_VideoCapture_API) {
+class PPAPI_SHARED_EXPORT PPB_VideoCapture_Shared {
yzshen1 2012/10/25 20:41:05 I think this class is not very useful now. All it
victorhsieh 2012/10/26 02:34:54 The resource still uses open_state_ indirectly. F
yzshen1 2012/10/29 18:34:23 The reason why we needed the state machine on both
victorhsieh 2012/10/30 09:43:28 Done. Removed everything of 0.1 from IDL, api, th
victorhsieh 2012/11/02 04:28:47 Oops, I guess I missed this comment. The code is
public:
- explicit PPB_VideoCapture_Shared(PP_Instance instance);
- explicit PPB_VideoCapture_Shared(const HostResource& host_resource);
+ PPB_VideoCapture_Shared();
virtual ~PPB_VideoCapture_Shared();
- // Resource implementation.
- virtual thunk::PPB_VideoCapture_API* AsPPB_VideoCapture_API() OVERRIDE;
-
- // PPB_VideoCapture_API implementation.
- virtual int32_t EnumerateDevices(
- PP_Resource* devices,
- scoped_refptr<TrackedCallback> callback) OVERRIDE;
- virtual int32_t Open(const std::string& device_id,
- const PP_VideoCaptureDeviceInfo_Dev& requested_info,
- uint32_t buffer_count,
- scoped_refptr<TrackedCallback> callback) OVERRIDE;
virtual int32_t StartCapture() OVERRIDE;
- virtual int32_t ReuseBuffer(uint32_t buffer) OVERRIDE;
virtual int32_t StopCapture() OVERRIDE;
- virtual void Close() OVERRIDE;
virtual int32_t StartCapture0_1(
const PP_VideoCaptureDeviceInfo_Dev& requested_info,
uint32_t buffer_count) OVERRIDE;
- virtual const std::vector<DeviceRefData>& GetDeviceRefData() const OVERRIDE;
-
- void OnEnumerateDevicesComplete(int32_t result,
- const std::vector<DeviceRefData>& devices);
- void OnOpenComplete(int32_t result);
protected:
enum OpenState {
@@ -56,23 +32,11 @@ class PPAPI_SHARED_EXPORT PPB_VideoCapture_Shared
// Subclasses should implement these methods to do impl- and proxy-specific
// work.
- virtual int32_t InternalEnumerateDevices(
- PP_Resource* devices,
- scoped_refptr<TrackedCallback> callback) = 0;
- virtual int32_t InternalOpen(
- const std::string& device_id,
- const PP_VideoCaptureDeviceInfo_Dev& requested_info,
- uint32_t buffer_count,
- scoped_refptr<TrackedCallback> callback) = 0;
virtual int32_t InternalStartCapture() = 0;
- virtual int32_t InternalReuseBuffer(uint32_t buffer) = 0;
virtual int32_t InternalStopCapture() = 0;
- virtual void InternalClose() = 0;
virtual int32_t InternalStartCapture0_1(
const PP_VideoCaptureDeviceInfo_Dev& requested_info,
uint32_t buffer_count) = 0;
- virtual const std::vector<DeviceRefData>& InternalGetDeviceRefData(
- ) const = 0;
// Checks whether |status| is expected and sets |status_| if yes. If |forced|
// is set to true, this method will bypass sanity check and always set
@@ -82,15 +46,6 @@ class PPAPI_SHARED_EXPORT PPB_VideoCapture_Shared
OpenState open_state_;
PP_VideoCaptureStatus_Dev status_;
- scoped_refptr<TrackedCallback> enumerate_devices_callback_;
- scoped_refptr<TrackedCallback> open_callback_;
-
- // Output parameter of EnumerateDevices(). It should not be accessed after
- // |enumerate_devices_callback_| is run.
- PP_Resource* devices_;
-
- ResourceObjectType resource_object_type_;
-
private:
DISALLOW_COPY_AND_ASSIGN(PPB_VideoCapture_Shared);
};

Powered by Google App Engine
This is Rietveld 408576698