Delete RtpVideoStreamReceiver methods GetRtpReceiver and rtp_rtcp

Replaced by new method GetSyncInfo.

Bug: webrtc:7135
Change-Id: I541567a5ca173dc334fd85e83f15b25a3120b8aa
Reviewed-on: https://webrtc-review.googlesource.com/91123
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24148}
This commit is contained in:
Niels Möller
2018-07-31 08:29:53 +02:00
committed by Commit Bot
parent 168b4977f3
commit df9e9ae9ee
3 changed files with 24 additions and 19 deletions

View File

@ -175,8 +175,22 @@ bool RtpVideoStreamReceiver::AddReceiveCodec(
return rtp_payload_registry_.RegisterReceivePayload(video_codec) == 0;
}
RtpReceiver* RtpVideoStreamReceiver::GetRtpReceiver() const {
return rtp_receiver_.get();
absl::optional<Syncable::Info> RtpVideoStreamReceiver::GetSyncInfo() const {
Syncable::Info info;
if (!rtp_receiver_->GetLatestTimestamps(
&info.latest_received_capture_timestamp,
&info.latest_receive_time_ms)) {
return absl::nullopt;
}
if (rtp_rtcp_->RemoteNTP(&info.capture_time_ntp_secs,
&info.capture_time_ntp_frac, nullptr, nullptr,
&info.capture_time_source_clock) != 0) {
return absl::nullopt;
}
// Leaves info.current_delay_ms uninitialized.
return info;
}
int32_t RtpVideoStreamReceiver::OnReceivedPayloadData(

View File

@ -18,6 +18,7 @@
#include <vector>
#include "call/rtp_packet_sink_interface.h"
#include "call/syncable.h"
#include "call/video_receive_stream.h"
#include "modules/include/module_common_types.h"
#include "modules/rtp_rtcp/include/receive_statistics.h"
@ -75,12 +76,13 @@ class RtpVideoStreamReceiver : public RtpData,
bool AddReceiveCodec(const VideoCodec& video_codec,
const std::map<std::string, std::string>& codec_params);
RtpReceiver* GetRtpReceiver() const;
RtpRtcp* rtp_rtcp() const { return rtp_rtcp_.get(); }
void StartReceive();
void StopReceive();
// Produces the transport-related timestamps; current_delay_ms is left unset.
absl::optional<Syncable::Info> GetSyncInfo() const;
bool DeliverRtcp(const uint8_t* rtcp_packet, size_t rtcp_packet_length);
void FrameContinuous(int64_t seq_num);

View File

@ -371,24 +371,13 @@ int VideoReceiveStream::id() const {
absl::optional<Syncable::Info> VideoReceiveStream::GetInfo() const {
RTC_DCHECK_CALLED_SEQUENTIALLY(&module_process_sequence_checker_);
Syncable::Info info;
absl::optional<Syncable::Info> info =
rtp_video_stream_receiver_.GetSyncInfo();
RtpReceiver* rtp_receiver = rtp_video_stream_receiver_.GetRtpReceiver();
RTC_DCHECK(rtp_receiver);
if (!rtp_receiver->GetLatestTimestamps(
&info.latest_received_capture_timestamp,
&info.latest_receive_time_ms))
if (!info)
return absl::nullopt;
RtpRtcp* rtp_rtcp = rtp_video_stream_receiver_.rtp_rtcp();
RTC_DCHECK(rtp_rtcp);
if (rtp_rtcp->RemoteNTP(&info.capture_time_ntp_secs,
&info.capture_time_ntp_frac, nullptr, nullptr,
&info.capture_time_source_clock) != 0) {
return absl::nullopt;
}
info.current_delay_ms = video_receiver_.Delay();
info->current_delay_ms = video_receiver_.Delay();
return info;
}