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

Unified Diff: chrome/browser/media/cast_transport_host_filter.cc

Issue 1709863002: Add Cast PLI support on sender side. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address dcheng's comments. Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/media/cast_transport_host_filter.h ('k') | chrome/common/cast_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/media/cast_transport_host_filter.cc
diff --git a/chrome/browser/media/cast_transport_host_filter.cc b/chrome/browser/media/cast_transport_host_filter.cc
index bf8fc0b81940cfd8553282e6dd17131271395ce3..6e5adf0c80b568ef5f0649a66a32096684fbbc7a 100644
--- a/chrome/browser/media/cast_transport_host_filter.cc
+++ b/chrome/browser/media/cast_transport_host_filter.cc
@@ -89,6 +89,7 @@ bool CastTransportHostFilter::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(CastHostMsg_InitializeRtpReceiverRtcpBuilder,
OnInitializeRtpReceiverRtcpBuilder)
IPC_MESSAGE_HANDLER(CastHostMsg_AddCastFeedback, OnAddCastFeedback)
+ IPC_MESSAGE_HANDLER(CastHostMsg_AddPli, OnAddPli)
IPC_MESSAGE_HANDLER(CastHostMsg_AddRtcpEvents, OnAddRtcpEvents)
IPC_MESSAGE_HANDLER(CastHostMsg_AddRtpReceiverReport,
OnAddRtpReceiverReport)
@@ -100,16 +101,21 @@ bool CastTransportHostFilter::OnMessageReceived(const IPC::Message& message) {
}
void CastTransportHostFilter::SendRtt(int32_t channel_id,
- uint32_t ssrc,
+ uint32_t rtp_sender_ssrc,
base::TimeDelta rtt) {
- Send(new CastMsg_Rtt(channel_id, ssrc, rtt));
+ Send(new CastMsg_Rtt(channel_id, rtp_sender_ssrc, rtt));
}
void CastTransportHostFilter::SendCastMessage(
int32_t channel_id,
- uint32_t ssrc,
+ uint32_t rtp_sender_ssrc,
const media::cast::RtcpCastMessage& cast_message) {
- Send(new CastMsg_RtcpCastMessage(channel_id, ssrc, cast_message));
+ Send(new CastMsg_RtcpCastMessage(channel_id, rtp_sender_ssrc, cast_message));
+}
+
+void CastTransportHostFilter::SendReceivedPli(int32_t channel_id,
+ uint32_t rtp_sender_ssrc) {
+ Send(new CastMsg_Pli(channel_id, rtp_sender_ssrc));
}
void CastTransportHostFilter::OnNew(int32_t channel_id,
@@ -168,13 +174,12 @@ void CastTransportHostFilter::OnInitializeAudio(
media::cast::CastTransportSender* sender = id_map_.Lookup(channel_id);
if (sender) {
sender->InitializeAudio(
- config,
- base::Bind(&CastTransportHostFilter::SendCastMessage,
- weak_factory_.GetWeakPtr(),
- channel_id, config.ssrc),
+ config, base::Bind(&CastTransportHostFilter::SendCastMessage,
+ weak_factory_.GetWeakPtr(), channel_id, config.ssrc),
base::Bind(&CastTransportHostFilter::SendRtt,
- weak_factory_.GetWeakPtr(),
- channel_id, config.ssrc));
+ weak_factory_.GetWeakPtr(), channel_id, config.ssrc),
+ base::Bind(&CastTransportHostFilter::SendReceivedPli,
+ weak_factory_.GetWeakPtr(), channel_id, config.ssrc));
} else {
DVLOG(1)
<< "CastTransportHostFilter::OnInitializeAudio on non-existing channel";
@@ -187,13 +192,12 @@ void CastTransportHostFilter::OnInitializeVideo(
media::cast::CastTransportSender* sender = id_map_.Lookup(channel_id);
if (sender) {
sender->InitializeVideo(
- config,
- base::Bind(&CastTransportHostFilter::SendCastMessage,
- weak_factory_.GetWeakPtr(),
- channel_id, config.ssrc),
+ config, base::Bind(&CastTransportHostFilter::SendCastMessage,
+ weak_factory_.GetWeakPtr(), channel_id, config.ssrc),
base::Bind(&CastTransportHostFilter::SendRtt,
- weak_factory_.GetWeakPtr(),
- channel_id, config.ssrc));
+ weak_factory_.GetWeakPtr(), channel_id, config.ssrc),
+ base::Bind(&CastTransportHostFilter::SendReceivedPli,
+ weak_factory_.GetWeakPtr(), channel_id, config.ssrc));
} else {
DVLOG(1)
<< "CastTransportHostFilter::OnInitializeVideo on non-existing channel";
@@ -296,6 +300,17 @@ void CastTransportHostFilter::OnAddCastFeedback(
}
}
+void CastTransportHostFilter::OnAddPli(
+ int32_t channel_id,
+ const media::cast::RtcpPliMessage& pli_message) {
+ media::cast::CastTransportSender* sender = id_map_.Lookup(channel_id);
+ if (sender) {
+ sender->AddPli(pli_message);
+ } else {
+ DVLOG(1) << "CastTransportHostFilter::OnAddPli on non-existing channel";
+ }
+}
+
void CastTransportHostFilter::OnAddRtcpEvents(
int32_t channel_id,
const media::cast::ReceiverRtcpEventSubscriber::RtcpEvents& rtcp_events) {
« no previous file with comments | « chrome/browser/media/cast_transport_host_filter.h ('k') | chrome/common/cast_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698