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

Side by Side Diff: ppapi/api/dev/ppb_video_capture_dev.idl

Issue 9234064: Implement device enumeration for PPB_VideoCapture_Dev. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changes in response to Antoine's comments. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file. 3 * found in the LICENSE file.
4 */ 4 */
5 5
6 /** 6 /**
7 * This file defines the <code>PPB_VideoCapture_Dev</code> interface. 7 * This file defines the <code>PPB_VideoCapture_Dev</code> interface.
8 */ 8 */
9 label Chrome { 9 label Chrome {
10 M14 = 0.1 10 M14 = 0.1,
11 M18 = 0.2
11 }; 12 };
12 13
13 /** 14 /**
14 * Video capture interface. It goes hand-in-hand with PPP_VideoCapture_Dev. 15 * Video capture interface. It goes hand-in-hand with PPP_VideoCapture_Dev.
15 * 16 *
16 * Theory of operation: 17 * Theory of operation:
17 * 1- Create a VideoCapture resource using Create. 18 * 1- Create a VideoCapture resource using Create.
18 * 2- Start the capture using StartCapture. You pass in the requested info 19 * 2- Start the capture using StartCapture. You pass in the requested info
19 * (resolution, frame rate), as well as suggest a number of buffers you will 20 * (resolution, frame rate), as well as suggest a number of buffers you will
20 * need. 21 * need.
(...skipping 24 matching lines...) Expand all
45 /** 46 /**
46 * Returns PP_TRUE if the given resource is a VideoCapture. 47 * Returns PP_TRUE if the given resource is a VideoCapture.
47 */ 48 */
48 PP_Bool IsVideoCapture( 49 PP_Bool IsVideoCapture(
49 [in] PP_Resource video_capture); 50 [in] PP_Resource video_capture);
50 51
51 /** 52 /**
52 * Starts the capture. |requested_info| is a pointer to a structure containing 53 * Starts the capture. |requested_info| is a pointer to a structure containing
53 * the requested resolution and frame rate. |buffer_count| is the number of 54 * the requested resolution and frame rate. |buffer_count| is the number of
54 * buffers requested by the plugin. Note: it is only used as advisory, the 55 * buffers requested by the plugin. Note: it is only used as advisory, the
55 * browser may allocate more of fewer based on available resources. 56 * browser may allocate more or fewer based on available resources.
56 * How many buffers depends on usage. At least 2 to make sure latency doesn't 57 * How many buffers depends on usage. At least 2 to make sure latency doesn't
57 * cause lost frames. If the plugin expects to hold on to more than one buffer 58 * cause lost frames. If the plugin expects to hold on to more than one buffer
58 * at a time (e.g. to do multi-frame processing, like video encoding), it 59 * at a time (e.g. to do multi-frame processing, like video encoding), it
59 * should request that many more. 60 * should request that many more.
60 * 61 *
61 * Returns PP_ERROR_FAILED if called when the capture was already started, or 62 * Returns PP_ERROR_FAILED if called when the capture was already started, or
62 * PP_OK on success. 63 * PP_OK on success.
63 */ 64 */
65 [version=0.1]
64 int32_t StartCapture( 66 int32_t StartCapture(
65 [in] PP_Resource video_capture, 67 [in] PP_Resource video_capture,
66 [in] PP_VideoCaptureDeviceInfo_Dev requested_info, 68 [in] PP_VideoCaptureDeviceInfo_Dev requested_info,
67 [in] uint32_t buffer_count); 69 [in] uint32_t buffer_count);
68 70
69 /** 71 /**
72 * Enumerates video capture devices. Once the operation is completed
73 * successfully. |GetDevices()| can be used to retrieve the devices.
74 */
75 [version=0.2]
76 int32_t EnumerateDevices(
brettw 2012/02/06 21:51:52 Thinking about this, I think it would be better to
yzshen1 2012/02/06 22:42:56 I agree that this is more intuitive. However, it i
brettw 2012/02/06 23:01:42 Yeah, I agree. The other way to do this is the way
yzshen1 2012/02/07 00:15:01 IMHO, the way how PPB_Transport_Dev.GetNextAddress
77 [in] PP_Resource video_capture,
78 [in] PP_CompletionCallback callback);
79
80 /**
81 * Gets video capture devices. The returned value is a PPB_ResourceArray_Dev
82 * resource if successful, which holds a list of PPB_DeviceRef_Dev resources.
83 */
84 [version=0.2]
85 PP_Resource GetDevices(
86 [in] PP_Resource video_capture);
87
88 /**
89 * Starts the capture. |device_ref| identifies a video capture device. It
90 * could be one of the resource in the array returned by |GetDevices()|, or 0
91 * which means the default device.
92 * |requested_info| is a pointer to a structure containing the requested
93 * resolution and frame rate. |buffer_count| is the number of buffers
94 * requested by the plugin. Note: it is only used as advisory, the browser may
95 * allocate more or fewer based on available resources. How many buffers
96 * depends on usage. At least 2 to make sure latency doesn't cause lost
97 * frames. If the plugin expects to hold on to more than one buffer at a time
98 * (e.g. to do multi-frame processing, like video encoding), it should request
99 * that many more.
100 *
101 * Returns PP_ERROR_FAILED if called when the capture was already started, or
102 * PP_OK on success.
103 */
104 [version=0.2]
105 int32_t StartCapture(
106 [in] PP_Resource video_capture,
107 [in] PP_Resource device_ref,
108 [in] PP_VideoCaptureDeviceInfo_Dev requested_info,
109 [in] uint32_t buffer_count);
110
111 /**
70 * Allows the browser to reuse a buffer that was previously sent by 112 * Allows the browser to reuse a buffer that was previously sent by
71 * PPP_VideoCapture_Dev.OnBufferReady. |buffer| is the index of the buffer in 113 * PPP_VideoCapture_Dev.OnBufferReady. |buffer| is the index of the buffer in
72 * the array returned by PPP_VideoCapture_Dev.OnDeviceInfo. 114 * the array returned by PPP_VideoCapture_Dev.OnDeviceInfo.
73 * 115 *
74 * Returns PP_ERROR_BADARGUMENT if buffer is out of range (greater than the 116 * Returns PP_ERROR_BADARGUMENT if buffer is out of range (greater than the
75 * number of buffers returned by PPP_VideoCapture_Dev.OnDeviceInfo), or if it 117 * number of buffers returned by PPP_VideoCapture_Dev.OnDeviceInfo), or if it
76 * is not currently owned by the plugin. Returns PP_OK otherwise. 118 * is not currently owned by the plugin. Returns PP_OK otherwise.
77 */ 119 */
78 int32_t ReuseBuffer( 120 int32_t ReuseBuffer(
79 [in] PP_Resource video_capture, 121 [in] PP_Resource video_capture,
80 [in] uint32_t buffer); 122 [in] uint32_t buffer);
81 123
82 /** 124 /**
83 * Stops the capture. 125 * Stops the capture.
84 * 126 *
85 * Returns PP_ERROR_FAILED if the capture wasn't already started, or PP_OK on 127 * Returns PP_ERROR_FAILED if the capture wasn't already started, or PP_OK on
86 * success. 128 * success.
87 */ 129 */
88 int32_t StopCapture( 130 int32_t StopCapture(
89 [in] PP_Resource video_capture); 131 [in] PP_Resource video_capture);
90 }; 132 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698