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