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/base/video_capture_types.h" | 10 #include "media/base/video_capture_types.h" |
11 #include "media/base/video_frame.h" | 11 #include "media/base/video_frame.h" |
12 #include "ui/gfx/gpu_memory_buffer.h" | 12 #include "ui/gfx/gpu_memory_buffer.h" |
13 | 13 |
14 #undef IPC_MESSAGE_EXPORT | 14 #undef IPC_MESSAGE_EXPORT |
15 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT | 15 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT |
16 #define IPC_MESSAGE_START VideoCaptureMsgStart | 16 #define IPC_MESSAGE_START VideoCaptureMsgStart |
17 | 17 |
18 IPC_ENUM_TRAITS_MAX_VALUE(content::VideoCaptureState, | 18 IPC_ENUM_TRAITS_MAX_VALUE(content::VideoCaptureState, |
19 content::VIDEO_CAPTURE_STATE_LAST) | 19 content::VIDEO_CAPTURE_STATE_LAST) |
20 IPC_ENUM_TRAITS_MAX_VALUE(media::ResolutionChangePolicy, | |
21 media::RESOLUTION_POLICY_LAST) | |
22 IPC_ENUM_TRAITS_MAX_VALUE(media::VideoFrame::StorageType, | 20 IPC_ENUM_TRAITS_MAX_VALUE(media::VideoFrame::StorageType, |
23 media::VideoFrame::STORAGE_LAST) | 21 media::VideoFrame::STORAGE_LAST) |
24 IPC_ENUM_TRAITS_MAX_VALUE(media::PowerLineFrequency, | |
25 media::PowerLineFrequency::FREQUENCY_MAX) | |
26 | |
27 IPC_STRUCT_TRAITS_BEGIN(media::VideoCaptureParams) | |
28 IPC_STRUCT_TRAITS_MEMBER(requested_format) | |
29 IPC_STRUCT_TRAITS_MEMBER(resolution_change_policy) | |
30 IPC_STRUCT_TRAITS_MEMBER(power_line_frequency) | |
31 IPC_STRUCT_TRAITS_END() | |
32 | 22 |
33 IPC_STRUCT_BEGIN(VideoCaptureMsg_BufferReady_Params) | 23 IPC_STRUCT_BEGIN(VideoCaptureMsg_BufferReady_Params) |
34 IPC_STRUCT_MEMBER(int, device_id) | 24 IPC_STRUCT_MEMBER(int, device_id) |
35 IPC_STRUCT_MEMBER(int, buffer_id) | 25 IPC_STRUCT_MEMBER(int, buffer_id) |
36 IPC_STRUCT_MEMBER(base::TimeDelta, timestamp) | 26 IPC_STRUCT_MEMBER(base::TimeDelta, timestamp) |
37 IPC_STRUCT_MEMBER(base::DictionaryValue, metadata) | 27 IPC_STRUCT_MEMBER(base::DictionaryValue, metadata) |
38 IPC_STRUCT_MEMBER(media::VideoPixelFormat, pixel_format) | 28 IPC_STRUCT_MEMBER(media::VideoPixelFormat, pixel_format) |
39 IPC_STRUCT_MEMBER(media::VideoFrame::StorageType, storage_type) | 29 IPC_STRUCT_MEMBER(media::VideoFrame::StorageType, storage_type) |
40 IPC_STRUCT_MEMBER(gfx::Size, coded_size) | 30 IPC_STRUCT_MEMBER(gfx::Size, coded_size) |
41 IPC_STRUCT_MEMBER(gfx::Rect, visible_rect) | 31 IPC_STRUCT_MEMBER(gfx::Rect, visible_rect) |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 IPC_MESSAGE_CONTROL2(VideoCaptureMsg_DeviceSupportedFormatsEnumerated, | 71 IPC_MESSAGE_CONTROL2(VideoCaptureMsg_DeviceSupportedFormatsEnumerated, |
82 int /* device_id */, | 72 int /* device_id */, |
83 media::VideoCaptureFormats /* supported_formats */) | 73 media::VideoCaptureFormats /* supported_formats */) |
84 | 74 |
85 // Notify the renderer about a device's format(s) in use; this is a response | 75 // Notify the renderer about a device's format(s) in use; this is a response |
86 // to a VideoCaptureHostMsg_GetDeviceFormatInUse request. | 76 // to a VideoCaptureHostMsg_GetDeviceFormatInUse request. |
87 IPC_MESSAGE_CONTROL2(VideoCaptureMsg_DeviceFormatsInUseReceived, | 77 IPC_MESSAGE_CONTROL2(VideoCaptureMsg_DeviceFormatsInUseReceived, |
88 int /* device_id */, | 78 int /* device_id */, |
89 media::VideoCaptureFormats /* formats_in_use */) | 79 media::VideoCaptureFormats /* formats_in_use */) |
90 | 80 |
91 // Start a video capture as |device_id|, a new id picked by the renderer | |
92 // process. The session to be started is determined by |params.session_id|. | |
93 IPC_MESSAGE_CONTROL3(VideoCaptureHostMsg_Start, | |
94 int /* device_id */, | |
95 media::VideoCaptureSessionId, /* session_id */ | |
96 media::VideoCaptureParams /* params */) | |
97 | |
98 // Resume the video capture specified by |device_id|, |session_id| and | |
99 // |params|. | |
100 IPC_MESSAGE_CONTROL3(VideoCaptureHostMsg_Resume, | |
101 int, /* device_id */ | |
102 media::VideoCaptureSessionId, /* session_id */ | |
103 media::VideoCaptureParams /* params */) | |
104 | |
105 // Tell the browser process that the renderer has finished reading from | 81 // Tell the browser process that the renderer has finished reading from |
106 // a buffer previously delivered by VideoCaptureMsg_BufferReady. | 82 // a buffer previously delivered by VideoCaptureMsg_BufferReady. |
107 IPC_MESSAGE_CONTROL4(VideoCaptureHostMsg_BufferReady, | 83 IPC_MESSAGE_CONTROL4(VideoCaptureHostMsg_BufferReady, |
108 int /* device_id */, | 84 int /* device_id */, |
109 int /* buffer_id */, | 85 int /* buffer_id */, |
110 gpu::SyncToken /* sync_token */, | 86 gpu::SyncToken /* sync_token */, |
111 double /* consumer_resource_utilization */) | 87 double /* consumer_resource_utilization */) |
112 | 88 |
113 // Get the formats supported by a device referenced by |capture_session_id|. | 89 // Get the formats supported by a device referenced by |capture_session_id|. |
114 IPC_MESSAGE_CONTROL2(VideoCaptureHostMsg_GetDeviceSupportedFormats, | 90 IPC_MESSAGE_CONTROL2(VideoCaptureHostMsg_GetDeviceSupportedFormats, |
115 int /* device_id */, | 91 int /* device_id */, |
116 media::VideoCaptureSessionId /* session_id */) | 92 media::VideoCaptureSessionId /* session_id */) |
117 | 93 |
118 // Get the format(s) in use by a device referenced by |capture_session_id|. | 94 // Get the format(s) in use by a device referenced by |capture_session_id|. |
119 IPC_MESSAGE_CONTROL2(VideoCaptureHostMsg_GetDeviceFormatsInUse, | 95 IPC_MESSAGE_CONTROL2(VideoCaptureHostMsg_GetDeviceFormatsInUse, |
120 int /* device_id */, | 96 int /* device_id */, |
121 media::VideoCaptureSessionId /* session_id */) | 97 media::VideoCaptureSessionId /* session_id */) |
OLD | NEW |