| 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 "ipc/ipc_message_macros.h" | 9 #include "ipc/ipc_message_macros.h" |
| 10 #include "media/video/capture/video_capture_types.h" | 10 #include "media/video/capture/video_capture_types.h" |
| 11 | 11 |
| 12 #undef IPC_MESSAGE_EXPORT | 12 #undef IPC_MESSAGE_EXPORT |
| 13 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT | 13 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT |
| 14 #define IPC_MESSAGE_START VideoCaptureMsgStart | 14 #define IPC_MESSAGE_START VideoCaptureMsgStart |
| 15 | 15 |
| 16 IPC_ENUM_TRAITS(content::VideoCaptureState) | 16 IPC_ENUM_TRAITS(content::VideoCaptureState) |
| 17 | 17 |
| 18 // TODO(nick): device_id in these messages is basically just a route_id. We |
| 19 // should shift to IPC_MESSAGE_ROUTED and use MessageRouter in the filter impls. |
| 20 |
| 18 // Notify the renderer process about the state update such as | 21 // Notify the renderer process about the state update such as |
| 19 // Start/Pause/Stop. | 22 // Start/Pause/Stop. |
| 20 IPC_MESSAGE_CONTROL2(VideoCaptureMsg_StateChanged, | 23 IPC_MESSAGE_CONTROL2(VideoCaptureMsg_StateChanged, |
| 21 int /* device id */, | 24 int /* device id */, |
| 22 content::VideoCaptureState /* new state */) | 25 content::VideoCaptureState /* new state */) |
| 23 | 26 |
| 24 // Tell the renderer process that a new buffer is allocated for video capture. | 27 // Tell the renderer process that a new buffer is allocated for video capture. |
| 25 IPC_MESSAGE_CONTROL4(VideoCaptureMsg_NewBuffer, | 28 IPC_MESSAGE_CONTROL4(VideoCaptureMsg_NewBuffer, |
| 26 int /* device id */, | 29 int /* device id */, |
| 27 base::SharedMemoryHandle /* handle */, | 30 base::SharedMemoryHandle /* handle */, |
| 28 int /* length */, | 31 int /* length */, |
| 29 int /* buffer_id */) | 32 int /* buffer_id */) |
| 30 | 33 |
| 34 // Tell the renderer process that it should release a buffer previously |
| 35 // allocated by VideoCaptureMsg_NewBuffer. |
| 36 IPC_MESSAGE_CONTROL2(VideoCaptureMsg_FreeBuffer, |
| 37 int /* device id */, |
| 38 int /* buffer_id */) |
| 39 |
| 31 // Tell the renderer process that a buffer is available from video capture. | 40 // Tell the renderer process that a buffer is available from video capture. |
| 32 IPC_MESSAGE_CONTROL3(VideoCaptureMsg_BufferReady, | 41 IPC_MESSAGE_CONTROL4(VideoCaptureMsg_BufferReady, |
| 33 int /* device id */, | 42 int /* device id */, |
| 34 int /* buffer_id */, | 43 int /* buffer_id */, |
| 35 base::Time /* timestamp */) | 44 base::Time /* timestamp */, |
| 45 media::VideoCaptureFormat /* resolution */) |
| 36 | 46 |
| 37 // Tell the renderer process the width, height and frame rate the camera use. | 47 // Start a video capture as |device_id|, a new id picked by the renderer |
| 38 IPC_MESSAGE_CONTROL2(VideoCaptureMsg_DeviceInfo, | 48 // process. The session to be started is determined by |params.session_id|. |
| 39 int /* device_id */, | |
| 40 media::VideoCaptureParams) | |
| 41 | |
| 42 // Tell the renderer process the newly changed width, height and frame rate | |
| 43 // the video capture device will use. | |
| 44 IPC_MESSAGE_CONTROL2(VideoCaptureMsg_DeviceInfoChanged, | |
| 45 int /* device_id */, | |
| 46 media::VideoCaptureParams) | |
| 47 | |
| 48 // Start the video capture specified by |device_id|. | |
| 49 IPC_MESSAGE_CONTROL2(VideoCaptureHostMsg_Start, | 49 IPC_MESSAGE_CONTROL2(VideoCaptureHostMsg_Start, |
| 50 int /* device_id */, | 50 int /* device_id */, |
| 51 media::VideoCaptureParams) | 51 media::VideoCaptureParams /* params */) |
| 52 | 52 |
| 53 // Pause the video capture specified by |device_id|. | 53 // Pause the video capture specified by |device_id|. |
| 54 IPC_MESSAGE_CONTROL1(VideoCaptureHostMsg_Pause, | 54 IPC_MESSAGE_CONTROL1(VideoCaptureHostMsg_Pause, |
| 55 int /* device_id */) | 55 int /* device_id */) |
| 56 | 56 |
| 57 // Close the video capture specified by |device_id|. | 57 // Close the video capture specified by |device_id|. |
| 58 IPC_MESSAGE_CONTROL1(VideoCaptureHostMsg_Stop, | 58 IPC_MESSAGE_CONTROL1(VideoCaptureHostMsg_Stop, |
| 59 int /* device_id */) | 59 int /* device_id */) |
| 60 | 60 |
| 61 // Tell the browser process that the video frame buffer |handle| is ready for | 61 // Tell the browser process that the renderer has finished reading from |
| 62 // device |device_id| to fill up. | 62 // a buffer previously delivered by VideoCaptureMsg_BufferReady. |
| 63 IPC_MESSAGE_CONTROL2(VideoCaptureHostMsg_BufferReady, | 63 IPC_MESSAGE_CONTROL2(VideoCaptureHostMsg_BufferReady, |
| 64 int /* device_id */, | 64 int /* device_id */, |
| 65 int /* buffer_id */) | 65 int /* buffer_id */) |
| OLD | NEW |