| 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 "media/capture/mojo/video_capture_types.mojom"; |
| 10 import "mojo/common/common_custom_types.mojom"; | 10 import "mojo/common/common_custom_types.mojom"; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 // | ---> ReleaseBuffer(2) | | 44 // | ---> ReleaseBuffer(2) | |
| 45 // | OnBufferDestroyed(2) <--- | | 45 // | OnBufferDestroyed(2) <--- | |
| 46 // | OnBufferCreated(5) <--- | | 46 // | OnBufferCreated(5) <--- | |
| 47 // | OnBufferReady(5) <--- | | 47 // | OnBufferReady(5) <--- | |
| 48 // = = | 48 // = = |
| 49 // 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 |
| 50 // status update: | 50 // status update: |
| 51 // | ---> StopCapture | | 51 // | ---> StopCapture | |
| 52 // | OnStateChanged(STOPPED) <--- | | 52 // | OnStateChanged(STOPPED) <--- | |
| 53 | 53 |
| 54 struct VideoFrameInfo{ | |
| 55 mojo.common.mojom.TimeDelta timestamp; | |
| 56 mojo.common.mojom.DictionaryValue metadata; | |
| 57 media.mojom.VideoPixelFormat pixel_format; | |
| 58 media.mojom.VideoPixelStorage storage_type; | |
| 59 gfx.mojom.Size coded_size; | |
| 60 gfx.mojom.Rect visible_rect; | |
| 61 }; | |
| 62 | |
| 63 enum VideoCaptureState { | 54 enum VideoCaptureState { |
| 64 STARTED, | 55 STARTED, |
| 65 PAUSED, | 56 PAUSED, |
| 66 RESUMED, | 57 RESUMED, |
| 67 STOPPED, | 58 STOPPED, |
| 68 FAILED, | 59 FAILED, |
| 69 ENDED, | 60 ENDED, |
| 70 }; | 61 }; |
| 71 | 62 |
| 72 // Interface for notifications from Browser/Host back to Renderer/Client. This | 63 // Interface for notifications from Browser/Host back to Renderer/Client. This |
| 73 // interface is used between VideoCaptureHost.Start() and Stop(). | 64 // interface is used between VideoCaptureHost.Start() and Stop(). |
| 74 interface VideoCaptureObserver { | 65 interface VideoCaptureObserver { |
| 75 // Gets notified about a VideoCaptureState update. | 66 // Gets notified about a VideoCaptureState update. |
| 76 OnStateChanged(VideoCaptureState state); | 67 OnStateChanged(VideoCaptureState state); |
| 77 | 68 |
| 78 // A new buffer identified by |buffer_id| has been created for video capture. | 69 // A new buffer identified by |buffer_id| has been created for video capture. |
| 79 OnBufferCreated(int32 buffer_id, handle<shared_buffer> handle_fd); | 70 OnBufferCreated(int32 buffer_id, handle<shared_buffer> handle_fd); |
| 80 | 71 |
| 81 // |buffer_id| has video capture data with |info| containing the associated | 72 // |buffer_id| has video capture data with |info| containing the associated |
| 82 // VideoFrame constituent parts. | 73 // VideoFrame constituent parts. |
| 83 OnBufferReady(int32 buffer_id, VideoFrameInfo info); | 74 OnBufferReady(int32 buffer_id, media.mojom.VideoFrameInfo info); |
| 84 | 75 |
| 85 // |buffer_id| has been released by VideoCaptureHost and must not be used. | 76 // |buffer_id| has been released by VideoCaptureHost and must not be used. |
| 86 OnBufferDestroyed(int32 buffer_id); | 77 OnBufferDestroyed(int32 buffer_id); |
| 87 }; | 78 }; |
| 88 | 79 |
| 89 interface VideoCaptureHost { | 80 interface VideoCaptureHost { |
| 90 // Start the |session_id| session with |params|. The video capture will be | 81 // Start the |session_id| session with |params|. The video capture will be |
| 91 // identified as |device_id|, a new id picked by the renderer process. | 82 // identified as |device_id|, a new id picked by the renderer process. |
| 92 // |observer| will be used for notifications. | 83 // |observer| will be used for notifications. |
| 93 Start(int32 device_id, int32 session_id, media.mojom.VideoCaptureParams params
, | 84 Start(int32 device_id, int32 session_id, media.mojom.VideoCaptureParams params
, |
| (...skipping 18 matching lines...) Expand all Loading... |
| 112 double consumer_resource_utilization); | 103 double consumer_resource_utilization); |
| 113 | 104 |
| 114 // Get the formats supported by a device referenced by |session_id|. | 105 // Get the formats supported by a device referenced by |session_id|. |
| 115 GetDeviceSupportedFormats(int32 device_id, int32 session_id) | 106 GetDeviceSupportedFormats(int32 device_id, int32 session_id) |
| 116 => (array<media.mojom.VideoCaptureFormat> formats_supported); | 107 => (array<media.mojom.VideoCaptureFormat> formats_supported); |
| 117 | 108 |
| 118 // Get the format(s) in use by a device referenced by |session_id|. | 109 // Get the format(s) in use by a device referenced by |session_id|. |
| 119 GetDeviceFormatsInUse(int32 device_id, int32 session_id) | 110 GetDeviceFormatsInUse(int32 device_id, int32 session_id) |
| 120 => (array<media.mojom.VideoCaptureFormat> formats_in_use); | 111 => (array<media.mojom.VideoCaptureFormat> formats_in_use); |
| 121 }; | 112 }; |
| OLD | NEW |