OLD | NEW |
1 /* Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2011 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 */ |
64 int32_t StartCapture( | 65 int32_t StartCapture( |
65 [in] PP_Resource video_capture, | 66 [in] PP_Resource video_capture, |
66 [in] PP_VideoCaptureDeviceInfo_Dev requested_info, | 67 [in] PP_VideoCaptureDeviceInfo_Dev requested_info, |
67 [in] uint32_t buffer_count); | 68 [in] uint32_t buffer_count); |
68 | 69 |
69 /** | 70 /** |
| 71 * Starts the capture. |device_ref| identifies a video capture device, |
| 72 * returned by <code>PPB_DeviceEnumerator_Dev</code>. |requested_info| is a |
| 73 * pointer to a structure containing the requested resolution and frame rate. |
| 74 * |buffer_count| is the number of buffers requested by the plugin. Note: it |
| 75 * is only used as advisory, the browser may allocate more of fewer based on |
| 76 * available resources. How many buffers depends on usage. At least 2 to make |
| 77 * sure latency doesn't cause lost frames. If the plugin expects to hold on to |
| 78 * more than one buffer at a time (e.g. to do multi-frame processing, like |
| 79 * video encoding), it should request that many more. |
| 80 * |
| 81 * Returns PP_ERROR_FAILED if called when the capture was already started, or |
| 82 * PP_OK on success. |
| 83 */ |
| 84 [version=0.2] |
| 85 int32_t StartCapture( |
| 86 [in] PP_Resource video_capture, |
| 87 [in] PP_Resource device_ref, |
| 88 [in] PP_VideoCaptureDeviceInfo_Dev requested_info, |
| 89 [in] uint32_t buffer_count); |
| 90 |
| 91 /** |
70 * Allows the browser to reuse a buffer that was previously sent by | 92 * 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 | 93 * PPP_VideoCapture_Dev.OnBufferReady. |buffer| is the index of the buffer in |
72 * the array returned by PPP_VideoCapture_Dev.OnDeviceInfo. | 94 * the array returned by PPP_VideoCapture_Dev.OnDeviceInfo. |
73 * | 95 * |
74 * Returns PP_ERROR_BADARGUMENT if buffer is out of range (greater than the | 96 * 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 | 97 * number of buffers returned by PPP_VideoCapture_Dev.OnDeviceInfo), or if it |
76 * is not currently owned by the plugin. Returns PP_OK otherwise. | 98 * is not currently owned by the plugin. Returns PP_OK otherwise. |
77 */ | 99 */ |
78 int32_t ReuseBuffer( | 100 int32_t ReuseBuffer( |
79 [in] PP_Resource video_capture, | 101 [in] PP_Resource video_capture, |
80 [in] uint32_t buffer); | 102 [in] uint32_t buffer); |
81 | 103 |
82 /** | 104 /** |
83 * Stops the capture. | 105 * Stops the capture. |
84 * | 106 * |
85 * Returns PP_ERROR_FAILED if the capture wasn't already started, or PP_OK on | 107 * Returns PP_ERROR_FAILED if the capture wasn't already started, or PP_OK on |
86 * success. | 108 * success. |
87 */ | 109 */ |
88 int32_t StopCapture( | 110 int32_t StopCapture( |
89 [in] PP_Resource video_capture); | 111 [in] PP_Resource video_capture); |
90 }; | 112 }; |
OLD | NEW |