Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Side by Side Diff: chrome/renderer/media/cast_transport_sender_ipc.cc

Issue 532373003: [Cast] RTT clean-up to the max! (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove RTT accessors in FrameSender (not needed post-refactor). Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/renderer/media/cast_transport_sender_ipc.h ('k') | media/cast/cast_defines.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "chrome/renderer/media/cast_transport_sender_ipc.h" 5 #include "chrome/renderer/media/cast_transport_sender_ipc.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/id_map.h" 8 #include "base/id_map.h"
9 #include "chrome/common/cast_messages.h" 9 #include "chrome/common/cast_messages.h"
10 #include "chrome/renderer/media/cast_ipc_dispatcher.h" 10 #include "chrome/renderer/media/cast_ipc_dispatcher.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 media::cast::CastTransportStatus status) { 83 media::cast::CastTransportStatus status) {
84 status_callback_.Run(status); 84 status_callback_.Run(status);
85 } 85 }
86 86
87 void CastTransportSenderIPC::OnRawEvents( 87 void CastTransportSenderIPC::OnRawEvents(
88 const std::vector<media::cast::PacketEvent>& packet_events, 88 const std::vector<media::cast::PacketEvent>& packet_events,
89 const std::vector<media::cast::FrameEvent>& frame_events) { 89 const std::vector<media::cast::FrameEvent>& frame_events) {
90 raw_events_callback_.Run(packet_events, frame_events); 90 raw_events_callback_.Run(packet_events, frame_events);
91 } 91 }
92 92
93 void CastTransportSenderIPC::OnRtt( 93 void CastTransportSenderIPC::OnRtt(uint32 ssrc, base::TimeDelta rtt) {
94 uint32 ssrc,
95 const media::cast::RtcpRttReport& rtt_report) {
96 ClientMap::iterator it = clients_.find(ssrc); 94 ClientMap::iterator it = clients_.find(ssrc);
97 if (it == clients_.end()) { 95 if (it == clients_.end()) {
98 LOG(ERROR) << "Received RTT report from for unknown SSRC: " << ssrc; 96 LOG(ERROR) << "Received RTT report from for unknown SSRC: " << ssrc;
99 return; 97 return;
100 } 98 }
101 if (it->second.rtt_cb.is_null()) 99 if (!it->second.rtt_cb.is_null())
102 return; 100 it->second.rtt_cb.Run(rtt);
103 it->second.rtt_cb.Run(
104 rtt_report.rtt,
105 rtt_report.avg_rtt,
106 rtt_report.min_rtt,
107 rtt_report.max_rtt);
108 } 101 }
109 102
110 void CastTransportSenderIPC::OnRtcpCastMessage( 103 void CastTransportSenderIPC::OnRtcpCastMessage(
111 uint32 ssrc, 104 uint32 ssrc,
112 const media::cast::RtcpCastMessage& cast_message) { 105 const media::cast::RtcpCastMessage& cast_message) {
113 ClientMap::iterator it = clients_.find(ssrc); 106 ClientMap::iterator it = clients_.find(ssrc);
114 if (it == clients_.end()) { 107 if (it == clients_.end()) {
115 LOG(ERROR) << "Received cast message from for unknown SSRC: " << ssrc; 108 LOG(ERROR) << "Received cast message from for unknown SSRC: " << ssrc;
116 return; 109 return;
117 } 110 }
118 if (it->second.cast_message_cb.is_null()) 111 if (it->second.cast_message_cb.is_null())
119 return; 112 return;
120 it->second.cast_message_cb.Run(cast_message); 113 it->second.cast_message_cb.Run(cast_message);
121 } 114 }
122 115
123 void CastTransportSenderIPC::Send(IPC::Message* message) { 116 void CastTransportSenderIPC::Send(IPC::Message* message) {
124 if (CastIPCDispatcher::Get()) { 117 if (CastIPCDispatcher::Get()) {
125 CastIPCDispatcher::Get()->Send(message); 118 CastIPCDispatcher::Get()->Send(message);
126 } else { 119 } else {
127 delete message; 120 delete message;
128 } 121 }
129 } 122 }
OLDNEW
« no previous file with comments | « chrome/renderer/media/cast_transport_sender_ipc.h ('k') | media/cast/cast_defines.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698