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
3 // found in the LICENSE file.
5 // IPC messages for the Cast transport API.
6 // Multiply-included message file, hence no include guard.
8 #include "ipc/ipc_message_macros.h"
9 #include "media/cast/cast_sender.h"
10 #include "media/cast/rtcp/rtcp_defines.h"
11 #include "media/cast/transport/cast_transport_sender.h"
12 #include "net/base/ip_endpoint.h"
13 #include "net/base/net_util.h"
15 #undef IPC_MESSAGE_EXPORT
16 #define IPC_MESSAGE_EXPORT
17 #define IPC_MESSAGE_START CastMsgStart
19 IPC_ENUM_TRAITS(media::cast::transport::AudioCodec)
20 IPC_ENUM_TRAITS(media::cast::transport::VideoCodec)
21 IPC_ENUM_TRAITS(media::cast::transport::RtcpSenderFrameStatus)
22 IPC_ENUM_TRAITS(media::cast::transport::CastTransportStatus)
24 IPC_STRUCT_TRAITS_BEGIN(media::cast::transport::EncodedAudioFrame)
25 IPC_STRUCT_TRAITS_MEMBER(codec)
26 IPC_STRUCT_TRAITS_MEMBER(frame_id)
27 IPC_STRUCT_TRAITS_MEMBER(rtp_timestamp)
28 IPC_STRUCT_TRAITS_MEMBER(data)
29 IPC_STRUCT_TRAITS_END()
31 IPC_STRUCT_TRAITS_BEGIN(media::cast::transport::EncodedVideoFrame)
32 IPC_STRUCT_TRAITS_MEMBER(codec)
33 IPC_STRUCT_TRAITS_MEMBER(key_frame)
34 IPC_STRUCT_TRAITS_MEMBER(frame_id)
35 IPC_STRUCT_TRAITS_MEMBER(last_referenced_frame_id)
36 IPC_STRUCT_TRAITS_MEMBER(data)
37 IPC_STRUCT_TRAITS_END()
39 IPC_STRUCT_TRAITS_BEGIN(media::cast::transport::RtcpSenderInfo)
40 IPC_STRUCT_TRAITS_MEMBER(ntp_seconds)
41 IPC_STRUCT_TRAITS_MEMBER(ntp_fraction)
42 IPC_STRUCT_TRAITS_MEMBER(rtp_timestamp)
43 IPC_STRUCT_TRAITS_MEMBER(send_packet_count)
44 IPC_STRUCT_TRAITS_MEMBER(send_octet_count)
45 IPC_STRUCT_TRAITS_END()
47 IPC_STRUCT_TRAITS_BEGIN(media::cast::transport::RtcpDlrrReportBlock)
48 IPC_STRUCT_TRAITS_MEMBER(last_rr)
49 IPC_STRUCT_TRAITS_MEMBER(delay_since_last_rr)
50 IPC_STRUCT_TRAITS_END()
52 IPC_STRUCT_TRAITS_BEGIN(media::cast::transport::RtcpSenderFrameLogMessage)
53 IPC_STRUCT_TRAITS_MEMBER(frame_status)
54 IPC_STRUCT_TRAITS_MEMBER(rtp_timestamp)
55 IPC_STRUCT_TRAITS_END()
57 IPC_STRUCT_TRAITS_BEGIN(media::cast::transport::RtpConfig)
58 IPC_STRUCT_TRAITS_MEMBER(history_ms)
59 IPC_STRUCT_TRAITS_MEMBER(max_delay_ms)
60 IPC_STRUCT_TRAITS_MEMBER(payload_type)
61 IPC_STRUCT_TRAITS_END()
63 IPC_STRUCT_TRAITS_BEGIN(media::cast::transport::CastTransportConfig)
64 IPC_STRUCT_TRAITS_MEMBER(receiver_endpoint)
65 IPC_STRUCT_TRAITS_MEMBER(local_endpoint)
66 IPC_STRUCT_TRAITS_MEMBER(audio_ssrc)
67 IPC_STRUCT_TRAITS_MEMBER(video_ssrc)
68 IPC_STRUCT_TRAITS_MEMBER(video_codec)
69 IPC_STRUCT_TRAITS_MEMBER(audio_codec)
70 IPC_STRUCT_TRAITS_MEMBER(audio_frequency)
71 IPC_STRUCT_TRAITS_MEMBER(audio_channels)
72 IPC_STRUCT_TRAITS_MEMBER(audio_rtp_config)
73 IPC_STRUCT_TRAITS_MEMBER(video_rtp_config)
74 IPC_STRUCT_TRAITS_MEMBER(aes_key)
75 IPC_STRUCT_TRAITS_MEMBER(aes_iv_mask)
76 IPC_STRUCT_TRAITS_END()
78 IPC_STRUCT_TRAITS_BEGIN(media::cast::transport::SendRtcpFromRtpSenderData)
79 IPC_STRUCT_TRAITS_MEMBER(packet_type_flags)
80 IPC_STRUCT_TRAITS_MEMBER(sending_ssrc)
81 IPC_STRUCT_TRAITS_MEMBER(c_name)
82 IPC_STRUCT_TRAITS_END()
85 // Cast messages sent from the browser to the renderer.
87 IPC_MESSAGE_CONTROL2(CastMsg_ReceivedPacket,
88 int32 /* channel_id */,
89 media::cast::Packet /* packet */);
92 CastMsg_NotifyStatusChange,
93 int32 /* channel_id */,
94 media::cast::transport::CastTransportStatus /* status */);
97 CastMsg_RtpStatistics,
98 int32 /* channel_id */,
100 media::cast::transport::RtcpSenderInfo /* sender_info */,
101 base::TimeTicks /* time_sent */,
102 uint32 /* rtp_timestamp */);
105 // Cast messages sent from the renderer to the browser.
107 IPC_MESSAGE_CONTROL3(
108 CastHostMsg_InsertCodedAudioFrame,
109 int32 /* channel_id */,
110 media::cast::transport::EncodedAudioFrame /* audio_frame */,
111 base::TimeTicks /* recorded_time */)
113 IPC_MESSAGE_CONTROL3(
114 CastHostMsg_InsertCodedVideoFrame,
115 int32 /* channel_id */,
116 media::cast::transport::EncodedVideoFrame /* video_frame */,
117 base::TimeTicks /* recorded_time */)
119 IPC_MESSAGE_CONTROL5(
120 CastHostMsg_SendRtcpFromRtpSender,
121 int32 /* channel_id */,
122 media::cast::transport::SendRtcpFromRtpSenderData /* flags, ssrc, name */,
123 media::cast::transport::RtcpSenderInfo /* sender_info */,
124 media::cast::transport::RtcpDlrrReportBlock /* dlrr */,
125 media::cast::transport::RtcpSenderLogMessage /* sender_log */)
127 IPC_MESSAGE_CONTROL3(
128 CastHostMsg_ResendPackets,
129 int32 /* channel_id */,
131 media::cast::MissingFramesAndPacketsMap /* missing_packets */)
133 IPC_MESSAGE_CONTROL2(
135 int32 /* channel_id */,
136 media::cast::transport::CastTransportConfig /* config */);
138 IPC_MESSAGE_CONTROL1(
140 int32 /* channel_id */);