| 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 "gpu/ipc/common/sync_token.mojom"; |
| 8 import "media/mojo/interfaces/media_types.mojom"; |
| 9 import "mojo/common/common_custom_types.mojom"; |
| 8 import "services/video_capture/public/interfaces/video_capture_device_proxy.mojo
m"; | 10 import "services/video_capture/public/interfaces/video_capture_device_proxy.mojo
m"; |
| 9 import "services/video_capture/public/interfaces/video_capture_format.mojom"; | 11 import "services/video_capture/public/interfaces/video_capture_format.mojom"; |
| 12 import "ui/gfx/geometry/mojo/geometry.mojom"; |
| 10 | 13 |
| 11 struct VideoCaptureParams { | 14 struct VideoCaptureParams { |
| 12 video_capture.mojom.VideoCaptureFormat requested_format; | 15 video_capture.mojom.VideoCaptureFormat requested_format; |
| 13 video_capture.mojom.ResolutionChangePolicy resolution_change_policy; | 16 video_capture.mojom.ResolutionChangePolicy resolution_change_policy; |
| 14 video_capture.mojom.PowerLineFrequency power_line_frequency; | 17 video_capture.mojom.PowerLineFrequency power_line_frequency; |
| 15 }; | 18 }; |
| 16 | 19 |
| 20 struct VideoFrameInfo{ |
| 21 mojo.common.mojom.TimeDelta timestamp; |
| 22 mojo.common.mojom.DictionaryValue metadata; |
| 23 media.mojom.VideoFormat pixel_format; |
| 24 video_capture.mojom.VideoPixelStorage storage_type; |
| 25 gfx.mojom.Size coded_size; |
| 26 gfx.mojom.Rect visible_rect; |
| 27 }; |
| 28 |
| 17 enum VideoCaptureState { | 29 enum VideoCaptureState { |
| 18 STARTED, | 30 STARTED, |
| 19 PAUSED, | 31 PAUSED, |
| 20 RESUMED, | 32 RESUMED, |
| 21 STOPPED, | 33 STOPPED, |
| 22 FAILED, | 34 FAILED, |
| 23 ENDED, | 35 ENDED, |
| 24 }; | 36 }; |
| 25 | 37 |
| 26 // Interface for notifications from Browser/Host back to Renderer/Client. This | 38 // Interface for notifications from Browser/Host back to Renderer/Client. This |
| 27 // interface is used between VideoCaptureHost.Start() and Stop(). | 39 // interface is used between VideoCaptureHost.Start() and Stop(). |
| 28 interface VideoCaptureObserver { | 40 interface VideoCaptureObserver { |
| 29 // Gets notigied about a VideoCaptureState update. | 41 // Gets notified about a VideoCaptureState update. |
| 30 OnStateChanged(VideoCaptureState state); | 42 OnStateChanged(VideoCaptureState state); |
| 31 | 43 |
| 32 // TODO(mcasas): Migrate the rest of the messages, https://crbug.com/651897. | 44 // |buffer_id| has video capture data with |info| containing the associated |
| 45 // VideoFrame constituent parts. |
| 46 OnBufferReady(int32 buffer_id, VideoFrameInfo info); |
| 47 |
| 48 // |buffer_id| has been released by VideoCaptureHost and must not be used. |
| 49 OnBufferDestroyed(int32 buffer_id); |
| 50 |
| 51 // TODO(mcasas): Migrate the rest of the messages, https://crbug.com/651897. |
| 33 }; | 52 }; |
| 34 | 53 |
| 35 interface VideoCaptureHost { | 54 interface VideoCaptureHost { |
| 36 // Start the |session_id| session with |params|. The video capture will be | 55 // Start the |session_id| session with |params|. The video capture will be |
| 37 // identified as |device_id|, a new id picked by the renderer process. | 56 // identified as |device_id|, a new id picked by the renderer process. |
| 38 // |observer| will be used for notifications. | 57 // |observer| will be used for notifications. |
| 39 Start(int32 device_id, int32 session_id, VideoCaptureParams params, | 58 Start(int32 device_id, int32 session_id, VideoCaptureParams params, |
| 40 VideoCaptureObserver observer); | 59 VideoCaptureObserver observer); |
| 41 | 60 |
| 42 // Closes the video capture specified by |device_id|. | 61 // Closes the video capture specified by |device_id|. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 58 double consumer_resource_utilization); | 77 double consumer_resource_utilization); |
| 59 | 78 |
| 60 // Get the formats supported by a device referenced by |session_id|. | 79 // Get the formats supported by a device referenced by |session_id|. |
| 61 GetDeviceSupportedFormats(int32 device_id, int32 session_id) | 80 GetDeviceSupportedFormats(int32 device_id, int32 session_id) |
| 62 => (array<video_capture.mojom.VideoCaptureFormat> formats_supported); | 81 => (array<video_capture.mojom.VideoCaptureFormat> formats_supported); |
| 63 | 82 |
| 64 // Get the format(s) in use by a device referenced by |session_id|. | 83 // Get the format(s) in use by a device referenced by |session_id|. |
| 65 GetDeviceFormatsInUse(int32 device_id, int32 session_id) | 84 GetDeviceFormatsInUse(int32 device_id, int32 session_id) |
| 66 => (array<video_capture.mojom.VideoCaptureFormat> formats_in_use); | 85 => (array<video_capture.mojom.VideoCaptureFormat> formats_in_use); |
| 67 }; | 86 }; |
| OLD | NEW |