| 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 // IPC messages for the media streaming. | 5 // IPC messages for the media streaming. |
| 6 // Multiply-included message file, hence no include guard. | 6 // Multiply-included message file, hence no include guard. |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
| 11 #include "content/common/media/media_stream_options.h" | 11 #include "content/common/media/media_stream_options.h" |
| 12 #include "googleurl/src/gurl.h" | 12 #include "googleurl/src/gurl.h" |
| 13 #include "ipc/ipc_message_macros.h" | 13 #include "ipc/ipc_message_macros.h" |
| 14 | 14 |
| 15 #undef IPC_MESSAGE_EXPORT | 15 #undef IPC_MESSAGE_EXPORT |
| 16 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT | 16 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT |
| 17 #define IPC_MESSAGE_START MediaStreamMsgStart | 17 #define IPC_MESSAGE_START MediaStreamMsgStart |
| 18 | 18 |
| 19 IPC_ENUM_TRAITS(media_stream::MediaStreamType) | 19 IPC_ENUM_TRAITS(content::MediaStreamType) |
| 20 | 20 |
| 21 IPC_STRUCT_TRAITS_BEGIN(media_stream::StreamOptions) | 21 IPC_STRUCT_TRAITS_BEGIN(content::StreamOptions) |
| 22 IPC_STRUCT_TRAITS_MEMBER(audio_type) | 22 IPC_STRUCT_TRAITS_MEMBER(audio_type) |
| 23 IPC_STRUCT_TRAITS_MEMBER(audio_device_id) | 23 IPC_STRUCT_TRAITS_MEMBER(audio_device_id) |
| 24 IPC_STRUCT_TRAITS_MEMBER(video_type) | 24 IPC_STRUCT_TRAITS_MEMBER(video_type) |
| 25 IPC_STRUCT_TRAITS_MEMBER(video_device_id) | 25 IPC_STRUCT_TRAITS_MEMBER(video_device_id) |
| 26 IPC_STRUCT_TRAITS_END() | 26 IPC_STRUCT_TRAITS_END() |
| 27 | 27 |
| 28 IPC_STRUCT_TRAITS_BEGIN(media_stream::StreamDeviceInfo) | 28 IPC_STRUCT_TRAITS_BEGIN(content::StreamDeviceInfo) |
| 29 IPC_STRUCT_TRAITS_MEMBER(stream_type) | 29 IPC_STRUCT_TRAITS_MEMBER(stream_type) |
| 30 IPC_STRUCT_TRAITS_MEMBER(name) | 30 IPC_STRUCT_TRAITS_MEMBER(name) |
| 31 IPC_STRUCT_TRAITS_MEMBER(device_id) | 31 IPC_STRUCT_TRAITS_MEMBER(device_id) |
| 32 IPC_STRUCT_TRAITS_MEMBER(in_use) | 32 IPC_STRUCT_TRAITS_MEMBER(in_use) |
| 33 IPC_STRUCT_TRAITS_MEMBER(session_id) | 33 IPC_STRUCT_TRAITS_MEMBER(session_id) |
| 34 IPC_STRUCT_TRAITS_END() | 34 IPC_STRUCT_TRAITS_END() |
| 35 | 35 |
| 36 // Message sent from the browser to the renderer | 36 // Message sent from the browser to the renderer |
| 37 | 37 |
| 38 // The browser has generated a stream successfully. | 38 // The browser has generated a stream successfully. |
| 39 IPC_MESSAGE_ROUTED4(MediaStreamMsg_StreamGenerated, | 39 IPC_MESSAGE_ROUTED4(MediaStreamMsg_StreamGenerated, |
| 40 int /* request id */, | 40 int /* request id */, |
| 41 std::string /* label */, | 41 std::string /* label */, |
| 42 media_stream::StreamDeviceInfoArray /* audio_device_list */, | 42 content::StreamDeviceInfoArray /* audio_device_list */, |
| 43 media_stream::StreamDeviceInfoArray /* video_device_list */) | 43 content::StreamDeviceInfoArray /* video_device_list */) |
| 44 | 44 |
| 45 // The browser has failed to generate a stream. | 45 // The browser has failed to generate a stream. |
| 46 IPC_MESSAGE_ROUTED1(MediaStreamMsg_StreamGenerationFailed, | 46 IPC_MESSAGE_ROUTED1(MediaStreamMsg_StreamGenerationFailed, |
| 47 int /* request id */) | 47 int /* request id */) |
| 48 | 48 |
| 49 // The browser has enumerated devices successfully. | 49 // The browser has enumerated devices successfully. |
| 50 IPC_MESSAGE_ROUTED3(MediaStreamMsg_DevicesEnumerated, | 50 IPC_MESSAGE_ROUTED3(MediaStreamMsg_DevicesEnumerated, |
| 51 int /* request id */, | 51 int /* request id */, |
| 52 std::string /* label */, | 52 std::string /* label */, |
| 53 media_stream::StreamDeviceInfoArray /* device_list */) | 53 content::StreamDeviceInfoArray /* device_list */) |
| 54 | 54 |
| 55 // The browser has failed to enumerate devices. | 55 // The browser has failed to enumerate devices. |
| 56 IPC_MESSAGE_ROUTED1(MediaStreamMsg_DevicesEnumerationFailed, | 56 IPC_MESSAGE_ROUTED1(MediaStreamMsg_DevicesEnumerationFailed, |
| 57 int /* request id */) | 57 int /* request id */) |
| 58 | 58 |
| 59 // TODO(wjia): should DeviceOpen* messages be merged with | 59 // TODO(wjia): should DeviceOpen* messages be merged with |
| 60 // StreamGenerat* ones? | 60 // StreamGenerat* ones? |
| 61 // The browser has opened a device successfully. | 61 // The browser has opened a device successfully. |
| 62 IPC_MESSAGE_ROUTED3(MediaStreamMsg_DeviceOpened, | 62 IPC_MESSAGE_ROUTED3(MediaStreamMsg_DeviceOpened, |
| 63 int /* request id */, | 63 int /* request id */, |
| 64 std::string /* label */, | 64 std::string /* label */, |
| 65 media_stream::StreamDeviceInfo /* the device */) | 65 content::StreamDeviceInfo /* the device */) |
| 66 | 66 |
| 67 // The browser has failed to open a device. | 67 // The browser has failed to open a device. |
| 68 IPC_MESSAGE_ROUTED1(MediaStreamMsg_DeviceOpenFailed, | 68 IPC_MESSAGE_ROUTED1(MediaStreamMsg_DeviceOpenFailed, |
| 69 int /* request id */) | 69 int /* request id */) |
| 70 | 70 |
| 71 // Messages sent from the renderer to the browser. | 71 // Messages sent from the renderer to the browser. |
| 72 | 72 |
| 73 // Request a new media stream. | 73 // Request a new media stream. |
| 74 IPC_MESSAGE_CONTROL4(MediaStreamHostMsg_GenerateStream, | 74 IPC_MESSAGE_CONTROL4(MediaStreamHostMsg_GenerateStream, |
| 75 int /* render view id */, | 75 int /* render view id */, |
| 76 int /* request id */, | 76 int /* request id */, |
| 77 media_stream::StreamOptions /* components */, | 77 content::StreamOptions /* components */, |
| 78 GURL /* security origin */) | 78 GURL /* security origin */) |
| 79 | 79 |
| 80 // Request to cancel the request for a new media stream. | 80 // Request to cancel the request for a new media stream. |
| 81 IPC_MESSAGE_CONTROL2(MediaStreamHostMsg_CancelGenerateStream, | 81 IPC_MESSAGE_CONTROL2(MediaStreamHostMsg_CancelGenerateStream, |
| 82 int /* render view id */, | 82 int /* render view id */, |
| 83 int /* request id */) | 83 int /* request id */) |
| 84 | 84 |
| 85 // Request to stop streaming from the media stream. | 85 // Request to stop streaming from the media stream. |
| 86 IPC_MESSAGE_CONTROL2(MediaStreamHostMsg_StopGeneratedStream, | 86 IPC_MESSAGE_CONTROL2(MediaStreamHostMsg_StopGeneratedStream, |
| 87 int /* render view id */, | 87 int /* render view id */, |
| 88 std::string /* label */) | 88 std::string /* label */) |
| 89 | 89 |
| 90 // Request to enumerate devices. | 90 // Request to enumerate devices. |
| 91 IPC_MESSAGE_CONTROL4(MediaStreamHostMsg_EnumerateDevices, | 91 IPC_MESSAGE_CONTROL4(MediaStreamHostMsg_EnumerateDevices, |
| 92 int /* render view id */, | 92 int /* render view id */, |
| 93 int /* request id */, | 93 int /* request id */, |
| 94 media_stream::MediaStreamType /* type */, | 94 content::MediaStreamType /* type */, |
| 95 GURL /* security origin */) | 95 GURL /* security origin */) |
| 96 | 96 |
| 97 // Request to open the device. | 97 // Request to open the device. |
| 98 IPC_MESSAGE_CONTROL5(MediaStreamHostMsg_OpenDevice, | 98 IPC_MESSAGE_CONTROL5(MediaStreamHostMsg_OpenDevice, |
| 99 int /* render view id */, | 99 int /* render view id */, |
| 100 int /* request id */, | 100 int /* request id */, |
| 101 std::string /* device_id */, | 101 std::string /* device_id */, |
| 102 media_stream::MediaStreamType /* type */, | 102 content::MediaStreamType /* type */, |
| 103 GURL /* security origin */) | 103 GURL /* security origin */) |
| OLD | NEW |