Skip to content

Commit

Permalink
Delete RtpVideoStreamReceiver methods GetRtpReceiver and rtp_rtcp
Browse files Browse the repository at this point in the history
Replaced by new method GetSyncInfo.

Bug: webrtc:7135
Change-Id: I541567a5ca173dc334fd85e83f15b25a3120b8aa
Reviewed-on: https://webrtc-review.googlesource.com/91123
Commit-Queue: Niels Moller <[email protected]>
Reviewed-by: Erik Språng <[email protected]>
Cr-Commit-Position: refs/heads/master@{#24148}
  • Loading branch information
Niels Möller authored and Commit Bot committed Jul 31, 2018
1 parent 168b497 commit df9e9ae
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 19 deletions.
18 changes: 16 additions & 2 deletions video/rtp_video_stream_receiver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
6 changes: 4 additions & 2 deletions video/rtp_video_stream_receiver.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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);
Expand Down
19 changes: 4 additions & 15 deletions video/video_receive_stream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit df9e9ae

Please sign in to comment.