OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 Cast transport API. | 5 // IPC messages for the Cast transport API. |
6 // Multiply-included message file, hence no include guard. | |
7 | 6 |
8 #include "ipc/ipc_message_macros.h" | 7 #include "ipc/ipc_message_macros.h" |
9 #include "media/cast/cast_sender.h" | 8 #include "media/cast/cast_sender.h" |
| 9 #include "media/cast/common/rtp_time.h" |
10 #include "media/cast/logging/logging_defines.h" | 10 #include "media/cast/logging/logging_defines.h" |
11 #include "media/cast/net/cast_transport_sender.h" | 11 #include "media/cast/net/cast_transport_sender.h" |
12 #include "media/cast/net/rtcp/rtcp_defines.h" | 12 #include "media/cast/net/rtcp/rtcp_defines.h" |
13 #include "net/base/ip_endpoint.h" | 13 #include "net/base/ip_endpoint.h" |
14 | 14 |
| 15 #ifndef CHROME_COMMON_CAST_MESSAGES_H_ |
| 16 #define CHROME_COMMON_CAST_MESSAGES_H_ |
| 17 |
| 18 template<> |
| 19 struct IPC::ParamTraits<media::cast::RtpTimeTicks> { |
| 20 using param_type = media::cast::RtpTimeTicks; |
| 21 |
| 22 static void Write(Message* m, const param_type& p) { |
| 23 auto serialized = p.SerializeForIPC(); |
| 24 IPC::ParamTraits<decltype(serialized)>::Write(m, serialized); |
| 25 } |
| 26 |
| 27 static bool Read(const Message* m, base::PickleIterator* iter, |
| 28 param_type* r) { |
| 29 decltype(r->SerializeForIPC()) serialized; |
| 30 if (IPC::ParamTraits<decltype(serialized)>::Read(m, iter, &serialized)) { |
| 31 *r = param_type::DeserializeForIPC(serialized); |
| 32 return true; |
| 33 } |
| 34 return false; |
| 35 } |
| 36 |
| 37 static void Log(const param_type& p, std::string* l) { |
| 38 std::ostringstream oss; |
| 39 oss << p; |
| 40 l->append(oss.str()); |
| 41 } |
| 42 }; |
| 43 |
| 44 #endif // CHROME_COMMON_CAST_MESSAGES_H_ |
| 45 |
| 46 // Multiply-included message file, hence no include guard from here. |
| 47 |
15 #undef IPC_MESSAGE_EXPORT | 48 #undef IPC_MESSAGE_EXPORT |
16 #define IPC_MESSAGE_EXPORT | 49 #define IPC_MESSAGE_EXPORT |
17 #define IPC_MESSAGE_START CastMsgStart | 50 #define IPC_MESSAGE_START CastMsgStart |
18 | 51 |
19 IPC_ENUM_TRAITS_MAX_VALUE( | 52 IPC_ENUM_TRAITS_MAX_VALUE( |
20 media::cast::EncodedFrame::Dependency, | 53 media::cast::EncodedFrame::Dependency, |
21 media::cast::EncodedFrame::DEPENDENCY_LAST) | 54 media::cast::EncodedFrame::DEPENDENCY_LAST) |
22 IPC_ENUM_TRAITS_MAX_VALUE(media::cast::Codec, | 55 IPC_ENUM_TRAITS_MAX_VALUE(media::cast::Codec, |
23 media::cast::CODEC_LAST) | 56 media::cast::CODEC_LAST) |
24 IPC_ENUM_TRAITS_MAX_VALUE(media::cast::CastTransportStatus, | 57 IPC_ENUM_TRAITS_MAX_VALUE(media::cast::CastTransportStatus, |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 CastHostMsg_InsertFrame, | 187 CastHostMsg_InsertFrame, |
155 int32 /* channel_id */, | 188 int32 /* channel_id */, |
156 uint32 /* ssrc */, | 189 uint32 /* ssrc */, |
157 media::cast::EncodedFrame /* audio/video frame */) | 190 media::cast::EncodedFrame /* audio/video frame */) |
158 | 191 |
159 IPC_MESSAGE_CONTROL4( | 192 IPC_MESSAGE_CONTROL4( |
160 CastHostMsg_SendSenderReport, | 193 CastHostMsg_SendSenderReport, |
161 int32 /* channel_id */, | 194 int32 /* channel_id */, |
162 uint32 /* ssrc */, | 195 uint32 /* ssrc */, |
163 base::TimeTicks /* current_time */, | 196 base::TimeTicks /* current_time */, |
164 uint32 /* current_time_as_rtp_timestamp */) | 197 media::cast::RtpTimeTicks /* current_time_as_rtp_timestamp */) |
165 | 198 |
166 IPC_MESSAGE_CONTROL3( | 199 IPC_MESSAGE_CONTROL3( |
167 CastHostMsg_CancelSendingFrames, | 200 CastHostMsg_CancelSendingFrames, |
168 int32 /* channel_id */, | 201 int32 /* channel_id */, |
169 uint32 /* ssrc */, | 202 uint32 /* ssrc */, |
170 std::vector<uint32> /* frame_ids */) | 203 std::vector<uint32> /* frame_ids */) |
171 | 204 |
172 IPC_MESSAGE_CONTROL3( | 205 IPC_MESSAGE_CONTROL3( |
173 CastHostMsg_ResendFrameForKickstart, | 206 CastHostMsg_ResendFrameForKickstart, |
174 int32 /* channel_id */, | 207 int32 /* channel_id */, |
(...skipping 13 matching lines...) Expand all Loading... |
188 IPC_MESSAGE_CONTROL4( | 221 IPC_MESSAGE_CONTROL4( |
189 CastHostMsg_New, | 222 CastHostMsg_New, |
190 int32 /* channel_id */, | 223 int32 /* channel_id */, |
191 net::IPEndPoint /* local_end_point */, | 224 net::IPEndPoint /* local_end_point */, |
192 net::IPEndPoint /* remote_end_point */, | 225 net::IPEndPoint /* remote_end_point */, |
193 base::DictionaryValue /* options */) | 226 base::DictionaryValue /* options */) |
194 | 227 |
195 IPC_MESSAGE_CONTROL1( | 228 IPC_MESSAGE_CONTROL1( |
196 CastHostMsg_Delete, | 229 CastHostMsg_Delete, |
197 int32 /* channel_id */) | 230 int32 /* channel_id */) |
OLD | NEW |