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. | 6 // Multiply-included message file, hence no include guard. |
Irfan
2015/12/09 21:24:27
Perhaps remove this comment given it does not appl
miu
2015/12/10 00:38:36
Done. I've kept the comment I added on line 47 th
Irfan
2015/12/10 01:40:37
Thanks for explaining
| |
7 | 7 |
8 #include "ipc/ipc_message_macros.h" | 8 #include "ipc/ipc_message_macros.h" |
9 #include "media/cast/cast_sender.h" | 9 #include "media/cast/cast_sender.h" |
10 #include "media/cast/common/rtp_time.h" | |
10 #include "media/cast/logging/logging_defines.h" | 11 #include "media/cast/logging/logging_defines.h" |
11 #include "media/cast/net/cast_transport_sender.h" | 12 #include "media/cast/net/cast_transport_sender.h" |
12 #include "media/cast/net/rtcp/rtcp_defines.h" | 13 #include "media/cast/net/rtcp/rtcp_defines.h" |
13 #include "net/base/ip_endpoint.h" | 14 #include "net/base/ip_endpoint.h" |
14 | 15 |
16 #ifndef CHROME_COMMON_CAST_MESSAGES_H_ | |
17 #define CHROME_COMMON_CAST_MESSAGES_H_ | |
18 | |
19 template<> | |
20 struct IPC::ParamTraits<media::cast::RtpTimeTicks> { | |
Irfan
2015/12/09 21:24:27
I wonder if this belongs to its own header ?
miu
2015/12/10 00:38:36
I looked at a number of examples elsewhere, and th
| |
21 using param_type = media::cast::RtpTimeTicks; | |
22 | |
23 static void Write(Message* m, const param_type& p) { | |
24 auto serialized = p.SerializeForIPC(); | |
25 IPC::ParamTraits<decltype(serialized)>::Write(m, serialized); | |
26 } | |
27 | |
28 static bool Read(const Message* m, base::PickleIterator* iter, | |
29 param_type* r) { | |
30 decltype(r->SerializeForIPC()) serialized; | |
31 if (IPC::ParamTraits<decltype(serialized)>::Read(m, iter, &serialized)) { | |
32 *r = param_type::DeserializeForIPC(serialized); | |
33 return true; | |
34 } | |
35 return false; | |
36 } | |
37 | |
38 static void Log(const param_type& p, std::string* l) { | |
39 std::ostringstream oss; | |
40 oss << p; | |
41 l->append(oss.str()); | |
42 } | |
43 }; | |
44 | |
45 #endif // CHROME_COMMON_CAST_MESSAGES_H_ | |
46 | |
47 // Multiply-included message file, hence no include guard from here. | |
48 | |
15 #undef IPC_MESSAGE_EXPORT | 49 #undef IPC_MESSAGE_EXPORT |
16 #define IPC_MESSAGE_EXPORT | 50 #define IPC_MESSAGE_EXPORT |
17 #define IPC_MESSAGE_START CastMsgStart | 51 #define IPC_MESSAGE_START CastMsgStart |
18 | 52 |
19 IPC_ENUM_TRAITS_MAX_VALUE( | 53 IPC_ENUM_TRAITS_MAX_VALUE( |
20 media::cast::EncodedFrame::Dependency, | 54 media::cast::EncodedFrame::Dependency, |
21 media::cast::EncodedFrame::DEPENDENCY_LAST) | 55 media::cast::EncodedFrame::DEPENDENCY_LAST) |
22 IPC_ENUM_TRAITS_MAX_VALUE(media::cast::Codec, | 56 IPC_ENUM_TRAITS_MAX_VALUE(media::cast::Codec, |
23 media::cast::CODEC_LAST) | 57 media::cast::CODEC_LAST) |
24 IPC_ENUM_TRAITS_MAX_VALUE(media::cast::CastTransportStatus, | 58 IPC_ENUM_TRAITS_MAX_VALUE(media::cast::CastTransportStatus, |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
154 CastHostMsg_InsertFrame, | 188 CastHostMsg_InsertFrame, |
155 int32 /* channel_id */, | 189 int32 /* channel_id */, |
156 uint32 /* ssrc */, | 190 uint32 /* ssrc */, |
157 media::cast::EncodedFrame /* audio/video frame */) | 191 media::cast::EncodedFrame /* audio/video frame */) |
158 | 192 |
159 IPC_MESSAGE_CONTROL4( | 193 IPC_MESSAGE_CONTROL4( |
160 CastHostMsg_SendSenderReport, | 194 CastHostMsg_SendSenderReport, |
161 int32 /* channel_id */, | 195 int32 /* channel_id */, |
162 uint32 /* ssrc */, | 196 uint32 /* ssrc */, |
163 base::TimeTicks /* current_time */, | 197 base::TimeTicks /* current_time */, |
164 uint32 /* current_time_as_rtp_timestamp */) | 198 media::cast::RtpTimeTicks /* current_time_as_rtp_timestamp */) |
165 | 199 |
166 IPC_MESSAGE_CONTROL3( | 200 IPC_MESSAGE_CONTROL3( |
167 CastHostMsg_CancelSendingFrames, | 201 CastHostMsg_CancelSendingFrames, |
168 int32 /* channel_id */, | 202 int32 /* channel_id */, |
169 uint32 /* ssrc */, | 203 uint32 /* ssrc */, |
170 std::vector<uint32> /* frame_ids */) | 204 std::vector<uint32> /* frame_ids */) |
171 | 205 |
172 IPC_MESSAGE_CONTROL3( | 206 IPC_MESSAGE_CONTROL3( |
173 CastHostMsg_ResendFrameForKickstart, | 207 CastHostMsg_ResendFrameForKickstart, |
174 int32 /* channel_id */, | 208 int32 /* channel_id */, |
(...skipping 13 matching lines...) Expand all Loading... | |
188 IPC_MESSAGE_CONTROL4( | 222 IPC_MESSAGE_CONTROL4( |
189 CastHostMsg_New, | 223 CastHostMsg_New, |
190 int32 /* channel_id */, | 224 int32 /* channel_id */, |
191 net::IPEndPoint /* local_end_point */, | 225 net::IPEndPoint /* local_end_point */, |
192 net::IPEndPoint /* remote_end_point */, | 226 net::IPEndPoint /* remote_end_point */, |
193 base::DictionaryValue /* options */) | 227 base::DictionaryValue /* options */) |
194 | 228 |
195 IPC_MESSAGE_CONTROL1( | 229 IPC_MESSAGE_CONTROL1( |
196 CastHostMsg_Delete, | 230 CastHostMsg_Delete, |
197 int32 /* channel_id */) | 231 int32 /* channel_id */) |
OLD | NEW |