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

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

Issue 281453003: Cast: Simplify code path for RTCP sender report (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merged Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « chrome/common/cast_messages.h ('k') | chrome/renderer/media/cast_transport_sender_ipc.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_ipc_dispatcher.h" 5 #include "chrome/renderer/media/cast_ipc_dispatcher.h"
6 6
7 #include "chrome/common/cast_messages.h" 7 #include "chrome/common/cast_messages.h"
8 #include "chrome/renderer/media/cast_transport_sender_ipc.h" 8 #include "chrome/renderer/media/cast_transport_sender_ipc.h"
9 #include "ipc/ipc_message_macros.h" 9 #include "ipc/ipc_message_macros.h"
10 10
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 void CastIPCDispatcher::RemoveSender(int32 channel_id) { 43 void CastIPCDispatcher::RemoveSender(int32 channel_id) {
44 return id_map_.Remove(channel_id); 44 return id_map_.Remove(channel_id);
45 } 45 }
46 46
47 bool CastIPCDispatcher::OnMessageReceived(const IPC::Message& message) { 47 bool CastIPCDispatcher::OnMessageReceived(const IPC::Message& message) {
48 DCHECK(io_message_loop_->BelongsToCurrentThread()); 48 DCHECK(io_message_loop_->BelongsToCurrentThread());
49 bool handled = true; 49 bool handled = true;
50 IPC_BEGIN_MESSAGE_MAP(CastIPCDispatcher, message) 50 IPC_BEGIN_MESSAGE_MAP(CastIPCDispatcher, message)
51 IPC_MESSAGE_HANDLER(CastMsg_ReceivedPacket, OnReceivedPacket) 51 IPC_MESSAGE_HANDLER(CastMsg_ReceivedPacket, OnReceivedPacket)
52 IPC_MESSAGE_HANDLER(CastMsg_NotifyStatusChange, OnNotifyStatusChange) 52 IPC_MESSAGE_HANDLER(CastMsg_NotifyStatusChange, OnNotifyStatusChange)
53 IPC_MESSAGE_HANDLER(CastMsg_RtpStatistics, OnRtpStatistics)
54 IPC_MESSAGE_HANDLER(CastMsg_RawEvents, OnRawEvents) 53 IPC_MESSAGE_HANDLER(CastMsg_RawEvents, OnRawEvents)
55 IPC_MESSAGE_UNHANDLED(handled = false); 54 IPC_MESSAGE_UNHANDLED(handled = false);
56 IPC_END_MESSAGE_MAP(); 55 IPC_END_MESSAGE_MAP();
57 return handled; 56 return handled;
58 } 57 }
59 58
60 void CastIPCDispatcher::OnFilterAdded(IPC::Channel* channel) { 59 void CastIPCDispatcher::OnFilterAdded(IPC::Channel* channel) {
61 DCHECK(io_message_loop_->BelongsToCurrentThread()); 60 DCHECK(io_message_loop_->BelongsToCurrentThread());
62 DCHECK(!global_instance_); 61 DCHECK(!global_instance_);
63 global_instance_ = this; 62 global_instance_ = this;
(...skipping 29 matching lines...) Expand all
93 media::cast::transport::CastTransportStatus status) { 92 media::cast::transport::CastTransportStatus status) {
94 CastTransportSenderIPC* sender = id_map_.Lookup(channel_id); 93 CastTransportSenderIPC* sender = id_map_.Lookup(channel_id);
95 if (sender) { 94 if (sender) {
96 sender->OnNotifyStatusChange(status); 95 sender->OnNotifyStatusChange(status);
97 } else { 96 } else {
98 DVLOG(1) 97 DVLOG(1)
99 << "CastIPCDispatcher::OnNotifystatusChange on non-existing channel."; 98 << "CastIPCDispatcher::OnNotifystatusChange on non-existing channel.";
100 } 99 }
101 } 100 }
102 101
103 void CastIPCDispatcher::OnRtpStatistics(
104 int32 channel_id,
105 bool audio,
106 const media::cast::transport::RtcpSenderInfo& sender_info,
107 base::TimeTicks time_sent,
108 uint32 rtp_timestamp) {
109 CastTransportSenderIPC* sender = id_map_.Lookup(channel_id);
110 if (sender) {
111 sender->OnRtpStatistics(audio, sender_info, time_sent, rtp_timestamp);
112 } else {
113 DVLOG(1) << "CastIPCDispatcher::OnRtpStatistics on non-existing channel.";
114 }
115 }
116
117 void CastIPCDispatcher::OnRawEvents( 102 void CastIPCDispatcher::OnRawEvents(
118 int32 channel_id, 103 int32 channel_id,
119 const std::vector<media::cast::PacketEvent>& packet_events) { 104 const std::vector<media::cast::PacketEvent>& packet_events) {
120 CastTransportSenderIPC* sender = id_map_.Lookup(channel_id); 105 CastTransportSenderIPC* sender = id_map_.Lookup(channel_id);
121 if (sender) { 106 if (sender) {
122 sender->OnRawEvents(packet_events); 107 sender->OnRawEvents(packet_events);
123 } else { 108 } else {
124 DVLOG(1) << "CastIPCDispatcher::OnRawEvents on non-existing channel."; 109 DVLOG(1) << "CastIPCDispatcher::OnRawEvents on non-existing channel.";
125 } 110 }
126 } 111 }
OLDNEW
« no previous file with comments | « chrome/common/cast_messages.h ('k') | chrome/renderer/media/cast_transport_sender_ipc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698