2013-08-15 23:38:54 +00:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
|
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "modules/rtp_rtcp/source/rtp_receiver_impl.h"
|
2013-08-15 23:38:54 +00:00
|
|
|
|
|
|
|
|
#include <assert.h>
|
|
|
|
|
#include <math.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
Reland of Implemented the GetSources() in native code. (patchset #1 id:1 of https://codereview.webrtc.org/2809613002/ )
Reason for revert:
Re-land, reverting did not fix bug.
https://bugs.chromium.org/p/webrtc/issues/detail?id=7465
Original issue's description:
> Revert of Implemented the GetSources() in native code. (patchset #11 id:510001 of https://codereview.webrtc.org/2770233003/ )
>
> Reason for revert:
> Suspected of WebRtcApprtcBrowserTest.MANUAL_WorksOnApprtc breakage, see
>
> https://bugs.chromium.org/p/webrtc/issues/detail?id=7465
>
> Original issue's description:
> > Added the GetSources() to the RtpReceiverInterface and implemented
> > it for the AudioRtpReceiver.
> >
> > This method returns a vector of RtpSource(both CSRC source and SSRC
> > source) which contains the ID of a source, the timestamp, the source
> > type (SSRC or CSRC) and the audio level.
> >
> > The RtpSource objects are buffered and maintained by the
> > RtpReceiver in webrtc/modules/rtp_rtcp/. When the method is called,
> > the info of the contributing source will be pulled along the object
> > chain:
> > AudioRtpReceiver -> VoiceChannel -> WebRtcVoiceMediaChannel ->
> > AudioReceiveStream -> voe::Channel -> RtpRtcp module
> >
> > Spec:https://w3c.github.io/webrtc-pc/archives/20151006/webrtc.html#widl-RTCRtpReceiver-getContributingSources-sequence-RTCRtpContributingSource
> >
> > BUG=chromium:703122
> > TBR=stefan@webrtc.org, danilchap@webrtc.org
> >
> > Review-Url: https://codereview.webrtc.org/2770233003
> > Cr-Commit-Position: refs/heads/master@{#17591}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/292084c3765d9f3ee406ca2ec86eae206b540053
>
> TBR=deadbeef@webrtc.org,solenberg@webrtc.org,hbos@webrtc.org,philipel@webrtc.org,stefan@webrtc.org,danilchap@webrtc.org,zhihuang@webrtc.org
> # Not skipping CQ checks because original CL landed more than 1 days ago.
> BUG=chromium:703122
>
> Review-Url: https://codereview.webrtc.org/2809613002
> Cr-Commit-Position: refs/heads/master@{#17616}
> Committed: https://chromium.googlesource.com/external/webrtc/+/fbcc5cb3869d1370008e40f24fc03ac8fb69c675
TBR=deadbeef@webrtc.org,solenberg@webrtc.org,philipel@webrtc.org,stefan@webrtc.org,danilchap@webrtc.org,zhihuang@webrtc.org,olka@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:703122
Review-Url: https://codereview.webrtc.org/2810623003
Cr-Commit-Position: refs/heads/master@{#17621}
2017-04-10 07:39:05 -07:00
|
|
|
#include <set>
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
2017-09-15 13:58:09 +02:00
|
|
|
#include "common_types.h" // NOLINT(build/include)
|
2017-10-04 12:38:53 +02:00
|
|
|
#include "modules/audio_coding/codecs/audio_format_conversion.h"
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "modules/rtp_rtcp/include/rtp_payload_registry.h"
|
|
|
|
|
#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
|
|
|
|
|
#include "modules/rtp_rtcp/source/rtp_receiver_strategy.h"
|
|
|
|
|
#include "rtc_base/logging.h"
|
2013-08-15 23:38:54 +00:00
|
|
|
|
|
|
|
|
namespace webrtc {
|
|
|
|
|
|
2014-07-08 12:10:51 +00:00
|
|
|
using RtpUtility::Payload;
|
2013-08-15 23:38:54 +00:00
|
|
|
|
Reland of Implemented the GetSources() in native code. (patchset #1 id:1 of https://codereview.webrtc.org/2809613002/ )
Reason for revert:
Re-land, reverting did not fix bug.
https://bugs.chromium.org/p/webrtc/issues/detail?id=7465
Original issue's description:
> Revert of Implemented the GetSources() in native code. (patchset #11 id:510001 of https://codereview.webrtc.org/2770233003/ )
>
> Reason for revert:
> Suspected of WebRtcApprtcBrowserTest.MANUAL_WorksOnApprtc breakage, see
>
> https://bugs.chromium.org/p/webrtc/issues/detail?id=7465
>
> Original issue's description:
> > Added the GetSources() to the RtpReceiverInterface and implemented
> > it for the AudioRtpReceiver.
> >
> > This method returns a vector of RtpSource(both CSRC source and SSRC
> > source) which contains the ID of a source, the timestamp, the source
> > type (SSRC or CSRC) and the audio level.
> >
> > The RtpSource objects are buffered and maintained by the
> > RtpReceiver in webrtc/modules/rtp_rtcp/. When the method is called,
> > the info of the contributing source will be pulled along the object
> > chain:
> > AudioRtpReceiver -> VoiceChannel -> WebRtcVoiceMediaChannel ->
> > AudioReceiveStream -> voe::Channel -> RtpRtcp module
> >
> > Spec:https://w3c.github.io/webrtc-pc/archives/20151006/webrtc.html#widl-RTCRtpReceiver-getContributingSources-sequence-RTCRtpContributingSource
> >
> > BUG=chromium:703122
> > TBR=stefan@webrtc.org, danilchap@webrtc.org
> >
> > Review-Url: https://codereview.webrtc.org/2770233003
> > Cr-Commit-Position: refs/heads/master@{#17591}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/292084c3765d9f3ee406ca2ec86eae206b540053
>
> TBR=deadbeef@webrtc.org,solenberg@webrtc.org,hbos@webrtc.org,philipel@webrtc.org,stefan@webrtc.org,danilchap@webrtc.org,zhihuang@webrtc.org
> # Not skipping CQ checks because original CL landed more than 1 days ago.
> BUG=chromium:703122
>
> Review-Url: https://codereview.webrtc.org/2809613002
> Cr-Commit-Position: refs/heads/master@{#17616}
> Committed: https://chromium.googlesource.com/external/webrtc/+/fbcc5cb3869d1370008e40f24fc03ac8fb69c675
TBR=deadbeef@webrtc.org,solenberg@webrtc.org,philipel@webrtc.org,stefan@webrtc.org,danilchap@webrtc.org,zhihuang@webrtc.org,olka@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:703122
Review-Url: https://codereview.webrtc.org/2810623003
Cr-Commit-Position: refs/heads/master@{#17621}
2017-04-10 07:39:05 -07:00
|
|
|
// Only return the sources in the last 10 seconds.
|
|
|
|
|
const int64_t kGetSourcesTimeoutMs = 10000;
|
|
|
|
|
|
2013-08-15 23:38:54 +00:00
|
|
|
RtpReceiver* RtpReceiver::CreateVideoReceiver(
|
2015-09-17 23:03:57 +02:00
|
|
|
Clock* clock,
|
2013-08-15 23:38:54 +00:00
|
|
|
RtpData* incoming_payload_callback,
|
|
|
|
|
RtpFeedback* incoming_messages_callback,
|
|
|
|
|
RTPPayloadRegistry* rtp_payload_registry) {
|
2017-06-01 00:30:55 -07:00
|
|
|
RTC_DCHECK(incoming_payload_callback != nullptr);
|
2013-08-15 23:38:54 +00:00
|
|
|
if (!incoming_messages_callback)
|
|
|
|
|
incoming_messages_callback = NullObjectRtpFeedback();
|
|
|
|
|
return new RtpReceiverImpl(
|
2016-03-30 02:42:32 -07:00
|
|
|
clock, incoming_messages_callback, rtp_payload_registry,
|
2014-04-08 11:06:12 +00:00
|
|
|
RTPReceiverStrategy::CreateVideoStrategy(incoming_payload_callback));
|
2013-08-15 23:38:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
RtpReceiver* RtpReceiver::CreateAudioReceiver(
|
2015-09-17 23:03:57 +02:00
|
|
|
Clock* clock,
|
2013-08-15 23:38:54 +00:00
|
|
|
RtpData* incoming_payload_callback,
|
|
|
|
|
RtpFeedback* incoming_messages_callback,
|
|
|
|
|
RTPPayloadRegistry* rtp_payload_registry) {
|
2017-06-01 00:30:55 -07:00
|
|
|
RTC_DCHECK(incoming_payload_callback != nullptr);
|
2013-08-15 23:38:54 +00:00
|
|
|
if (!incoming_messages_callback)
|
|
|
|
|
incoming_messages_callback = NullObjectRtpFeedback();
|
|
|
|
|
return new RtpReceiverImpl(
|
2016-03-30 02:42:32 -07:00
|
|
|
clock, incoming_messages_callback, rtp_payload_registry,
|
|
|
|
|
RTPReceiverStrategy::CreateAudioStrategy(incoming_payload_callback));
|
|
|
|
|
}
|
|
|
|
|
|
2017-10-04 12:38:53 +02:00
|
|
|
int32_t RtpReceiver::RegisterReceivePayload(const CodecInst& audio_codec) {
|
|
|
|
|
return RegisterReceivePayload(audio_codec.pltype,
|
|
|
|
|
CodecInstToSdp(audio_codec));
|
|
|
|
|
}
|
|
|
|
|
|
Reland of Implemented the GetSources() in native code. (patchset #1 id:1 of https://codereview.webrtc.org/2809613002/ )
Reason for revert:
Re-land, reverting did not fix bug.
https://bugs.chromium.org/p/webrtc/issues/detail?id=7465
Original issue's description:
> Revert of Implemented the GetSources() in native code. (patchset #11 id:510001 of https://codereview.webrtc.org/2770233003/ )
>
> Reason for revert:
> Suspected of WebRtcApprtcBrowserTest.MANUAL_WorksOnApprtc breakage, see
>
> https://bugs.chromium.org/p/webrtc/issues/detail?id=7465
>
> Original issue's description:
> > Added the GetSources() to the RtpReceiverInterface and implemented
> > it for the AudioRtpReceiver.
> >
> > This method returns a vector of RtpSource(both CSRC source and SSRC
> > source) which contains the ID of a source, the timestamp, the source
> > type (SSRC or CSRC) and the audio level.
> >
> > The RtpSource objects are buffered and maintained by the
> > RtpReceiver in webrtc/modules/rtp_rtcp/. When the method is called,
> > the info of the contributing source will be pulled along the object
> > chain:
> > AudioRtpReceiver -> VoiceChannel -> WebRtcVoiceMediaChannel ->
> > AudioReceiveStream -> voe::Channel -> RtpRtcp module
> >
> > Spec:https://w3c.github.io/webrtc-pc/archives/20151006/webrtc.html#widl-RTCRtpReceiver-getContributingSources-sequence-RTCRtpContributingSource
> >
> > BUG=chromium:703122
> > TBR=stefan@webrtc.org, danilchap@webrtc.org
> >
> > Review-Url: https://codereview.webrtc.org/2770233003
> > Cr-Commit-Position: refs/heads/master@{#17591}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/292084c3765d9f3ee406ca2ec86eae206b540053
>
> TBR=deadbeef@webrtc.org,solenberg@webrtc.org,hbos@webrtc.org,philipel@webrtc.org,stefan@webrtc.org,danilchap@webrtc.org,zhihuang@webrtc.org
> # Not skipping CQ checks because original CL landed more than 1 days ago.
> BUG=chromium:703122
>
> Review-Url: https://codereview.webrtc.org/2809613002
> Cr-Commit-Position: refs/heads/master@{#17616}
> Committed: https://chromium.googlesource.com/external/webrtc/+/fbcc5cb3869d1370008e40f24fc03ac8fb69c675
TBR=deadbeef@webrtc.org,solenberg@webrtc.org,philipel@webrtc.org,stefan@webrtc.org,danilchap@webrtc.org,zhihuang@webrtc.org,olka@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:703122
Review-Url: https://codereview.webrtc.org/2810623003
Cr-Commit-Position: refs/heads/master@{#17621}
2017-04-10 07:39:05 -07:00
|
|
|
RtpReceiverImpl::RtpReceiverImpl(Clock* clock,
|
|
|
|
|
RtpFeedback* incoming_messages_callback,
|
|
|
|
|
RTPPayloadRegistry* rtp_payload_registry,
|
|
|
|
|
RTPReceiverStrategy* rtp_media_receiver)
|
2013-08-15 23:38:54 +00:00
|
|
|
: clock_(clock),
|
|
|
|
|
rtp_payload_registry_(rtp_payload_registry),
|
|
|
|
|
rtp_media_receiver_(rtp_media_receiver),
|
|
|
|
|
cb_rtp_feedback_(incoming_messages_callback),
|
|
|
|
|
ssrc_(0),
|
|
|
|
|
num_csrcs_(0),
|
|
|
|
|
current_remote_csrc_(),
|
|
|
|
|
last_received_timestamp_(0),
|
2017-09-26 14:05:05 +02:00
|
|
|
last_received_frame_time_ms_(-1) {
|
2013-08-15 23:38:54 +00:00
|
|
|
assert(incoming_messages_callback);
|
|
|
|
|
|
|
|
|
|
memset(current_remote_csrc_, 0, sizeof(current_remote_csrc_));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
RtpReceiverImpl::~RtpReceiverImpl() {
|
|
|
|
|
for (int i = 0; i < num_csrcs_; ++i) {
|
2015-09-17 23:03:57 +02:00
|
|
|
cb_rtp_feedback_->OnIncomingCSRCChanged(current_remote_csrc_[i], false);
|
2013-08-15 23:38:54 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-10-04 12:38:53 +02:00
|
|
|
int32_t RtpReceiverImpl::RegisterReceivePayload(
|
|
|
|
|
int payload_type,
|
|
|
|
|
const SdpAudioFormat& audio_format) {
|
2016-04-14 03:05:31 -07:00
|
|
|
rtc::CritScope lock(&critical_section_rtp_receiver_);
|
2013-08-15 23:38:54 +00:00
|
|
|
|
|
|
|
|
// TODO(phoglund): Try to streamline handling of the RED codec and some other
|
|
|
|
|
// cases which makes it necessary to keep track of whether we created a
|
|
|
|
|
// payload or not.
|
|
|
|
|
bool created_new_payload = false;
|
|
|
|
|
int32_t result = rtp_payload_registry_->RegisterReceivePayload(
|
2017-10-04 12:38:53 +02:00
|
|
|
payload_type, audio_format, &created_new_payload);
|
2013-08-15 23:38:54 +00:00
|
|
|
if (created_new_payload) {
|
2017-10-04 12:38:53 +02:00
|
|
|
if (rtp_media_receiver_->OnNewPayloadTypeCreated(payload_type,
|
|
|
|
|
audio_format) != 0) {
|
|
|
|
|
LOG(LS_ERROR) << "Failed to register payload: " << audio_format.name
|
|
|
|
|
<< "/" << payload_type;
|
2013-08-15 23:38:54 +00:00
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
2016-11-25 02:29:39 -08:00
|
|
|
int32_t RtpReceiverImpl::RegisterReceivePayload(const VideoCodec& video_codec) {
|
|
|
|
|
rtc::CritScope lock(&critical_section_rtp_receiver_);
|
|
|
|
|
return rtp_payload_registry_->RegisterReceivePayload(video_codec);
|
|
|
|
|
}
|
|
|
|
|
|
2013-08-15 23:38:54 +00:00
|
|
|
int32_t RtpReceiverImpl::DeRegisterReceivePayload(
|
|
|
|
|
const int8_t payload_type) {
|
2016-04-14 03:05:31 -07:00
|
|
|
rtc::CritScope lock(&critical_section_rtp_receiver_);
|
2013-08-15 23:38:54 +00:00
|
|
|
return rtp_payload_registry_->DeRegisterReceivePayload(payload_type);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint32_t RtpReceiverImpl::SSRC() const {
|
2016-04-14 03:05:31 -07:00
|
|
|
rtc::CritScope lock(&critical_section_rtp_receiver_);
|
2013-08-15 23:38:54 +00:00
|
|
|
return ssrc_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Get remote CSRC.
|
|
|
|
|
int32_t RtpReceiverImpl::CSRCs(uint32_t array_of_csrcs[kRtpCsrcSize]) const {
|
2016-04-14 03:05:31 -07:00
|
|
|
rtc::CritScope lock(&critical_section_rtp_receiver_);
|
2013-08-15 23:38:54 +00:00
|
|
|
|
|
|
|
|
assert(num_csrcs_ <= kRtpCsrcSize);
|
|
|
|
|
|
|
|
|
|
if (num_csrcs_ > 0) {
|
|
|
|
|
memcpy(array_of_csrcs, current_remote_csrc_, sizeof(uint32_t)*num_csrcs_);
|
|
|
|
|
}
|
|
|
|
|
return num_csrcs_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int32_t RtpReceiverImpl::Energy(
|
|
|
|
|
uint8_t array_of_energy[kRtpCsrcSize]) const {
|
|
|
|
|
return rtp_media_receiver_->Energy(array_of_energy);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool RtpReceiverImpl::IncomingRtpPacket(
|
2013-09-06 13:40:11 +00:00
|
|
|
const RTPHeader& rtp_header,
|
|
|
|
|
const uint8_t* payload,
|
Use size_t more consistently for packet/payload lengths.
See design doc at https://docs.google.com/a/chromium.org/document/d/1I6nmE9D_BmCY-IoV6MDPY2V6WYpEI-dg2apWXTfZyUI/edit?usp=sharing for more information.
This CL was reviewed and approved in pieces in the following CLs:
https://webrtc-codereview.appspot.com/24209004/
https://webrtc-codereview.appspot.com/24229004/
https://webrtc-codereview.appspot.com/24259004/
https://webrtc-codereview.appspot.com/25109004/
https://webrtc-codereview.appspot.com/26099004/
https://webrtc-codereview.appspot.com/27069004/
https://webrtc-codereview.appspot.com/27969004/
https://webrtc-codereview.appspot.com/27989004/
https://webrtc-codereview.appspot.com/29009004/
https://webrtc-codereview.appspot.com/30929004/
https://webrtc-codereview.appspot.com/30939004/
https://webrtc-codereview.appspot.com/31999004/
Committing as TBR to the original reviewers.
BUG=chromium:81439
TEST=none
TBR=pthatcher,henrik.lundin,tina.legrand,stefan,tkchin,glaznev,kjellander,perkj,mflodman,henrika,asapersson,niklas.enbom
Review URL: https://webrtc-codereview.appspot.com/23129004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7726 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-11-20 22:28:14 +00:00
|
|
|
size_t payload_length,
|
2013-09-06 13:40:11 +00:00
|
|
|
PayloadUnion payload_specific,
|
|
|
|
|
bool in_order) {
|
2013-08-15 23:38:54 +00:00
|
|
|
// Trigger our callbacks.
|
|
|
|
|
CheckSSRCChanged(rtp_header);
|
|
|
|
|
|
2014-04-08 11:06:12 +00:00
|
|
|
int8_t first_payload_byte = payload_length > 0 ? payload[0] : 0;
|
2013-08-15 23:38:54 +00:00
|
|
|
bool is_red = false;
|
|
|
|
|
|
2015-12-15 02:54:47 -08:00
|
|
|
if (CheckPayloadChanged(rtp_header, first_payload_byte, &is_red,
|
2015-07-07 08:32:48 -07:00
|
|
|
&payload_specific) == -1) {
|
2013-09-06 13:40:11 +00:00
|
|
|
if (payload_length == 0) {
|
2013-08-15 23:38:54 +00:00
|
|
|
// OK, keep-alive packet.
|
|
|
|
|
return true;
|
|
|
|
|
}
|
2014-04-08 11:06:12 +00:00
|
|
|
LOG(LS_WARNING) << "Receiving invalid payload type.";
|
2013-08-15 23:38:54 +00:00
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
WebRtcRTPHeader webrtc_rtp_header;
|
|
|
|
|
memset(&webrtc_rtp_header, 0, sizeof(webrtc_rtp_header));
|
2013-09-06 13:40:11 +00:00
|
|
|
webrtc_rtp_header.header = rtp_header;
|
|
|
|
|
CheckCSRC(webrtc_rtp_header);
|
2013-08-15 23:38:54 +00:00
|
|
|
|
2017-08-24 14:52:17 -07:00
|
|
|
auto audio_level =
|
|
|
|
|
rtp_header.extension.hasAudioLevel
|
|
|
|
|
? rtc::Optional<uint8_t>(rtp_header.extension.audioLevel)
|
|
|
|
|
: rtc::Optional<uint8_t>();
|
|
|
|
|
UpdateSources(audio_level);
|
Reland of Implemented the GetSources() in native code. (patchset #1 id:1 of https://codereview.webrtc.org/2809613002/ )
Reason for revert:
Re-land, reverting did not fix bug.
https://bugs.chromium.org/p/webrtc/issues/detail?id=7465
Original issue's description:
> Revert of Implemented the GetSources() in native code. (patchset #11 id:510001 of https://codereview.webrtc.org/2770233003/ )
>
> Reason for revert:
> Suspected of WebRtcApprtcBrowserTest.MANUAL_WorksOnApprtc breakage, see
>
> https://bugs.chromium.org/p/webrtc/issues/detail?id=7465
>
> Original issue's description:
> > Added the GetSources() to the RtpReceiverInterface and implemented
> > it for the AudioRtpReceiver.
> >
> > This method returns a vector of RtpSource(both CSRC source and SSRC
> > source) which contains the ID of a source, the timestamp, the source
> > type (SSRC or CSRC) and the audio level.
> >
> > The RtpSource objects are buffered and maintained by the
> > RtpReceiver in webrtc/modules/rtp_rtcp/. When the method is called,
> > the info of the contributing source will be pulled along the object
> > chain:
> > AudioRtpReceiver -> VoiceChannel -> WebRtcVoiceMediaChannel ->
> > AudioReceiveStream -> voe::Channel -> RtpRtcp module
> >
> > Spec:https://w3c.github.io/webrtc-pc/archives/20151006/webrtc.html#widl-RTCRtpReceiver-getContributingSources-sequence-RTCRtpContributingSource
> >
> > BUG=chromium:703122
> > TBR=stefan@webrtc.org, danilchap@webrtc.org
> >
> > Review-Url: https://codereview.webrtc.org/2770233003
> > Cr-Commit-Position: refs/heads/master@{#17591}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/292084c3765d9f3ee406ca2ec86eae206b540053
>
> TBR=deadbeef@webrtc.org,solenberg@webrtc.org,hbos@webrtc.org,philipel@webrtc.org,stefan@webrtc.org,danilchap@webrtc.org,zhihuang@webrtc.org
> # Not skipping CQ checks because original CL landed more than 1 days ago.
> BUG=chromium:703122
>
> Review-Url: https://codereview.webrtc.org/2809613002
> Cr-Commit-Position: refs/heads/master@{#17616}
> Committed: https://chromium.googlesource.com/external/webrtc/+/fbcc5cb3869d1370008e40f24fc03ac8fb69c675
TBR=deadbeef@webrtc.org,solenberg@webrtc.org,philipel@webrtc.org,stefan@webrtc.org,danilchap@webrtc.org,zhihuang@webrtc.org,olka@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:703122
Review-Url: https://codereview.webrtc.org/2810623003
Cr-Commit-Position: refs/heads/master@{#17621}
2017-04-10 07:39:05 -07:00
|
|
|
|
2013-08-15 23:38:54 +00:00
|
|
|
int32_t ret_val = rtp_media_receiver_->ParseRtpPacket(
|
2013-09-06 13:40:11 +00:00
|
|
|
&webrtc_rtp_header, payload_specific, is_red, payload, payload_length,
|
2017-09-26 14:05:05 +02:00
|
|
|
clock_->TimeInMilliseconds());
|
2013-08-15 23:38:54 +00:00
|
|
|
|
|
|
|
|
if (ret_val < 0) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
2016-04-14 03:05:31 -07:00
|
|
|
rtc::CritScope lock(&critical_section_rtp_receiver_);
|
2013-08-15 23:38:54 +00:00
|
|
|
|
|
|
|
|
if (in_order) {
|
2013-09-06 13:40:11 +00:00
|
|
|
if (last_received_timestamp_ != rtp_header.timestamp) {
|
|
|
|
|
last_received_timestamp_ = rtp_header.timestamp;
|
2013-08-15 23:38:54 +00:00
|
|
|
last_received_frame_time_ms_ = clock_->TimeInMilliseconds();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2016-09-22 03:36:27 -07:00
|
|
|
TelephoneEventHandler* RtpReceiverImpl::GetTelephoneEventHandler() {
|
|
|
|
|
return rtp_media_receiver_->GetTelephoneEventHandler();
|
|
|
|
|
}
|
|
|
|
|
|
Reland of Implemented the GetSources() in native code. (patchset #1 id:1 of https://codereview.webrtc.org/2809613002/ )
Reason for revert:
Re-land, reverting did not fix bug.
https://bugs.chromium.org/p/webrtc/issues/detail?id=7465
Original issue's description:
> Revert of Implemented the GetSources() in native code. (patchset #11 id:510001 of https://codereview.webrtc.org/2770233003/ )
>
> Reason for revert:
> Suspected of WebRtcApprtcBrowserTest.MANUAL_WorksOnApprtc breakage, see
>
> https://bugs.chromium.org/p/webrtc/issues/detail?id=7465
>
> Original issue's description:
> > Added the GetSources() to the RtpReceiverInterface and implemented
> > it for the AudioRtpReceiver.
> >
> > This method returns a vector of RtpSource(both CSRC source and SSRC
> > source) which contains the ID of a source, the timestamp, the source
> > type (SSRC or CSRC) and the audio level.
> >
> > The RtpSource objects are buffered and maintained by the
> > RtpReceiver in webrtc/modules/rtp_rtcp/. When the method is called,
> > the info of the contributing source will be pulled along the object
> > chain:
> > AudioRtpReceiver -> VoiceChannel -> WebRtcVoiceMediaChannel ->
> > AudioReceiveStream -> voe::Channel -> RtpRtcp module
> >
> > Spec:https://w3c.github.io/webrtc-pc/archives/20151006/webrtc.html#widl-RTCRtpReceiver-getContributingSources-sequence-RTCRtpContributingSource
> >
> > BUG=chromium:703122
> > TBR=stefan@webrtc.org, danilchap@webrtc.org
> >
> > Review-Url: https://codereview.webrtc.org/2770233003
> > Cr-Commit-Position: refs/heads/master@{#17591}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/292084c3765d9f3ee406ca2ec86eae206b540053
>
> TBR=deadbeef@webrtc.org,solenberg@webrtc.org,hbos@webrtc.org,philipel@webrtc.org,stefan@webrtc.org,danilchap@webrtc.org,zhihuang@webrtc.org
> # Not skipping CQ checks because original CL landed more than 1 days ago.
> BUG=chromium:703122
>
> Review-Url: https://codereview.webrtc.org/2809613002
> Cr-Commit-Position: refs/heads/master@{#17616}
> Committed: https://chromium.googlesource.com/external/webrtc/+/fbcc5cb3869d1370008e40f24fc03ac8fb69c675
TBR=deadbeef@webrtc.org,solenberg@webrtc.org,philipel@webrtc.org,stefan@webrtc.org,danilchap@webrtc.org,zhihuang@webrtc.org,olka@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:703122
Review-Url: https://codereview.webrtc.org/2810623003
Cr-Commit-Position: refs/heads/master@{#17621}
2017-04-10 07:39:05 -07:00
|
|
|
std::vector<RtpSource> RtpReceiverImpl::GetSources() const {
|
2017-04-11 11:28:10 -07:00
|
|
|
rtc::CritScope lock(&critical_section_rtp_receiver_);
|
|
|
|
|
|
Reland of Implemented the GetSources() in native code. (patchset #1 id:1 of https://codereview.webrtc.org/2809613002/ )
Reason for revert:
Re-land, reverting did not fix bug.
https://bugs.chromium.org/p/webrtc/issues/detail?id=7465
Original issue's description:
> Revert of Implemented the GetSources() in native code. (patchset #11 id:510001 of https://codereview.webrtc.org/2770233003/ )
>
> Reason for revert:
> Suspected of WebRtcApprtcBrowserTest.MANUAL_WorksOnApprtc breakage, see
>
> https://bugs.chromium.org/p/webrtc/issues/detail?id=7465
>
> Original issue's description:
> > Added the GetSources() to the RtpReceiverInterface and implemented
> > it for the AudioRtpReceiver.
> >
> > This method returns a vector of RtpSource(both CSRC source and SSRC
> > source) which contains the ID of a source, the timestamp, the source
> > type (SSRC or CSRC) and the audio level.
> >
> > The RtpSource objects are buffered and maintained by the
> > RtpReceiver in webrtc/modules/rtp_rtcp/. When the method is called,
> > the info of the contributing source will be pulled along the object
> > chain:
> > AudioRtpReceiver -> VoiceChannel -> WebRtcVoiceMediaChannel ->
> > AudioReceiveStream -> voe::Channel -> RtpRtcp module
> >
> > Spec:https://w3c.github.io/webrtc-pc/archives/20151006/webrtc.html#widl-RTCRtpReceiver-getContributingSources-sequence-RTCRtpContributingSource
> >
> > BUG=chromium:703122
> > TBR=stefan@webrtc.org, danilchap@webrtc.org
> >
> > Review-Url: https://codereview.webrtc.org/2770233003
> > Cr-Commit-Position: refs/heads/master@{#17591}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/292084c3765d9f3ee406ca2ec86eae206b540053
>
> TBR=deadbeef@webrtc.org,solenberg@webrtc.org,hbos@webrtc.org,philipel@webrtc.org,stefan@webrtc.org,danilchap@webrtc.org,zhihuang@webrtc.org
> # Not skipping CQ checks because original CL landed more than 1 days ago.
> BUG=chromium:703122
>
> Review-Url: https://codereview.webrtc.org/2809613002
> Cr-Commit-Position: refs/heads/master@{#17616}
> Committed: https://chromium.googlesource.com/external/webrtc/+/fbcc5cb3869d1370008e40f24fc03ac8fb69c675
TBR=deadbeef@webrtc.org,solenberg@webrtc.org,philipel@webrtc.org,stefan@webrtc.org,danilchap@webrtc.org,zhihuang@webrtc.org,olka@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:703122
Review-Url: https://codereview.webrtc.org/2810623003
Cr-Commit-Position: refs/heads/master@{#17621}
2017-04-10 07:39:05 -07:00
|
|
|
int64_t now_ms = clock_->TimeInMilliseconds();
|
|
|
|
|
std::vector<RtpSource> sources;
|
|
|
|
|
|
2017-04-11 11:28:10 -07:00
|
|
|
RTC_DCHECK(std::is_sorted(ssrc_sources_.begin(), ssrc_sources_.end(),
|
|
|
|
|
[](const RtpSource& lhs, const RtpSource& rhs) {
|
|
|
|
|
return lhs.timestamp_ms() < rhs.timestamp_ms();
|
|
|
|
|
}));
|
|
|
|
|
RTC_DCHECK(std::is_sorted(csrc_sources_.begin(), csrc_sources_.end(),
|
|
|
|
|
[](const RtpSource& lhs, const RtpSource& rhs) {
|
|
|
|
|
return lhs.timestamp_ms() < rhs.timestamp_ms();
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
std::set<uint32_t> selected_ssrcs;
|
|
|
|
|
for (auto rit = ssrc_sources_.rbegin(); rit != ssrc_sources_.rend(); ++rit) {
|
|
|
|
|
if ((now_ms - rit->timestamp_ms()) > kGetSourcesTimeoutMs) {
|
|
|
|
|
break;
|
Reland of Implemented the GetSources() in native code. (patchset #1 id:1 of https://codereview.webrtc.org/2809613002/ )
Reason for revert:
Re-land, reverting did not fix bug.
https://bugs.chromium.org/p/webrtc/issues/detail?id=7465
Original issue's description:
> Revert of Implemented the GetSources() in native code. (patchset #11 id:510001 of https://codereview.webrtc.org/2770233003/ )
>
> Reason for revert:
> Suspected of WebRtcApprtcBrowserTest.MANUAL_WorksOnApprtc breakage, see
>
> https://bugs.chromium.org/p/webrtc/issues/detail?id=7465
>
> Original issue's description:
> > Added the GetSources() to the RtpReceiverInterface and implemented
> > it for the AudioRtpReceiver.
> >
> > This method returns a vector of RtpSource(both CSRC source and SSRC
> > source) which contains the ID of a source, the timestamp, the source
> > type (SSRC or CSRC) and the audio level.
> >
> > The RtpSource objects are buffered and maintained by the
> > RtpReceiver in webrtc/modules/rtp_rtcp/. When the method is called,
> > the info of the contributing source will be pulled along the object
> > chain:
> > AudioRtpReceiver -> VoiceChannel -> WebRtcVoiceMediaChannel ->
> > AudioReceiveStream -> voe::Channel -> RtpRtcp module
> >
> > Spec:https://w3c.github.io/webrtc-pc/archives/20151006/webrtc.html#widl-RTCRtpReceiver-getContributingSources-sequence-RTCRtpContributingSource
> >
> > BUG=chromium:703122
> > TBR=stefan@webrtc.org, danilchap@webrtc.org
> >
> > Review-Url: https://codereview.webrtc.org/2770233003
> > Cr-Commit-Position: refs/heads/master@{#17591}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/292084c3765d9f3ee406ca2ec86eae206b540053
>
> TBR=deadbeef@webrtc.org,solenberg@webrtc.org,hbos@webrtc.org,philipel@webrtc.org,stefan@webrtc.org,danilchap@webrtc.org,zhihuang@webrtc.org
> # Not skipping CQ checks because original CL landed more than 1 days ago.
> BUG=chromium:703122
>
> Review-Url: https://codereview.webrtc.org/2809613002
> Cr-Commit-Position: refs/heads/master@{#17616}
> Committed: https://chromium.googlesource.com/external/webrtc/+/fbcc5cb3869d1370008e40f24fc03ac8fb69c675
TBR=deadbeef@webrtc.org,solenberg@webrtc.org,philipel@webrtc.org,stefan@webrtc.org,danilchap@webrtc.org,zhihuang@webrtc.org,olka@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:703122
Review-Url: https://codereview.webrtc.org/2810623003
Cr-Commit-Position: refs/heads/master@{#17621}
2017-04-10 07:39:05 -07:00
|
|
|
}
|
2017-04-11 11:28:10 -07:00
|
|
|
if (selected_ssrcs.insert(rit->source_id()).second) {
|
Reland of Implemented the GetSources() in native code. (patchset #1 id:1 of https://codereview.webrtc.org/2809613002/ )
Reason for revert:
Re-land, reverting did not fix bug.
https://bugs.chromium.org/p/webrtc/issues/detail?id=7465
Original issue's description:
> Revert of Implemented the GetSources() in native code. (patchset #11 id:510001 of https://codereview.webrtc.org/2770233003/ )
>
> Reason for revert:
> Suspected of WebRtcApprtcBrowserTest.MANUAL_WorksOnApprtc breakage, see
>
> https://bugs.chromium.org/p/webrtc/issues/detail?id=7465
>
> Original issue's description:
> > Added the GetSources() to the RtpReceiverInterface and implemented
> > it for the AudioRtpReceiver.
> >
> > This method returns a vector of RtpSource(both CSRC source and SSRC
> > source) which contains the ID of a source, the timestamp, the source
> > type (SSRC or CSRC) and the audio level.
> >
> > The RtpSource objects are buffered and maintained by the
> > RtpReceiver in webrtc/modules/rtp_rtcp/. When the method is called,
> > the info of the contributing source will be pulled along the object
> > chain:
> > AudioRtpReceiver -> VoiceChannel -> WebRtcVoiceMediaChannel ->
> > AudioReceiveStream -> voe::Channel -> RtpRtcp module
> >
> > Spec:https://w3c.github.io/webrtc-pc/archives/20151006/webrtc.html#widl-RTCRtpReceiver-getContributingSources-sequence-RTCRtpContributingSource
> >
> > BUG=chromium:703122
> > TBR=stefan@webrtc.org, danilchap@webrtc.org
> >
> > Review-Url: https://codereview.webrtc.org/2770233003
> > Cr-Commit-Position: refs/heads/master@{#17591}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/292084c3765d9f3ee406ca2ec86eae206b540053
>
> TBR=deadbeef@webrtc.org,solenberg@webrtc.org,hbos@webrtc.org,philipel@webrtc.org,stefan@webrtc.org,danilchap@webrtc.org,zhihuang@webrtc.org
> # Not skipping CQ checks because original CL landed more than 1 days ago.
> BUG=chromium:703122
>
> Review-Url: https://codereview.webrtc.org/2809613002
> Cr-Commit-Position: refs/heads/master@{#17616}
> Committed: https://chromium.googlesource.com/external/webrtc/+/fbcc5cb3869d1370008e40f24fc03ac8fb69c675
TBR=deadbeef@webrtc.org,solenberg@webrtc.org,philipel@webrtc.org,stefan@webrtc.org,danilchap@webrtc.org,zhihuang@webrtc.org,olka@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:703122
Review-Url: https://codereview.webrtc.org/2810623003
Cr-Commit-Position: refs/heads/master@{#17621}
2017-04-10 07:39:05 -07:00
|
|
|
sources.push_back(*rit);
|
|
|
|
|
}
|
2017-04-11 11:28:10 -07:00
|
|
|
}
|
Reland of Implemented the GetSources() in native code. (patchset #1 id:1 of https://codereview.webrtc.org/2809613002/ )
Reason for revert:
Re-land, reverting did not fix bug.
https://bugs.chromium.org/p/webrtc/issues/detail?id=7465
Original issue's description:
> Revert of Implemented the GetSources() in native code. (patchset #11 id:510001 of https://codereview.webrtc.org/2770233003/ )
>
> Reason for revert:
> Suspected of WebRtcApprtcBrowserTest.MANUAL_WorksOnApprtc breakage, see
>
> https://bugs.chromium.org/p/webrtc/issues/detail?id=7465
>
> Original issue's description:
> > Added the GetSources() to the RtpReceiverInterface and implemented
> > it for the AudioRtpReceiver.
> >
> > This method returns a vector of RtpSource(both CSRC source and SSRC
> > source) which contains the ID of a source, the timestamp, the source
> > type (SSRC or CSRC) and the audio level.
> >
> > The RtpSource objects are buffered and maintained by the
> > RtpReceiver in webrtc/modules/rtp_rtcp/. When the method is called,
> > the info of the contributing source will be pulled along the object
> > chain:
> > AudioRtpReceiver -> VoiceChannel -> WebRtcVoiceMediaChannel ->
> > AudioReceiveStream -> voe::Channel -> RtpRtcp module
> >
> > Spec:https://w3c.github.io/webrtc-pc/archives/20151006/webrtc.html#widl-RTCRtpReceiver-getContributingSources-sequence-RTCRtpContributingSource
> >
> > BUG=chromium:703122
> > TBR=stefan@webrtc.org, danilchap@webrtc.org
> >
> > Review-Url: https://codereview.webrtc.org/2770233003
> > Cr-Commit-Position: refs/heads/master@{#17591}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/292084c3765d9f3ee406ca2ec86eae206b540053
>
> TBR=deadbeef@webrtc.org,solenberg@webrtc.org,hbos@webrtc.org,philipel@webrtc.org,stefan@webrtc.org,danilchap@webrtc.org,zhihuang@webrtc.org
> # Not skipping CQ checks because original CL landed more than 1 days ago.
> BUG=chromium:703122
>
> Review-Url: https://codereview.webrtc.org/2809613002
> Cr-Commit-Position: refs/heads/master@{#17616}
> Committed: https://chromium.googlesource.com/external/webrtc/+/fbcc5cb3869d1370008e40f24fc03ac8fb69c675
TBR=deadbeef@webrtc.org,solenberg@webrtc.org,philipel@webrtc.org,stefan@webrtc.org,danilchap@webrtc.org,zhihuang@webrtc.org,olka@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:703122
Review-Url: https://codereview.webrtc.org/2810623003
Cr-Commit-Position: refs/heads/master@{#17621}
2017-04-10 07:39:05 -07:00
|
|
|
|
2017-04-11 11:28:10 -07:00
|
|
|
for (auto rit = csrc_sources_.rbegin(); rit != csrc_sources_.rend(); ++rit) {
|
|
|
|
|
if ((now_ms - rit->timestamp_ms()) > kGetSourcesTimeoutMs) {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
sources.push_back(*rit);
|
|
|
|
|
}
|
Reland of Implemented the GetSources() in native code. (patchset #1 id:1 of https://codereview.webrtc.org/2809613002/ )
Reason for revert:
Re-land, reverting did not fix bug.
https://bugs.chromium.org/p/webrtc/issues/detail?id=7465
Original issue's description:
> Revert of Implemented the GetSources() in native code. (patchset #11 id:510001 of https://codereview.webrtc.org/2770233003/ )
>
> Reason for revert:
> Suspected of WebRtcApprtcBrowserTest.MANUAL_WorksOnApprtc breakage, see
>
> https://bugs.chromium.org/p/webrtc/issues/detail?id=7465
>
> Original issue's description:
> > Added the GetSources() to the RtpReceiverInterface and implemented
> > it for the AudioRtpReceiver.
> >
> > This method returns a vector of RtpSource(both CSRC source and SSRC
> > source) which contains the ID of a source, the timestamp, the source
> > type (SSRC or CSRC) and the audio level.
> >
> > The RtpSource objects are buffered and maintained by the
> > RtpReceiver in webrtc/modules/rtp_rtcp/. When the method is called,
> > the info of the contributing source will be pulled along the object
> > chain:
> > AudioRtpReceiver -> VoiceChannel -> WebRtcVoiceMediaChannel ->
> > AudioReceiveStream -> voe::Channel -> RtpRtcp module
> >
> > Spec:https://w3c.github.io/webrtc-pc/archives/20151006/webrtc.html#widl-RTCRtpReceiver-getContributingSources-sequence-RTCRtpContributingSource
> >
> > BUG=chromium:703122
> > TBR=stefan@webrtc.org, danilchap@webrtc.org
> >
> > Review-Url: https://codereview.webrtc.org/2770233003
> > Cr-Commit-Position: refs/heads/master@{#17591}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/292084c3765d9f3ee406ca2ec86eae206b540053
>
> TBR=deadbeef@webrtc.org,solenberg@webrtc.org,hbos@webrtc.org,philipel@webrtc.org,stefan@webrtc.org,danilchap@webrtc.org,zhihuang@webrtc.org
> # Not skipping CQ checks because original CL landed more than 1 days ago.
> BUG=chromium:703122
>
> Review-Url: https://codereview.webrtc.org/2809613002
> Cr-Commit-Position: refs/heads/master@{#17616}
> Committed: https://chromium.googlesource.com/external/webrtc/+/fbcc5cb3869d1370008e40f24fc03ac8fb69c675
TBR=deadbeef@webrtc.org,solenberg@webrtc.org,philipel@webrtc.org,stefan@webrtc.org,danilchap@webrtc.org,zhihuang@webrtc.org,olka@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:703122
Review-Url: https://codereview.webrtc.org/2810623003
Cr-Commit-Position: refs/heads/master@{#17621}
2017-04-10 07:39:05 -07:00
|
|
|
return sources;
|
|
|
|
|
}
|
|
|
|
|
|
2017-10-03 15:28:26 +02:00
|
|
|
bool RtpReceiverImpl::GetLatestTimestamps(uint32_t* timestamp,
|
|
|
|
|
int64_t* receive_time_ms) const {
|
2016-04-14 03:05:31 -07:00
|
|
|
rtc::CritScope lock(&critical_section_rtp_receiver_);
|
2017-10-03 15:28:26 +02:00
|
|
|
if (last_received_frame_time_ms_ < 0)
|
2013-11-08 15:18:52 +00:00
|
|
|
return false;
|
2013-08-15 23:38:54 +00:00
|
|
|
|
2017-10-03 15:28:26 +02:00
|
|
|
*timestamp = last_received_timestamp_;
|
2013-11-08 15:18:52 +00:00
|
|
|
*receive_time_ms = last_received_frame_time_ms_;
|
|
|
|
|
|
2017-10-03 15:28:26 +02:00
|
|
|
return true;
|
2013-08-15 23:38:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Implementation note: must not hold critsect when called.
|
2013-09-06 13:40:11 +00:00
|
|
|
void RtpReceiverImpl::CheckSSRCChanged(const RTPHeader& rtp_header) {
|
2013-08-15 23:38:54 +00:00
|
|
|
bool new_ssrc = false;
|
2017-10-04 12:38:53 +02:00
|
|
|
rtc::Optional<AudioPayload> reinitialize_audio_payload;
|
2013-08-15 23:38:54 +00:00
|
|
|
|
|
|
|
|
{
|
2016-04-14 03:05:31 -07:00
|
|
|
rtc::CritScope lock(&critical_section_rtp_receiver_);
|
2013-08-15 23:38:54 +00:00
|
|
|
|
|
|
|
|
int8_t last_received_payload_type =
|
|
|
|
|
rtp_payload_registry_->last_received_payload_type();
|
2013-09-06 13:40:11 +00:00
|
|
|
if (ssrc_ != rtp_header.ssrc ||
|
2013-08-15 23:38:54 +00:00
|
|
|
(last_received_payload_type == -1 && ssrc_ == 0)) {
|
|
|
|
|
// We need the payload_type_ to make the call if the remote SSRC is 0.
|
|
|
|
|
new_ssrc = true;
|
|
|
|
|
|
|
|
|
|
last_received_timestamp_ = 0;
|
2013-11-08 15:18:52 +00:00
|
|
|
last_received_frame_time_ms_ = -1;
|
2013-08-15 23:38:54 +00:00
|
|
|
|
|
|
|
|
// Do we have a SSRC? Then the stream is restarted.
|
|
|
|
|
if (ssrc_ != 0) {
|
|
|
|
|
// Do we have the same codec? Then re-initialize coder.
|
2013-09-06 13:40:11 +00:00
|
|
|
if (rtp_header.payloadType == last_received_payload_type) {
|
2017-09-21 15:00:58 +02:00
|
|
|
const auto payload = rtp_payload_registry_->PayloadTypeToPayload(
|
2015-12-10 09:51:54 -08:00
|
|
|
rtp_header.payloadType);
|
|
|
|
|
if (!payload) {
|
2013-08-15 23:38:54 +00:00
|
|
|
return;
|
|
|
|
|
}
|
2017-09-28 20:13:59 +02:00
|
|
|
if (payload->typeSpecific.is_audio()) {
|
2017-10-04 12:38:53 +02:00
|
|
|
reinitialize_audio_payload.emplace(
|
|
|
|
|
payload->typeSpecific.audio_payload());
|
|
|
|
|
} else {
|
|
|
|
|
// OnInitializeDecoder() is only used for audio.
|
2013-08-15 23:38:54 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2013-09-06 13:40:11 +00:00
|
|
|
ssrc_ = rtp_header.ssrc;
|
2013-08-15 23:38:54 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (new_ssrc) {
|
|
|
|
|
// We need to get this to our RTCP sender and receiver.
|
|
|
|
|
// We need to do this outside critical section.
|
2015-09-17 23:03:57 +02:00
|
|
|
cb_rtp_feedback_->OnIncomingSSRCChanged(rtp_header.ssrc);
|
2013-08-15 23:38:54 +00:00
|
|
|
}
|
|
|
|
|
|
2017-10-04 12:38:53 +02:00
|
|
|
if (reinitialize_audio_payload) {
|
|
|
|
|
if (-1 == cb_rtp_feedback_->OnInitializeDecoder(
|
|
|
|
|
rtp_header.payloadType, reinitialize_audio_payload->format,
|
|
|
|
|
reinitialize_audio_payload->rate)) {
|
2013-08-15 23:38:54 +00:00
|
|
|
// New stream, same codec.
|
2014-04-08 11:06:12 +00:00
|
|
|
LOG(LS_ERROR) << "Failed to create decoder for payload type: "
|
2015-01-30 19:53:42 +00:00
|
|
|
<< static_cast<int>(rtp_header.payloadType);
|
2013-08-15 23:38:54 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Implementation note: must not hold critsect when called.
|
|
|
|
|
// TODO(phoglund): Move as much as possible of this code path into the media
|
|
|
|
|
// specific receivers. Basically this method goes through a lot of trouble to
|
|
|
|
|
// compute something which is only used by the media specific parts later. If
|
|
|
|
|
// this code path moves we can get rid of some of the rtp_receiver ->
|
|
|
|
|
// media_specific interface (such as CheckPayloadChange, possibly get/set
|
|
|
|
|
// last known payload).
|
2015-07-07 08:32:48 -07:00
|
|
|
int32_t RtpReceiverImpl::CheckPayloadChanged(const RTPHeader& rtp_header,
|
|
|
|
|
const int8_t first_payload_byte,
|
2015-12-15 02:54:47 -08:00
|
|
|
bool* is_red,
|
2015-07-07 08:32:48 -07:00
|
|
|
PayloadUnion* specific_payload) {
|
2013-08-15 23:38:54 +00:00
|
|
|
bool re_initialize_decoder = false;
|
|
|
|
|
|
|
|
|
|
char payload_name[RTP_PAYLOAD_NAME_SIZE];
|
2013-09-06 13:40:11 +00:00
|
|
|
int8_t payload_type = rtp_header.payloadType;
|
2013-08-15 23:38:54 +00:00
|
|
|
|
|
|
|
|
{
|
2016-04-14 03:05:31 -07:00
|
|
|
rtc::CritScope lock(&critical_section_rtp_receiver_);
|
2013-08-15 23:38:54 +00:00
|
|
|
|
|
|
|
|
int8_t last_received_payload_type =
|
|
|
|
|
rtp_payload_registry_->last_received_payload_type();
|
2013-09-06 13:40:11 +00:00
|
|
|
// TODO(holmer): Remove this code when RED parsing has been broken out from
|
|
|
|
|
// RtpReceiverAudio.
|
2013-08-15 23:38:54 +00:00
|
|
|
if (payload_type != last_received_payload_type) {
|
|
|
|
|
if (rtp_payload_registry_->red_payload_type() == payload_type) {
|
|
|
|
|
// Get the real codec payload type.
|
|
|
|
|
payload_type = first_payload_byte & 0x7f;
|
2015-12-15 02:54:47 -08:00
|
|
|
*is_red = true;
|
2013-08-15 23:38:54 +00:00
|
|
|
|
|
|
|
|
if (rtp_payload_registry_->red_payload_type() == payload_type) {
|
|
|
|
|
// Invalid payload type, traced by caller. If we proceeded here,
|
|
|
|
|
// this would be set as |_last_received_payload_type|, and we would no
|
|
|
|
|
// longer catch corrupt packets at this level.
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// When we receive RED we need to check the real payload type.
|
|
|
|
|
if (payload_type == last_received_payload_type) {
|
|
|
|
|
rtp_media_receiver_->GetLastMediaSpecificPayload(specific_payload);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
bool should_discard_changes = false;
|
|
|
|
|
|
|
|
|
|
rtp_media_receiver_->CheckPayloadChanged(
|
2015-07-07 08:32:48 -07:00
|
|
|
payload_type, specific_payload,
|
2013-08-15 23:38:54 +00:00
|
|
|
&should_discard_changes);
|
|
|
|
|
|
|
|
|
|
if (should_discard_changes) {
|
2015-12-15 02:54:47 -08:00
|
|
|
*is_red = false;
|
2013-08-15 23:38:54 +00:00
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2017-09-21 15:00:58 +02:00
|
|
|
const auto payload =
|
2015-12-10 09:51:54 -08:00
|
|
|
rtp_payload_registry_->PayloadTypeToPayload(payload_type);
|
|
|
|
|
if (!payload) {
|
2013-08-15 23:38:54 +00:00
|
|
|
// Not a registered payload type.
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
payload_name[RTP_PAYLOAD_NAME_SIZE - 1] = 0;
|
|
|
|
|
strncpy(payload_name, payload->name, RTP_PAYLOAD_NAME_SIZE - 1);
|
|
|
|
|
|
|
|
|
|
rtp_payload_registry_->set_last_received_payload_type(payload_type);
|
|
|
|
|
|
|
|
|
|
re_initialize_decoder = true;
|
|
|
|
|
|
|
|
|
|
rtp_media_receiver_->SetLastMediaSpecificPayload(payload->typeSpecific);
|
|
|
|
|
rtp_media_receiver_->GetLastMediaSpecificPayload(specific_payload);
|
|
|
|
|
|
2017-09-28 20:13:59 +02:00
|
|
|
if (!payload->typeSpecific.is_audio()) {
|
2013-09-06 13:40:11 +00:00
|
|
|
bool media_type_unchanged =
|
|
|
|
|
rtp_payload_registry_->ReportMediaPayloadType(payload_type);
|
|
|
|
|
if (media_type_unchanged) {
|
|
|
|
|
// Only reset the decoder if the media codec type has changed.
|
2013-08-15 23:38:54 +00:00
|
|
|
re_initialize_decoder = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
rtp_media_receiver_->GetLastMediaSpecificPayload(specific_payload);
|
2015-12-15 02:54:47 -08:00
|
|
|
*is_red = false;
|
2013-08-15 23:38:54 +00:00
|
|
|
}
|
|
|
|
|
} // End critsect.
|
|
|
|
|
|
|
|
|
|
if (re_initialize_decoder) {
|
2015-09-17 23:03:57 +02:00
|
|
|
if (-1 ==
|
|
|
|
|
rtp_media_receiver_->InvokeOnInitializeDecoder(
|
|
|
|
|
cb_rtp_feedback_, payload_type, payload_name, *specific_payload)) {
|
2013-08-15 23:38:54 +00:00
|
|
|
return -1; // Wrong payload type.
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Implementation note: must not hold critsect when called.
|
2013-09-06 13:40:11 +00:00
|
|
|
void RtpReceiverImpl::CheckCSRC(const WebRtcRTPHeader& rtp_header) {
|
2013-08-15 23:38:54 +00:00
|
|
|
int32_t num_csrcs_diff = 0;
|
|
|
|
|
uint32_t old_remote_csrc[kRtpCsrcSize];
|
|
|
|
|
uint8_t old_num_csrcs = 0;
|
|
|
|
|
|
|
|
|
|
{
|
2016-04-14 03:05:31 -07:00
|
|
|
rtc::CritScope lock(&critical_section_rtp_receiver_);
|
2013-08-15 23:38:54 +00:00
|
|
|
|
|
|
|
|
if (!rtp_media_receiver_->ShouldReportCsrcChanges(
|
2013-09-06 13:40:11 +00:00
|
|
|
rtp_header.header.payloadType)) {
|
2013-08-15 23:38:54 +00:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
old_num_csrcs = num_csrcs_;
|
|
|
|
|
if (old_num_csrcs > 0) {
|
|
|
|
|
// Make a copy of old.
|
|
|
|
|
memcpy(old_remote_csrc, current_remote_csrc_,
|
|
|
|
|
num_csrcs_ * sizeof(uint32_t));
|
|
|
|
|
}
|
2013-09-06 13:40:11 +00:00
|
|
|
const uint8_t num_csrcs = rtp_header.header.numCSRCs;
|
2013-08-15 23:38:54 +00:00
|
|
|
if ((num_csrcs > 0) && (num_csrcs <= kRtpCsrcSize)) {
|
|
|
|
|
// Copy new.
|
|
|
|
|
memcpy(current_remote_csrc_,
|
2013-09-06 13:40:11 +00:00
|
|
|
rtp_header.header.arrOfCSRCs,
|
2013-08-15 23:38:54 +00:00
|
|
|
num_csrcs * sizeof(uint32_t));
|
|
|
|
|
}
|
|
|
|
|
if (num_csrcs > 0 || old_num_csrcs > 0) {
|
|
|
|
|
num_csrcs_diff = num_csrcs - old_num_csrcs;
|
|
|
|
|
num_csrcs_ = num_csrcs; // Update stored CSRCs.
|
|
|
|
|
} else {
|
|
|
|
|
// No change.
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
} // End critsect.
|
|
|
|
|
|
|
|
|
|
bool have_called_callback = false;
|
|
|
|
|
// Search for new CSRC in old array.
|
2013-09-06 13:40:11 +00:00
|
|
|
for (uint8_t i = 0; i < rtp_header.header.numCSRCs; ++i) {
|
|
|
|
|
const uint32_t csrc = rtp_header.header.arrOfCSRCs[i];
|
2013-08-15 23:38:54 +00:00
|
|
|
|
|
|
|
|
bool found_match = false;
|
|
|
|
|
for (uint8_t j = 0; j < old_num_csrcs; ++j) {
|
|
|
|
|
if (csrc == old_remote_csrc[j]) { // old list
|
|
|
|
|
found_match = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!found_match && csrc) {
|
|
|
|
|
// Didn't find it, report it as new.
|
|
|
|
|
have_called_callback = true;
|
2015-09-17 23:03:57 +02:00
|
|
|
cb_rtp_feedback_->OnIncomingCSRCChanged(csrc, true);
|
2013-08-15 23:38:54 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// Search for old CSRC in new array.
|
|
|
|
|
for (uint8_t i = 0; i < old_num_csrcs; ++i) {
|
|
|
|
|
const uint32_t csrc = old_remote_csrc[i];
|
|
|
|
|
|
|
|
|
|
bool found_match = false;
|
2013-09-06 13:40:11 +00:00
|
|
|
for (uint8_t j = 0; j < rtp_header.header.numCSRCs; ++j) {
|
|
|
|
|
if (csrc == rtp_header.header.arrOfCSRCs[j]) {
|
2013-08-15 23:38:54 +00:00
|
|
|
found_match = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!found_match && csrc) {
|
|
|
|
|
// Did not find it, report as removed.
|
|
|
|
|
have_called_callback = true;
|
2015-09-17 23:03:57 +02:00
|
|
|
cb_rtp_feedback_->OnIncomingCSRCChanged(csrc, false);
|
2013-08-15 23:38:54 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!have_called_callback) {
|
|
|
|
|
// If the CSRC list contain non-unique entries we will end up here.
|
|
|
|
|
// Using CSRC 0 to signal this event, not interop safe, other
|
|
|
|
|
// implementations might have CSRC 0 as a valid value.
|
|
|
|
|
if (num_csrcs_diff > 0) {
|
2015-09-17 23:03:57 +02:00
|
|
|
cb_rtp_feedback_->OnIncomingCSRCChanged(0, true);
|
2013-08-15 23:38:54 +00:00
|
|
|
} else if (num_csrcs_diff < 0) {
|
2015-09-17 23:03:57 +02:00
|
|
|
cb_rtp_feedback_->OnIncomingCSRCChanged(0, false);
|
2013-08-15 23:38:54 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-08-24 14:52:17 -07:00
|
|
|
void RtpReceiverImpl::UpdateSources(
|
|
|
|
|
const rtc::Optional<uint8_t>& ssrc_audio_level) {
|
Reland of Implemented the GetSources() in native code. (patchset #1 id:1 of https://codereview.webrtc.org/2809613002/ )
Reason for revert:
Re-land, reverting did not fix bug.
https://bugs.chromium.org/p/webrtc/issues/detail?id=7465
Original issue's description:
> Revert of Implemented the GetSources() in native code. (patchset #11 id:510001 of https://codereview.webrtc.org/2770233003/ )
>
> Reason for revert:
> Suspected of WebRtcApprtcBrowserTest.MANUAL_WorksOnApprtc breakage, see
>
> https://bugs.chromium.org/p/webrtc/issues/detail?id=7465
>
> Original issue's description:
> > Added the GetSources() to the RtpReceiverInterface and implemented
> > it for the AudioRtpReceiver.
> >
> > This method returns a vector of RtpSource(both CSRC source and SSRC
> > source) which contains the ID of a source, the timestamp, the source
> > type (SSRC or CSRC) and the audio level.
> >
> > The RtpSource objects are buffered and maintained by the
> > RtpReceiver in webrtc/modules/rtp_rtcp/. When the method is called,
> > the info of the contributing source will be pulled along the object
> > chain:
> > AudioRtpReceiver -> VoiceChannel -> WebRtcVoiceMediaChannel ->
> > AudioReceiveStream -> voe::Channel -> RtpRtcp module
> >
> > Spec:https://w3c.github.io/webrtc-pc/archives/20151006/webrtc.html#widl-RTCRtpReceiver-getContributingSources-sequence-RTCRtpContributingSource
> >
> > BUG=chromium:703122
> > TBR=stefan@webrtc.org, danilchap@webrtc.org
> >
> > Review-Url: https://codereview.webrtc.org/2770233003
> > Cr-Commit-Position: refs/heads/master@{#17591}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/292084c3765d9f3ee406ca2ec86eae206b540053
>
> TBR=deadbeef@webrtc.org,solenberg@webrtc.org,hbos@webrtc.org,philipel@webrtc.org,stefan@webrtc.org,danilchap@webrtc.org,zhihuang@webrtc.org
> # Not skipping CQ checks because original CL landed more than 1 days ago.
> BUG=chromium:703122
>
> Review-Url: https://codereview.webrtc.org/2809613002
> Cr-Commit-Position: refs/heads/master@{#17616}
> Committed: https://chromium.googlesource.com/external/webrtc/+/fbcc5cb3869d1370008e40f24fc03ac8fb69c675
TBR=deadbeef@webrtc.org,solenberg@webrtc.org,philipel@webrtc.org,stefan@webrtc.org,danilchap@webrtc.org,zhihuang@webrtc.org,olka@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:703122
Review-Url: https://codereview.webrtc.org/2810623003
Cr-Commit-Position: refs/heads/master@{#17621}
2017-04-10 07:39:05 -07:00
|
|
|
rtc::CritScope lock(&critical_section_rtp_receiver_);
|
|
|
|
|
int64_t now_ms = clock_->TimeInMilliseconds();
|
|
|
|
|
|
|
|
|
|
for (size_t i = 0; i < num_csrcs_; ++i) {
|
|
|
|
|
auto map_it = iterator_by_csrc_.find(current_remote_csrc_[i]);
|
|
|
|
|
if (map_it == iterator_by_csrc_.end()) {
|
|
|
|
|
// If it is a new CSRC, append a new object to the end of the list.
|
|
|
|
|
csrc_sources_.emplace_back(now_ms, current_remote_csrc_[i],
|
|
|
|
|
RtpSourceType::CSRC);
|
|
|
|
|
} else {
|
|
|
|
|
// If it is an existing CSRC, move the object to the end of the list.
|
|
|
|
|
map_it->second->update_timestamp_ms(now_ms);
|
|
|
|
|
csrc_sources_.splice(csrc_sources_.end(), csrc_sources_, map_it->second);
|
|
|
|
|
}
|
|
|
|
|
// Update the unordered_map.
|
|
|
|
|
iterator_by_csrc_[current_remote_csrc_[i]] = std::prev(csrc_sources_.end());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// If this is the first packet or the SSRC is changed, insert a new
|
|
|
|
|
// contributing source that uses the SSRC.
|
|
|
|
|
if (ssrc_sources_.empty() || ssrc_sources_.rbegin()->source_id() != ssrc_) {
|
|
|
|
|
ssrc_sources_.emplace_back(now_ms, ssrc_, RtpSourceType::SSRC);
|
|
|
|
|
} else {
|
|
|
|
|
ssrc_sources_.rbegin()->update_timestamp_ms(now_ms);
|
|
|
|
|
}
|
|
|
|
|
|
2017-08-24 14:52:17 -07:00
|
|
|
ssrc_sources_.back().set_audio_level(ssrc_audio_level);
|
|
|
|
|
|
Reland of Implemented the GetSources() in native code. (patchset #1 id:1 of https://codereview.webrtc.org/2809613002/ )
Reason for revert:
Re-land, reverting did not fix bug.
https://bugs.chromium.org/p/webrtc/issues/detail?id=7465
Original issue's description:
> Revert of Implemented the GetSources() in native code. (patchset #11 id:510001 of https://codereview.webrtc.org/2770233003/ )
>
> Reason for revert:
> Suspected of WebRtcApprtcBrowserTest.MANUAL_WorksOnApprtc breakage, see
>
> https://bugs.chromium.org/p/webrtc/issues/detail?id=7465
>
> Original issue's description:
> > Added the GetSources() to the RtpReceiverInterface and implemented
> > it for the AudioRtpReceiver.
> >
> > This method returns a vector of RtpSource(both CSRC source and SSRC
> > source) which contains the ID of a source, the timestamp, the source
> > type (SSRC or CSRC) and the audio level.
> >
> > The RtpSource objects are buffered and maintained by the
> > RtpReceiver in webrtc/modules/rtp_rtcp/. When the method is called,
> > the info of the contributing source will be pulled along the object
> > chain:
> > AudioRtpReceiver -> VoiceChannel -> WebRtcVoiceMediaChannel ->
> > AudioReceiveStream -> voe::Channel -> RtpRtcp module
> >
> > Spec:https://w3c.github.io/webrtc-pc/archives/20151006/webrtc.html#widl-RTCRtpReceiver-getContributingSources-sequence-RTCRtpContributingSource
> >
> > BUG=chromium:703122
> > TBR=stefan@webrtc.org, danilchap@webrtc.org
> >
> > Review-Url: https://codereview.webrtc.org/2770233003
> > Cr-Commit-Position: refs/heads/master@{#17591}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/292084c3765d9f3ee406ca2ec86eae206b540053
>
> TBR=deadbeef@webrtc.org,solenberg@webrtc.org,hbos@webrtc.org,philipel@webrtc.org,stefan@webrtc.org,danilchap@webrtc.org,zhihuang@webrtc.org
> # Not skipping CQ checks because original CL landed more than 1 days ago.
> BUG=chromium:703122
>
> Review-Url: https://codereview.webrtc.org/2809613002
> Cr-Commit-Position: refs/heads/master@{#17616}
> Committed: https://chromium.googlesource.com/external/webrtc/+/fbcc5cb3869d1370008e40f24fc03ac8fb69c675
TBR=deadbeef@webrtc.org,solenberg@webrtc.org,philipel@webrtc.org,stefan@webrtc.org,danilchap@webrtc.org,zhihuang@webrtc.org,olka@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:703122
Review-Url: https://codereview.webrtc.org/2810623003
Cr-Commit-Position: refs/heads/master@{#17621}
2017-04-10 07:39:05 -07:00
|
|
|
RemoveOutdatedSources(now_ms);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void RtpReceiverImpl::RemoveOutdatedSources(int64_t now_ms) {
|
|
|
|
|
std::list<RtpSource>::iterator it;
|
|
|
|
|
for (it = csrc_sources_.begin(); it != csrc_sources_.end(); ++it) {
|
|
|
|
|
if ((now_ms - it->timestamp_ms()) <= kGetSourcesTimeoutMs) {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
iterator_by_csrc_.erase(it->source_id());
|
|
|
|
|
}
|
|
|
|
|
csrc_sources_.erase(csrc_sources_.begin(), it);
|
|
|
|
|
|
|
|
|
|
std::vector<RtpSource>::iterator vec_it;
|
|
|
|
|
for (vec_it = ssrc_sources_.begin(); vec_it != ssrc_sources_.end();
|
|
|
|
|
++vec_it) {
|
|
|
|
|
if ((now_ms - vec_it->timestamp_ms()) <= kGetSourcesTimeoutMs) {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
ssrc_sources_.erase(ssrc_sources_.begin(), vec_it);
|
|
|
|
|
}
|
|
|
|
|
|
2013-08-15 23:38:54 +00:00
|
|
|
} // namespace webrtc
|