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 #ifndef CHROME_RENDERER_MEDIA_CAST_TRANSPORT_SENDER_IPC_H_ | 5 #ifndef CHROME_RENDERER_MEDIA_CAST_TRANSPORT_SENDER_IPC_H_ |
6 #define CHROME_RENDERER_MEDIA_CAST_TRANSPORT_SENDER_IPC_H_ | 6 #define CHROME_RENDERER_MEDIA_CAST_TRANSPORT_SENDER_IPC_H_ |
7 | 7 |
| 8 #include <stdint.h> |
| 9 |
8 #include <map> | 10 #include <map> |
9 | 11 |
| 12 #include "base/macros.h" |
10 #include "base/thread_task_runner_handle.h" | 13 #include "base/thread_task_runner_handle.h" |
11 #include "ipc/ipc_channel_proxy.h" | 14 #include "ipc/ipc_channel_proxy.h" |
12 #include "media/cast/logging/logging_defines.h" | 15 #include "media/cast/logging/logging_defines.h" |
13 #include "media/cast/net/cast_transport_sender.h" | 16 #include "media/cast/net/cast_transport_sender.h" |
14 | 17 |
15 // This implementation of the CastTransportSender interface | 18 // This implementation of the CastTransportSender interface |
16 // communicates with the browser process over IPC and relays | 19 // communicates with the browser process over IPC and relays |
17 // all calls to/from the transport sender to the browser process. | 20 // all calls to/from the transport sender to the browser process. |
18 // The primary reason for this arrangement is to give the | 21 // The primary reason for this arrangement is to give the |
19 // renderer less direct control over the UDP sockets. | 22 // renderer less direct control over the UDP sockets. |
(...skipping 12 matching lines...) Expand all Loading... |
32 | 35 |
33 // media::cast::CastTransportSender implementation. | 36 // media::cast::CastTransportSender implementation. |
34 void InitializeAudio( | 37 void InitializeAudio( |
35 const media::cast::CastTransportRtpConfig& config, | 38 const media::cast::CastTransportRtpConfig& config, |
36 const media::cast::RtcpCastMessageCallback& cast_message_cb, | 39 const media::cast::RtcpCastMessageCallback& cast_message_cb, |
37 const media::cast::RtcpRttCallback& rtt_cb) override; | 40 const media::cast::RtcpRttCallback& rtt_cb) override; |
38 void InitializeVideo( | 41 void InitializeVideo( |
39 const media::cast::CastTransportRtpConfig& config, | 42 const media::cast::CastTransportRtpConfig& config, |
40 const media::cast::RtcpCastMessageCallback& cast_message_cb, | 43 const media::cast::RtcpCastMessageCallback& cast_message_cb, |
41 const media::cast::RtcpRttCallback& rtt_cb) override; | 44 const media::cast::RtcpRttCallback& rtt_cb) override; |
42 void InsertFrame(uint32 ssrc, | 45 void InsertFrame(uint32_t ssrc, |
43 const media::cast::EncodedFrame& frame) override; | 46 const media::cast::EncodedFrame& frame) override; |
44 void SendSenderReport(uint32 ssrc, | 47 void SendSenderReport(uint32_t ssrc, |
45 base::TimeTicks current_time, | 48 base::TimeTicks current_time, |
46 uint32 current_time_as_rtp_timestamp) override; | 49 uint32_t current_time_as_rtp_timestamp) override; |
47 void CancelSendingFrames(uint32 ssrc, | 50 void CancelSendingFrames(uint32_t ssrc, |
48 const std::vector<uint32>& frame_ids) override; | 51 const std::vector<uint32_t>& frame_ids) override; |
49 void ResendFrameForKickstart(uint32 ssrc, uint32 frame_id) override; | 52 void ResendFrameForKickstart(uint32_t ssrc, uint32_t frame_id) override; |
50 void AddValidSsrc(uint32 ssrc) override; | 53 void AddValidSsrc(uint32_t ssrc) override; |
51 void SendRtcpFromRtpReceiver( | 54 void SendRtcpFromRtpReceiver( |
52 uint32 ssrc, | 55 uint32_t ssrc, |
53 uint32 sender_ssrc, | 56 uint32_t sender_ssrc, |
54 const media::cast::RtcpTimeData& time_data, | 57 const media::cast::RtcpTimeData& time_data, |
55 const media::cast::RtcpCastMessage* cast_message, | 58 const media::cast::RtcpCastMessage* cast_message, |
56 base::TimeDelta target_delay, | 59 base::TimeDelta target_delay, |
57 const media::cast::ReceiverRtcpEventSubscriber::RtcpEvents* | 60 const media::cast::ReceiverRtcpEventSubscriber::RtcpEvents* rtcp_events, |
58 rtcp_events, | |
59 const media::cast::RtpReceiverStatistics* rtp_receiver_statistics) | 61 const media::cast::RtpReceiverStatistics* rtp_receiver_statistics) |
60 override; | 62 override; |
61 | 63 |
62 void OnNotifyStatusChange( | 64 void OnNotifyStatusChange( |
63 media::cast::CastTransportStatus status); | 65 media::cast::CastTransportStatus status); |
64 void OnRawEvents(const std::vector<media::cast::PacketEvent>& packet_events, | 66 void OnRawEvents(const std::vector<media::cast::PacketEvent>& packet_events, |
65 const std::vector<media::cast::FrameEvent>& frame_events); | 67 const std::vector<media::cast::FrameEvent>& frame_events); |
66 void OnRtt(uint32 ssrc, base::TimeDelta rtt); | 68 void OnRtt(uint32_t ssrc, base::TimeDelta rtt); |
67 void OnRtcpCastMessage(uint32 ssrc, | 69 void OnRtcpCastMessage(uint32_t ssrc, |
68 const media::cast::RtcpCastMessage& cast_message); | 70 const media::cast::RtcpCastMessage& cast_message); |
69 void OnReceivedPacket(const media::cast::Packet& packet); | 71 void OnReceivedPacket(const media::cast::Packet& packet); |
70 | 72 |
71 private: | 73 private: |
72 struct ClientCallbacks { | 74 struct ClientCallbacks { |
73 ClientCallbacks(); | 75 ClientCallbacks(); |
74 ~ClientCallbacks(); | 76 ~ClientCallbacks(); |
75 | 77 |
76 media::cast::RtcpCastMessageCallback cast_message_cb; | 78 media::cast::RtcpCastMessageCallback cast_message_cb; |
77 media::cast::RtcpRttCallback rtt_cb; | 79 media::cast::RtcpRttCallback rtt_cb; |
78 }; | 80 }; |
79 | 81 |
80 void Send(IPC::Message* message); | 82 void Send(IPC::Message* message); |
81 | 83 |
82 int32 channel_id_; | 84 int32_t channel_id_; |
83 media::cast::PacketReceiverCallback packet_callback_; | 85 media::cast::PacketReceiverCallback packet_callback_; |
84 media::cast::CastTransportStatusCallback status_callback_; | 86 media::cast::CastTransportStatusCallback status_callback_; |
85 media::cast::BulkRawEventsCallback raw_events_callback_; | 87 media::cast::BulkRawEventsCallback raw_events_callback_; |
86 typedef std::map<uint32, ClientCallbacks> ClientMap; | 88 typedef std::map<uint32_t, ClientCallbacks> ClientMap; |
87 ClientMap clients_; | 89 ClientMap clients_; |
88 | 90 |
89 DISALLOW_COPY_AND_ASSIGN(CastTransportSenderIPC); | 91 DISALLOW_COPY_AND_ASSIGN(CastTransportSenderIPC); |
90 }; | 92 }; |
91 | 93 |
92 #endif // CHROME_RENDERER_MEDIA_CAST_TRANSPORT_SENDER_IPC_H_ | 94 #endif // CHROME_RENDERER_MEDIA_CAST_TRANSPORT_SENDER_IPC_H_ |
OLD | NEW |