Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 module content.mojom; | 5 module content.mojom; |
| 6 | 6 |
| 7 import "gpu/ipc/common/sync_token.mojom"; | |
| 7 import "services/video_capture/public/interfaces/video_capture_device_proxy.mojo m"; | 8 import "services/video_capture/public/interfaces/video_capture_device_proxy.mojo m"; |
| 8 import "services/video_capture/public/interfaces/video_capture_format.mojom"; | 9 import "services/video_capture/public/interfaces/video_capture_format.mojom"; |
| 9 | 10 |
| 10 struct VideoCaptureParams { | 11 struct VideoCaptureParams { |
| 11 video_capture.mojom.VideoCaptureFormat requested_format; | 12 video_capture.mojom.VideoCaptureFormat requested_format; |
| 12 video_capture.mojom.ResolutionChangePolicy resolution_change_policy; | 13 video_capture.mojom.ResolutionChangePolicy resolution_change_policy; |
| 13 video_capture.mojom.PowerLineFrequency power_line_frequency; | 14 video_capture.mojom.PowerLineFrequency power_line_frequency; |
| 14 }; | 15 }; |
| 15 | 16 |
| 17 enum VideoCaptureState { | |
| 18 STARTED, | |
| 19 PAUSED, | |
| 20 RESUMED, | |
| 21 STOPPED, | |
| 22 FAILED, | |
| 23 ENDED, | |
| 24 }; | |
| 25 | |
| 26 // Interface for notifications from Browser/Host back to Renderer/Client. This | |
| 27 // interface is used between VideoCaptureHost.Start() and Stop(). | |
| 28 interface VideoCaptureObserver { | |
| 29 // Gets notigied about a VideoCaptureState update. | |
| 30 OnStateChanged(VideoCaptureState state); | |
| 31 | |
| 32 // TODO(mcasas): Migrate the rest of the messages, https://crbug.com/651897. | |
| 33 }; | |
| 34 | |
| 16 interface VideoCaptureHost { | 35 interface VideoCaptureHost { |
| 17 // TODO(mcasas): Migrate the rest of the messages, https://crbug.com/651897. | |
| 18 | |
| 19 // Start the |session_id| session with |params|. The video capture will be | 36 // Start the |session_id| session with |params|. The video capture will be |
| 20 // identified as |device_id|, a new id picked by the renderer process. | 37 // identified as |device_id|, a new id picked by the renderer process. |
| 21 Start(int32 device_id, int32 session_id, VideoCaptureParams params); | 38 // If successful, |observer| will be used for notifications. |
|
chfremer
2016/10/10 18:57:19
With Start() being an asynchronous method without
mcasas
2016/10/10 19:39:44
Actually this is wrongly stated :) -- in mojo-lan
| |
| 39 Start(int32 device_id, int32 session_id, VideoCaptureParams params, | |
| 40 VideoCaptureObserver observer); | |
| 22 | 41 |
| 23 // Closes the video capture specified by |device_id|. | 42 // Closes the video capture specified by |device_id|. |
| 24 Stop(int32 device_id); | 43 Stop(int32 device_id); |
| 25 | 44 |
| 26 // Pauses the video capture specified by |device_id|. | 45 // Pauses the video capture specified by |device_id|. |
| 27 Pause(int32 device_id); | 46 Pause(int32 device_id); |
| 28 | 47 |
| 29 // Resume |device_id| video capture, in |session_id| and with |params|. | 48 // Resume |device_id| video capture, in |session_id| and with |params|. |
| 30 Resume(int32 device_id, int32 session_id, VideoCaptureParams params); | 49 Resume(int32 device_id, int32 session_id, VideoCaptureParams params); |
| 31 | 50 |
| 32 // Requests that the video capturer send a frame "soon" (e.g., to resolve | 51 // Requests that the video capturer send a frame "soon" (e.g., to resolve |
| 33 // picture loss or quality issues). | 52 // picture loss or quality issues). |
| 34 RequestRefreshFrame(int32 device_id); | 53 RequestRefreshFrame(int32 device_id); |
| 35 | 54 |
| 55 // Indicates that a renderer has finished using a previously shared buffer. | |
| 56 ReleaseBuffer(int32 device_id, int32 buffer_id, | |
| 57 gpu.mojom.SyncToken sync_token, | |
| 58 double consumer_resource_utilization); | |
| 59 | |
| 36 // Get the formats supported by a device referenced by |session_id|. | 60 // Get the formats supported by a device referenced by |session_id|. |
| 37 GetDeviceSupportedFormats(int32 device_id, int32 session_id) | 61 GetDeviceSupportedFormats(int32 device_id, int32 session_id) |
| 38 => (array<video_capture.mojom.VideoCaptureFormat> formats_supported); | 62 => (array<video_capture.mojom.VideoCaptureFormat> formats_supported); |
| 39 | 63 |
| 40 // Get the format(s) in use by a device referenced by |session_id|. | 64 // Get the format(s) in use by a device referenced by |session_id|. |
| 41 GetDeviceFormatsInUse(int32 device_id, int32 session_id) | 65 GetDeviceFormatsInUse(int32 device_id, int32 session_id) |
| 42 => (array<video_capture.mojom.VideoCaptureFormat> formats_in_use); | 66 => (array<video_capture.mojom.VideoCaptureFormat> formats_in_use); |
| 43 }; | 67 }; |
| OLD | NEW |