| 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"; | 8 import "media/mojo/interfaces/media_types.mojom"; |
| 9 import "media/capture/mojo/video_capture_types.mojom"; |
| 9 import "mojo/common/common_custom_types.mojom"; | 10 import "mojo/common/common_custom_types.mojom"; |
| 10 import "services/video_capture/public/interfaces/video_capture_device_proxy.mojo
m"; | |
| 11 import "services/video_capture/public/interfaces/video_capture_format.mojom"; | |
| 12 import "ui/gfx/geometry/mojo/geometry.mojom"; | 11 import "ui/gfx/geometry/mojo/geometry.mojom"; |
| 13 | 12 |
| 14 // This file decribes the communication between a given Renderer Host interface | 13 // This file decribes the communication between a given Renderer Host interface |
| 15 // implementation (VideoCaptureHost) and a remote VideoCaptureObserver. | 14 // implementation (VideoCaptureHost) and a remote VideoCaptureObserver. |
| 16 // VideoCaptureHost offers a stateless part (GetDeviceSupportedFormats() and | 15 // VideoCaptureHost offers a stateless part (GetDeviceSupportedFormats() and |
| 17 // GetDeviceFormatsInUse()) that can be invoked at any time, and a stateful part | 16 // GetDeviceFormatsInUse()) that can be invoked at any time, and a stateful part |
| 18 // sandwiched between Start() and Stop(). A Client's OnStateChanged() can be | 17 // sandwiched between Start() and Stop(). A Client's OnStateChanged() can be |
| 19 // notified any time during the stateful part. The stateful part is composed of | 18 // notified any time during the stateful part. The stateful part is composed of |
| 20 // a preamble where a Renderer client sends a command to Start() the capture, | 19 // a preamble where a Renderer client sends a command to Start() the capture, |
| 21 // registering itself as the associated remote VideoCaptureObserver. The Host | 20 // registering itself as the associated remote VideoCaptureObserver. The Host |
| (...skipping 23 matching lines...) Expand all Loading... |
| 45 // | ---> ReleaseBuffer(2) | | 44 // | ---> ReleaseBuffer(2) | |
| 46 // | OnBufferDestroyed(2) <--- | | 45 // | OnBufferDestroyed(2) <--- | |
| 47 // | OnBufferCreated(5) <--- | | 46 // | OnBufferCreated(5) <--- | |
| 48 // | OnBufferReady(5) <--- | | 47 // | OnBufferReady(5) <--- | |
| 49 // = = | 48 // = = |
| 50 // In the communication epilogue, the client Stop()s capture, receiving a last | 49 // In the communication epilogue, the client Stop()s capture, receiving a last |
| 51 // status update: | 50 // status update: |
| 52 // | ---> StopCapture | | 51 // | ---> StopCapture | |
| 53 // | OnStateChanged(STOPPED) <--- | | 52 // | OnStateChanged(STOPPED) <--- | |
| 54 | 53 |
| 55 struct VideoCaptureParams { | |
| 56 video_capture.mojom.VideoCaptureFormat requested_format; | |
| 57 video_capture.mojom.ResolutionChangePolicy resolution_change_policy; | |
| 58 video_capture.mojom.PowerLineFrequency power_line_frequency; | |
| 59 }; | |
| 60 | |
| 61 struct VideoFrameInfo{ | 54 struct VideoFrameInfo{ |
| 62 mojo.common.mojom.TimeDelta timestamp; | 55 mojo.common.mojom.TimeDelta timestamp; |
| 63 mojo.common.mojom.DictionaryValue metadata; | 56 mojo.common.mojom.DictionaryValue metadata; |
| 64 media.mojom.VideoPixelFormat pixel_format; | 57 media.mojom.VideoPixelFormat pixel_format; |
| 65 video_capture.mojom.VideoPixelStorage storage_type; | 58 media.mojom.VideoPixelStorage storage_type; |
| 66 gfx.mojom.Size coded_size; | 59 gfx.mojom.Size coded_size; |
| 67 gfx.mojom.Rect visible_rect; | 60 gfx.mojom.Rect visible_rect; |
| 68 }; | 61 }; |
| 69 | 62 |
| 70 enum VideoCaptureState { | 63 enum VideoCaptureState { |
| 71 STARTED, | 64 STARTED, |
| 72 PAUSED, | 65 PAUSED, |
| 73 RESUMED, | 66 RESUMED, |
| 74 STOPPED, | 67 STOPPED, |
| 75 FAILED, | 68 FAILED, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 90 OnBufferReady(int32 buffer_id, VideoFrameInfo info); | 83 OnBufferReady(int32 buffer_id, VideoFrameInfo info); |
| 91 | 84 |
| 92 // |buffer_id| has been released by VideoCaptureHost and must not be used. | 85 // |buffer_id| has been released by VideoCaptureHost and must not be used. |
| 93 OnBufferDestroyed(int32 buffer_id); | 86 OnBufferDestroyed(int32 buffer_id); |
| 94 }; | 87 }; |
| 95 | 88 |
| 96 interface VideoCaptureHost { | 89 interface VideoCaptureHost { |
| 97 // Start the |session_id| session with |params|. The video capture will be | 90 // Start the |session_id| session with |params|. The video capture will be |
| 98 // identified as |device_id|, a new id picked by the renderer process. | 91 // identified as |device_id|, a new id picked by the renderer process. |
| 99 // |observer| will be used for notifications. | 92 // |observer| will be used for notifications. |
| 100 Start(int32 device_id, int32 session_id, VideoCaptureParams params, | 93 Start(int32 device_id, int32 session_id, media.mojom.VideoCaptureParams params
, |
| 101 VideoCaptureObserver observer); | 94 VideoCaptureObserver observer); |
| 102 | 95 |
| 103 // Closes the video capture specified by |device_id|. | 96 // Closes the video capture specified by |device_id|. |
| 104 Stop(int32 device_id); | 97 Stop(int32 device_id); |
| 105 | 98 |
| 106 // Pauses the video capture specified by |device_id|. | 99 // Pauses the video capture specified by |device_id|. |
| 107 Pause(int32 device_id); | 100 Pause(int32 device_id); |
| 108 | 101 |
| 109 // Resume |device_id| video capture, in |session_id| and with |params|. | 102 // Resume |device_id| video capture, in |session_id| and with |params|. |
| 110 Resume(int32 device_id, int32 session_id, VideoCaptureParams params); | 103 Resume(int32 device_id, int32 session_id, media.mojom.VideoCaptureParams param
s); |
| 111 | 104 |
| 112 // Requests that the video capturer send a frame "soon" (e.g., to resolve | 105 // Requests that the video capturer send a frame "soon" (e.g., to resolve |
| 113 // picture loss or quality issues). | 106 // picture loss or quality issues). |
| 114 RequestRefreshFrame(int32 device_id); | 107 RequestRefreshFrame(int32 device_id); |
| 115 | 108 |
| 116 // Indicates that a renderer has finished using a previously shared buffer. | 109 // Indicates that a renderer has finished using a previously shared buffer. |
| 117 ReleaseBuffer(int32 device_id, int32 buffer_id, | 110 ReleaseBuffer(int32 device_id, int32 buffer_id, |
| 118 gpu.mojom.SyncToken sync_token, | 111 gpu.mojom.SyncToken sync_token, |
| 119 double consumer_resource_utilization); | 112 double consumer_resource_utilization); |
| 120 | 113 |
| 121 // Get the formats supported by a device referenced by |session_id|. | 114 // Get the formats supported by a device referenced by |session_id|. |
| 122 GetDeviceSupportedFormats(int32 device_id, int32 session_id) | 115 GetDeviceSupportedFormats(int32 device_id, int32 session_id) |
| 123 => (array<video_capture.mojom.VideoCaptureFormat> formats_supported); | 116 => (array<media.mojom.VideoCaptureFormat> formats_supported); |
| 124 | 117 |
| 125 // Get the format(s) in use by a device referenced by |session_id|. | 118 // Get the format(s) in use by a device referenced by |session_id|. |
| 126 GetDeviceFormatsInUse(int32 device_id, int32 session_id) | 119 GetDeviceFormatsInUse(int32 device_id, int32 session_id) |
| 127 => (array<video_capture.mojom.VideoCaptureFormat> formats_in_use); | 120 => (array<media.mojom.VideoCaptureFormat> formats_in_use); |
| 128 }; | 121 }; |
| OLD | NEW |