| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "base/memory/shared_memory.h" | 5 #include "base/memory/shared_memory.h" |
| 6 #include "content/common/content_export.h" | 6 #include "content/common/content_export.h" |
| 7 #include "content/common/media/video_capture.h" | 7 #include "content/common/media/video_capture.h" |
| 8 #include "content/public/common/common_param_traits.h" | 8 #include "content/public/common/common_param_traits.h" |
| 9 #include "gpu/command_buffer/common/mailbox_holder.h" | 9 #include "gpu/command_buffer/common/mailbox_holder.h" |
| 10 #include "ipc/ipc_message_macros.h" | 10 #include "ipc/ipc_message_macros.h" |
| 11 #include "media/base/video_capture_types.h" | 11 #include "media/base/video_capture_types.h" |
| 12 | 12 |
| 13 #undef IPC_MESSAGE_EXPORT | 13 #undef IPC_MESSAGE_EXPORT |
| 14 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT | 14 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT |
| 15 #define IPC_MESSAGE_START VideoCaptureMsgStart | 15 #define IPC_MESSAGE_START VideoCaptureMsgStart |
| 16 | 16 |
| 17 IPC_ENUM_TRAITS_MAX_VALUE(content::VideoCaptureState, | 17 IPC_ENUM_TRAITS_MAX_VALUE(content::VideoCaptureState, |
| 18 content::VIDEO_CAPTURE_STATE_LAST) | 18 content::VIDEO_CAPTURE_STATE_LAST) |
| 19 | 19 |
| 20 IPC_ENUM_TRAITS_MAX_VALUE(media::ResolutionChangePolicy, | 20 IPC_ENUM_TRAITS_MAX_VALUE(media::ResolutionChangePolicy, |
| 21 media::RESOLUTION_POLICY_LAST) | 21 media::RESOLUTION_POLICY_LAST) |
| 22 | 22 |
| 23 IPC_STRUCT_TRAITS_BEGIN(media::VideoCaptureParams) | 23 IPC_STRUCT_TRAITS_BEGIN(media::VideoCaptureParams) |
| 24 IPC_STRUCT_TRAITS_MEMBER(requested_format) | 24 IPC_STRUCT_TRAITS_MEMBER(requested_format) |
| 25 IPC_STRUCT_TRAITS_MEMBER(resolution_change_policy) | 25 IPC_STRUCT_TRAITS_MEMBER(resolution_change_policy) |
| 26 IPC_STRUCT_TRAITS_END() | 26 IPC_STRUCT_TRAITS_END() |
| 27 | 27 |
| 28 IPC_STRUCT_BEGIN(VideoCaptureMsg_BufferReady_Params) |
| 29 IPC_STRUCT_MEMBER(int, device_id) |
| 30 IPC_STRUCT_MEMBER(int, buffer_id) |
| 31 IPC_STRUCT_MEMBER(gfx::Size, coded_size) |
| 32 IPC_STRUCT_MEMBER(gfx::Rect, visible_rect) |
| 33 IPC_STRUCT_MEMBER(base::TimeTicks, timestamp) |
| 34 IPC_STRUCT_MEMBER(base::DictionaryValue, metadata) |
| 35 IPC_STRUCT_END() |
| 36 |
| 37 IPC_STRUCT_BEGIN(VideoCaptureMsg_MailboxBufferReady_Params) |
| 38 IPC_STRUCT_MEMBER(int, device_id) |
| 39 IPC_STRUCT_MEMBER(int, buffer_id) |
| 40 IPC_STRUCT_MEMBER(gpu::MailboxHolder, mailbox_holder) |
| 41 IPC_STRUCT_MEMBER(gfx::Size, packed_frame_size) |
| 42 IPC_STRUCT_MEMBER(base::TimeTicks, timestamp) |
| 43 IPC_STRUCT_MEMBER(base::DictionaryValue, metadata) |
| 44 IPC_STRUCT_END() |
| 45 |
| 28 // TODO(nick): device_id in these messages is basically just a route_id. We | 46 // TODO(nick): device_id in these messages is basically just a route_id. We |
| 29 // should shift to IPC_MESSAGE_ROUTED and use MessageRouter in the filter impls. | 47 // should shift to IPC_MESSAGE_ROUTED and use MessageRouter in the filter impls. |
| 30 | 48 |
| 31 // Notify the renderer process about the state update such as | 49 // Notify the renderer process about the state update such as |
| 32 // Start/Pause/Stop. | 50 // Start/Pause/Stop. |
| 33 IPC_MESSAGE_CONTROL2(VideoCaptureMsg_StateChanged, | 51 IPC_MESSAGE_CONTROL2(VideoCaptureMsg_StateChanged, |
| 34 int /* device id */, | 52 int /* device id */, |
| 35 content::VideoCaptureState /* new state */) | 53 content::VideoCaptureState /* new state */) |
| 36 | 54 |
| 37 // Tell the renderer process that a new buffer is allocated for video capture. | 55 // Tell the renderer process that a new buffer is allocated for video capture. |
| 38 IPC_MESSAGE_CONTROL4(VideoCaptureMsg_NewBuffer, | 56 IPC_MESSAGE_CONTROL4(VideoCaptureMsg_NewBuffer, |
| 39 int /* device id */, | 57 int /* device id */, |
| 40 base::SharedMemoryHandle /* handle */, | 58 base::SharedMemoryHandle /* handle */, |
| 41 int /* length */, | 59 int /* length */, |
| 42 int /* buffer_id */) | 60 int /* buffer_id */) |
| 43 | 61 |
| 44 // Tell the renderer process that it should release a buffer previously | 62 // Tell the renderer process that it should release a buffer previously |
| 45 // allocated by VideoCaptureMsg_NewBuffer. | 63 // allocated by VideoCaptureMsg_NewBuffer. |
| 46 IPC_MESSAGE_CONTROL2(VideoCaptureMsg_FreeBuffer, | 64 IPC_MESSAGE_CONTROL2(VideoCaptureMsg_FreeBuffer, |
| 47 int /* device id */, | 65 int /* device id */, |
| 48 int /* buffer_id */) | 66 int /* buffer_id */) |
| 49 | 67 |
| 50 // Tell the renderer process that a buffer is available from video capture. | 68 // Tell the renderer process that a buffer is available from video capture. |
| 51 IPC_MESSAGE_CONTROL5(VideoCaptureMsg_BufferReady, | 69 IPC_MESSAGE_CONTROL1(VideoCaptureMsg_BufferReady, |
| 52 int /* device id */, | 70 VideoCaptureMsg_BufferReady_Params) |
| 53 int /* buffer_id */, | |
| 54 media::VideoCaptureFormat /* format */, | |
| 55 gfx::Rect /* visible_rect */, | |
| 56 base::TimeTicks /* timestamp */) | |
| 57 | 71 |
| 58 // Tell the renderer process that a texture mailbox buffer is available from | 72 // Tell the renderer process that a texture mailbox buffer is available from |
| 59 // video capture. | 73 // video capture. |
| 60 IPC_MESSAGE_CONTROL5(VideoCaptureMsg_MailboxBufferReady, | 74 IPC_MESSAGE_CONTROL1(VideoCaptureMsg_MailboxBufferReady, |
| 61 int /* device_id */, | 75 VideoCaptureMsg_MailboxBufferReady_Params) |
| 62 int /* buffer_id */, | |
| 63 gpu::MailboxHolder /* mailbox_holder */, | |
| 64 media::VideoCaptureFormat /* format */, | |
| 65 base::TimeTicks /* timestamp */) | |
| 66 | 76 |
| 67 // Notify the renderer about a device's supported formats; this is a response | 77 // Notify the renderer about a device's supported formats; this is a response |
| 68 // to a VideoCaptureHostMsg_GetDeviceSupportedFormats request. | 78 // to a VideoCaptureHostMsg_GetDeviceSupportedFormats request. |
| 69 IPC_MESSAGE_CONTROL2(VideoCaptureMsg_DeviceSupportedFormatsEnumerated, | 79 IPC_MESSAGE_CONTROL2(VideoCaptureMsg_DeviceSupportedFormatsEnumerated, |
| 70 int /* device_id */, | 80 int /* device_id */, |
| 71 media::VideoCaptureFormats /* supported_formats */) | 81 media::VideoCaptureFormats /* supported_formats */) |
| 72 | 82 |
| 73 // Notify the renderer about a device's format(s) in use; this is a response | 83 // Notify the renderer about a device's format(s) in use; this is a response |
| 74 // to a VideoCaptureHostMsg_GetDeviceFormatInUse request. | 84 // to a VideoCaptureHostMsg_GetDeviceFormatInUse request. |
| 75 IPC_MESSAGE_CONTROL2(VideoCaptureMsg_DeviceFormatsInUseReceived, | 85 IPC_MESSAGE_CONTROL2(VideoCaptureMsg_DeviceFormatsInUseReceived, |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 | 117 |
| 108 // Get the formats supported by a device referenced by |capture_session_id|. | 118 // Get the formats supported by a device referenced by |capture_session_id|. |
| 109 IPC_MESSAGE_CONTROL2(VideoCaptureHostMsg_GetDeviceSupportedFormats, | 119 IPC_MESSAGE_CONTROL2(VideoCaptureHostMsg_GetDeviceSupportedFormats, |
| 110 int /* device_id */, | 120 int /* device_id */, |
| 111 media::VideoCaptureSessionId /* session_id */) | 121 media::VideoCaptureSessionId /* session_id */) |
| 112 | 122 |
| 113 // Get the format(s) in use by a device referenced by |capture_session_id|. | 123 // Get the format(s) in use by a device referenced by |capture_session_id|. |
| 114 IPC_MESSAGE_CONTROL2(VideoCaptureHostMsg_GetDeviceFormatsInUse, | 124 IPC_MESSAGE_CONTROL2(VideoCaptureHostMsg_GetDeviceFormatsInUse, |
| 115 int /* device_id */, | 125 int /* device_id */, |
| 116 media::VideoCaptureSessionId /* session_id */) | 126 media::VideoCaptureSessionId /* session_id */) |
| OLD | NEW |