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

Unified Diff: ppapi/api/private/ppb_image_capture_private.idl

Issue 391323002: Pepper: add Image Capture interfaces. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: move to private, add PPP_ImageCapture, and address comments Created 6 years, 5 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/api/private/ppb_image_capture_private.idl
diff --git a/ppapi/api/private/ppb_image_capture_private.idl b/ppapi/api/private/ppb_image_capture_private.idl
new file mode 100644
index 0000000000000000000000000000000000000000..c91e68d713b11ed179df35ed87c968f4a0295595
--- /dev/null
+++ b/ppapi/api/private/ppb_image_capture_private.idl
@@ -0,0 +1,128 @@
+/* Copyright 2014 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.
+ */
+
+/**
+ * Defines the <code>PPB_ImageCapture_Private</code> interface. Used for taking
+ * a picture from a camera source.
+ */
+
+[generate_thunk]
+
+label Chrome {
+ M39 = 0.1
+};
+
+/**
+ * See PPP_ImageCapture_Private for the notifications the camera may send the
+ * plugin.
+ */
+interface PPB_ImageCapture_Private {
+ /**
+ * Creates a PPB_ImageCapture_Private resource.
+ *
+ * @param[in] camera_source_id A <code>PP_Var</code> identifying a camera
+ * source. The type is string. The ID can be obtained from
+ * MediaStreamTrack.getSources() or MediaStreamVideoTrack.id. If a
+ * MediaStreamVideoTrack is associated with the same source and the track
+ * is closed, it will not affect this PPB_ImageCapture_Private object.
Pawel Osciak 2014/08/03 08:34:38 What does it mean it will not affect? If we close
wuchengli 2014/08/06 08:14:58 Yes. I updated the comments.
+ *
+ * @return A <code>PP_Resource</code> corresponding to a
+ * PPB_ImageCapture_Private resource if successful, 0 if failed.
Justin Chuang 2014/08/03 09:45:45 Seems all other PPAPI has a [in] PP_Instance insta
Justin Chuang 2014/08/03 10:46:45 Can see PPB_AudioConfig as an example. Its CreateX
wuchengli 2014/08/06 08:14:58 You are right. Added PP_Instance.
+ */
+ PP_Resource Create([in] PP_Var camera_source_id);
+
+ /**
+ * Determines if a resource is an image capture resource.
+ *
+ * @param[in] resource The <code>PP_Resource</code> to test.
+ *
+ * @return A <code>PP_Bool</code> with <code>PP_TRUE</code> if the given
+ * resource is an image capture resource or <code>PP_FALSE</code>
+ * otherwise.
+ */
+ PP_Bool IsImageCapture([in] PP_Resource resource);
+
+ /**
+ * Sets the configuration of the image capture.
+ * If <code>SetConfig()</code> is not called, default settings will be used.
+ *
+ * @param[in] image_capture A <code>PP_Resource</code> corresponding to an
+ * image capture resource.
+ * @param[in] config A <code>PP_ImageCaptureConfig</code> object.
+ * @param[in] callback <code>PP_CompletionCallback</code> to be called upon
+ * completion of <code>SetConfig()</code>.
+ *
+ * @return An int32_t containing a result code from <code>pp_errors.h</code>.
+ * Returns <code>PP_ERROR_INPROGRESS</code> if there is a pending call of
+ * <code>SetConfig()</code> or <code>TakePhoto()</code>.
+ * If an error is returned, all configuration will not be changed.
+ */
+ int32_t SetConfig([in] PP_Resource image_capture,
+ [in] PP_Resource config,
+ [in] PP_CompletionCallback callback);
+
+ /**
+ * Gets the configuration of the image capture.
+ *
+ * @param[in] image_capture A <code>PP_Resource</code> corresponding to an
+ * image capture resource.
+ * @param[out] config A <code>PP_ImageCaptureConfig</code> for storing the
+ * current image capture config on success. Otherwise, the values will not be
+ * changed.
+ * @param[in] callback <code>PP_CompletionCallback</code> to be called upon
+ * completion of <code>GetConfig()</code>.
+ *
+ * @return An int32_t containing a result code from <code>pp_errors.h</code>.
+ */
+ int32_t GetConfig([in] PP_Resource image_capture,
+ [out] PP_Resource config,
+ [in] PP_CompletionCallback callback);
+
+ /**
+ * Gets the image capture capabilities of the camera.
+ *
+ * @param[in] image_capture A <code>PP_Resource</code> corresponding to an
+ * image capture resource.
+ * @param[out] capabilities A <code>PPB_CameraCapabilities</code> for
+ * storing the image capture capabilities on success. Otherwise, the value
+ * will not be changed.
+ * @param[in] callback <code>PP_CompletionCallback</code> to be called upon
+ * completion of <code>GetCapabilities()</code>.
+ *
+ * @return An int32_t containing a result code from <code>pp_errors.h</code>.
+ */
+ int32_t GetCapabilities([in] PP_Resource image_capture,
+ [out] PP_Resource capabilities,
+ [in] PP_CompletionCallback callback);
+
+ /**
+ * Takes a Jpeg photo from the camera.
+ *
+ * Triggers an asynchronous image capture. The camera will initiate a series
+ * of callbacks to the application as the image capture progresses. The
+ * callbacks in order are PPP_ImageCapture_Private.OnShutter,
+ * OnPostviewPicture, and OnJpegPictureReady. The shutter callback occurs
+ * after the image is captured. This can be used to trigger a sound to let
+ * the user know that image has been captured. The postview callback occurs
+ * when a scaled, fully processed postview image is available. The jpeg
+ * callback occurs when the compressed image is available.
+ *
+ * The camera may need to stop and re-start the streaming during image
+ * capture. If some MediaStreamVideoTrack are associated with the camera
+ * source, they will receive mute and unmute events.
+ *
+ * @param[in] image_capture A <code>PP_Resource</code> corresponding to an
+ * image capture resource.
+ * @param[inout] sequence_id The sequence ID is a unique monotonically
+ * increasing value starting from 0, incremented every time a new request like
+ * image capture or autofocus is submitted.
Pawel Osciak 2014/08/03 08:34:38 Why is it inout? Can implementation change it? If
wuchengli 2014/08/06 08:14:58 Fixed. This should be out.
+ *
+ * @return An int32_t containing a result code from <code>pp_errors.h</code>.
+ * PP_OK means the callbacks will be triggered. Other values mean the
+ * callbacks will not be triggered.
+ */
+ int32_t TakePhoto([in] PP_Resource image_capture,
+ [inout] int64_t sequence_id);
Justin Chuang 2014/08/03 11:12:47 Need a Close() method here.
+};

Powered by Google App Engine
This is Rietveld 408576698