Home | History | Annotate | Download | only in dev
      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
      3 // found in the LICENSE file.
      4 
      5 #ifndef PPAPI_CPP_DEV_VIDEO_CAPTURE_DEV_H_
      6 #define PPAPI_CPP_DEV_VIDEO_CAPTURE_DEV_H_
      7 
      8 #include <vector>
      9 
     10 #include "ppapi/c/dev/pp_video_capture_dev.h"
     11 #include "ppapi/cpp/completion_callback.h"
     12 #include "ppapi/cpp/dev/device_ref_dev.h"
     13 #include "ppapi/cpp/resource.h"
     14 
     15 namespace pp {
     16 
     17 class InstanceHandle;
     18 
     19 class VideoCapture_Dev : public Resource {
     20  public:
     21   explicit VideoCapture_Dev(const InstanceHandle& instance);
     22   VideoCapture_Dev(PP_Resource resource);
     23 
     24   virtual ~VideoCapture_Dev();
     25 
     26   // Returns true if the required interface is available.
     27   static bool IsAvailable();
     28 
     29   int32_t EnumerateDevices(
     30       const CompletionCallbackWithOutput<std::vector<DeviceRef_Dev> >&
     31           callback);
     32   int32_t MonitorDeviceChange(PP_MonitorDeviceChangeCallback callback,
     33                               void* user_data);
     34   int32_t Open(const DeviceRef_Dev& device_ref,
     35                const PP_VideoCaptureDeviceInfo_Dev& requested_info,
     36                uint32_t buffer_count,
     37                const CompletionCallback& callback);
     38   int32_t StartCapture();
     39   int32_t ReuseBuffer(uint32_t buffer);
     40   int32_t StopCapture();
     41   void Close();
     42 };
     43 
     44 }  // namespace pp
     45 
     46 #endif  // PPAPI_CPP_DEV_VIDEO_CAPTURE_DEV_H_
     47