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 IPC_ENUM_TRAITS_MAX_VALUE(media::VideoCaptureResolutionType, |
| 18 media::MaxVideoCaptureResolutionType - 1) |
17 | 19 |
18 IPC_STRUCT_TRAITS_BEGIN(media::VideoCaptureParams) | 20 IPC_STRUCT_TRAITS_BEGIN(media::VideoCaptureParams) |
| 21 IPC_STRUCT_TRAITS_MEMBER(session_id) |
19 IPC_STRUCT_TRAITS_MEMBER(requested_format) | 22 IPC_STRUCT_TRAITS_MEMBER(requested_format) |
20 IPC_STRUCT_TRAITS_MEMBER(allow_resolution_change) | |
21 IPC_STRUCT_TRAITS_END() | |
22 | |
23 IPC_STRUCT_TRAITS_BEGIN(media::VideoCaptureCapability) | |
24 IPC_STRUCT_TRAITS_MEMBER(supported_format) | |
25 IPC_STRUCT_TRAITS_END() | 23 IPC_STRUCT_TRAITS_END() |
26 | 24 |
27 // TODO(nick): device_id in these messages is basically just a route_id. We | 25 // TODO(nick): device_id in these messages is basically just a route_id. We |
28 // should shift to IPC_MESSAGE_ROUTED and use MessageRouter in the filter impls. | 26 // should shift to IPC_MESSAGE_ROUTED and use MessageRouter in the filter impls. |
29 | 27 |
30 // Notify the renderer process about the state update such as | 28 // Notify the renderer process about the state update such as |
31 // Start/Pause/Stop. | 29 // Start/Pause/Stop. |
32 IPC_MESSAGE_CONTROL2(VideoCaptureMsg_StateChanged, | 30 IPC_MESSAGE_CONTROL2(VideoCaptureMsg_StateChanged, |
33 int /* device id */, | 31 int /* device id */, |
34 content::VideoCaptureState /* new state */) | 32 content::VideoCaptureState /* new state */) |
(...skipping 13 matching lines...) Expand all Loading... |
48 | 46 |
49 // Tell the renderer process that a buffer is available from video capture. | 47 // Tell the renderer process that a buffer is available from video capture. |
50 IPC_MESSAGE_CONTROL4(VideoCaptureMsg_BufferReady, | 48 IPC_MESSAGE_CONTROL4(VideoCaptureMsg_BufferReady, |
51 int /* device id */, | 49 int /* device id */, |
52 int /* buffer_id */, | 50 int /* buffer_id */, |
53 base::Time /* timestamp */, | 51 base::Time /* timestamp */, |
54 media::VideoCaptureFormat /* resolution */) | 52 media::VideoCaptureFormat /* resolution */) |
55 | 53 |
56 // Start a video capture as |device_id|, a new id picked by the renderer | 54 // Start a video capture as |device_id|, a new id picked by the renderer |
57 // process. The session to be started is determined by |params.session_id|. | 55 // process. The session to be started is determined by |params.session_id|. |
58 IPC_MESSAGE_CONTROL3(VideoCaptureHostMsg_Start, | 56 IPC_MESSAGE_CONTROL2(VideoCaptureHostMsg_Start, |
59 int /* device_id */, | 57 int /* device_id */, |
60 media::VideoCaptureSessionId, /* session_id */ | |
61 media::VideoCaptureParams /* params */) | 58 media::VideoCaptureParams /* params */) |
62 | 59 |
63 // Pause the video capture specified by |device_id|. | 60 // Pause the video capture specified by |device_id|. |
64 IPC_MESSAGE_CONTROL1(VideoCaptureHostMsg_Pause, | 61 IPC_MESSAGE_CONTROL1(VideoCaptureHostMsg_Pause, |
65 int /* device_id */) | 62 int /* device_id */) |
66 | 63 |
67 // Close the video capture specified by |device_id|. | 64 // Close the video capture specified by |device_id|. |
68 IPC_MESSAGE_CONTROL1(VideoCaptureHostMsg_Stop, | 65 IPC_MESSAGE_CONTROL1(VideoCaptureHostMsg_Stop, |
69 int /* device_id */) | 66 int /* device_id */) |
70 | 67 |
71 // Tell the browser process that the renderer has finished reading from | 68 // Tell the browser process that the renderer has finished reading from |
72 // a buffer previously delivered by VideoCaptureMsg_BufferReady. | 69 // a buffer previously delivered by VideoCaptureMsg_BufferReady. |
73 IPC_MESSAGE_CONTROL2(VideoCaptureHostMsg_BufferReady, | 70 IPC_MESSAGE_CONTROL2(VideoCaptureHostMsg_BufferReady, |
74 int /* device_id */, | 71 int /* device_id */, |
75 int /* buffer_id */) | 72 int /* buffer_id */) |
OLD | NEW |