Backed out 3 changesets (bug 1748458, bug 1748478) for causing crashes in FrameBuffer.

CLOSED TREE

Backed out changeset 579f107e3a5e (bug 1748458)
Backed out changeset 89ac7dfe4265 (bug 1748458)
Backed out changeset 95c08b064dea (bug 1748478)
This commit is contained in:
Alexandru Michis 2022-01-05 20:28:20 +02:00
Родитель ae59fd393e
Коммит 643992c765
3 изменённых файлов: 0 добавлений и 66 удалений

Просмотреть файл

@ -261,20 +261,7 @@ EncodedFrame* FrameBuffer::GetNextFrame() {
}
return frame.second.frame != nullptr;
});
if (discarded_packets > 0) {
const auto& pis = frame_it->second.frame->PacketInfos();
TRACE_EVENT2("webrtc",
"FrameBuffer::GetNextFrame Discarding Old Packets",
"remote_ssrc", pis.empty() ? 0 : pis[0].ssrc(), "picture_id",
frame_it->first.picture_id);
stats_callback_->OnDiscardedPackets(discarded_packets);
}
if (dropped_frames > 0) {
const auto& pis = frame_it->second.frame->PacketInfos();
TRACE_EVENT2("webrtc",
"FrameBuffer::GetNextFrame Dropping Old Frames",
"remote_ssrc", pis.empty() ? 0 : pis[0].ssrc(), "picture_id",
frame_it->first.picture_id);
stats_callback_->OnDroppedFrames(dropped_frames);
}
}
@ -451,16 +438,11 @@ int64_t FrameBuffer::InsertFrame(std::unique_ptr<EncodedFrame> frame) {
MutexLock lock(&mutex_);
const auto& pis = frame->PacketInfos();
const VideoLayerFrameId& id = frame->id;
int64_t last_continuous_picture_id =
!last_continuous_frame_ ? -1 : last_continuous_frame_->picture_id;
if (!ValidReferences(*frame)) {
TRACE_EVENT2("webrtc",
"FrameBuffer::InsertFrame Frame dropped (Invalid references)",
"remote_ssrc", pis.empty() ? 0 : pis[0].ssrc(), "picture_id",
id.picture_id);
RTC_LOG(LS_WARNING) << "Frame with (picture_id:spatial_id) ("
<< id.picture_id << ":"
<< static_cast<int>(id.spatial_layer)
@ -470,10 +452,6 @@ int64_t FrameBuffer::InsertFrame(std::unique_ptr<EncodedFrame> frame) {
if (frames_.size() >= kMaxFramesBuffered) {
if (frame->is_keyframe()) {
TRACE_EVENT2("webrtc",
"FrameBuffer::InsertFrame Frames dropped (KF + Full buffer)",
"remote_ssrc", pis.empty() ? 0 : pis[0].ssrc(), "picture_id",
id.picture_id);
RTC_LOG(LS_WARNING) << "Inserting keyframe (picture_id:spatial_id) ("
<< id.picture_id << ":"
<< static_cast<int>(id.spatial_layer)
@ -481,10 +459,6 @@ int64_t FrameBuffer::InsertFrame(std::unique_ptr<EncodedFrame> frame) {
" buffer and inserting the frame.";
ClearFramesAndHistory();
} else {
TRACE_EVENT2("webrtc",
"FrameBuffer::InsertFrame Frame dropped (Full buffer)",
"remote_ssrc", pis.empty() ? 0 : pis[0].ssrc(), "picture_id",
id.picture_id);
RTC_LOG(LS_WARNING) << "Frame with (picture_id:spatial_id) ("
<< id.picture_id << ":"
<< static_cast<int>(id.spatial_layer)
@ -505,19 +479,11 @@ int64_t FrameBuffer::InsertFrame(std::unique_ptr<EncodedFrame> frame) {
// reconfiguration or some other reason. Even though this is not according
// to spec we can still continue to decode from this frame if it is a
// keyframe.
TRACE_EVENT2("webrtc",
"FrameBuffer::InsertFrame Frames dropped (OOO + PicId jump)",
"remote_ssrc", pis.empty() ? 0 : pis[0].ssrc(), "picture_id",
id.picture_id);
RTC_LOG(LS_WARNING)
<< "A jump in picture id was detected, clearing buffer.";
ClearFramesAndHistory();
last_continuous_picture_id = -1;
} else {
TRACE_EVENT2("webrtc",
"FrameBuffer::InsertFrame Frame dropped (Out of order)",
"remote_ssrc", pis.empty() ? 0 : pis[0].ssrc(), "picture_id",
id.picture_id);
RTC_LOG(LS_WARNING) << "Frame with (picture_id:spatial_id) ("
<< id.picture_id << ":"
<< static_cast<int>(id.spatial_layer)
@ -534,10 +500,6 @@ int64_t FrameBuffer::InsertFrame(std::unique_ptr<EncodedFrame> frame) {
// when the picture id make large jumps mid stream.
if (!frames_.empty() && id < frames_.begin()->first &&
frames_.rbegin()->first < id) {
TRACE_EVENT2("webrtc",
"FrameBuffer::InsertFrame Frames dropped (PicId big-jump)",
"remote_ssrc", pis.empty() ? 0 : pis[0].ssrc(), "picture_id",
id.picture_id);
RTC_LOG(LS_WARNING)
<< "A jump in picture id was detected, clearing buffer.";
ClearFramesAndHistory();
@ -557,10 +519,6 @@ int64_t FrameBuffer::InsertFrame(std::unique_ptr<EncodedFrame> frame) {
timing_->IncomingTimestamp(frame->Timestamp(), frame->ReceivedTime());
if (stats_callback_ && IsCompleteSuperFrame(*frame)) {
TRACE_EVENT2("webrtc",
"FrameBuffer::InsertFrame Frame Complete",
"remote_ssrc", pis.empty() ? 0 : pis[0].ssrc(), "picture_id",
id.picture_id);
stats_callback_->OnCompleteFrame(frame->is_keyframe(), frame->size(),
frame->contentType());
}

Просмотреть файл

@ -21,7 +21,6 @@
#include "rtc_base/task_utils/to_queued_task.h"
#include "rtc_base/thread.h"
#include "rtc_base/time_utils.h"
#include "rtc_base/trace_event.h"
#include "system_wrappers/include/clock.h"
#include "system_wrappers/include/field_trial.h"
#include "system_wrappers/include/metrics.h"
@ -974,9 +973,6 @@ void ReceiveStatisticsProxy::OnCompleteFrame(bool is_keyframe,
VideoContentType content_type) {
RTC_DCHECK_RUN_ON(&main_thread_);
TRACE_EVENT2("webrtc", "ReceiveStatisticsProxy::OnCompleteFrame",
"remote_ssrc", remote_ssrc_, "is_keyframe", is_keyframe);
if (is_keyframe) {
++stats_.frame_counts.key_frames;
} else {
@ -1008,8 +1004,6 @@ void ReceiveStatisticsProxy::OnCompleteFrame(bool is_keyframe,
void ReceiveStatisticsProxy::OnDroppedFrames(uint32_t frames_dropped) {
// Can be called on either the decode queue or the worker thread
// See FrameBuffer2 for more details.
TRACE_EVENT2("webrtc", "ReceiveStatisticsProxy::OnDroppedFrames",
"remote_ssrc", remote_ssrc_, "frames_dropped", frames_dropped);
worker_thread_->PostTask(ToQueuedTask(task_safety_, [frames_dropped, this]() {
RTC_DCHECK_RUN_ON(&main_thread_);
stats_.frames_dropped += frames_dropped;
@ -1018,9 +1012,6 @@ void ReceiveStatisticsProxy::OnDroppedFrames(uint32_t frames_dropped) {
void ReceiveStatisticsProxy::OnDiscardedPackets(uint32_t packets_discarded) {
RTC_DCHECK_RUN_ON(&main_thread_);
TRACE_EVENT2("webrtc", "ReceiveStatisticsProxy::OnDiscardedPackets",
"remote_ssrc", remote_ssrc_, "packets_discarded",
packets_discarded);
stats_.packets_discarded += packets_discarded;
}
@ -1049,8 +1040,6 @@ void ReceiveStatisticsProxy::OnStreamInactive() {
void ReceiveStatisticsProxy::OnRttUpdate(int64_t avg_rtt_ms) {
RTC_DCHECK_RUN_ON(&main_thread_);
TRACE_EVENT2("webrtc", "ReceiveStatisticsProxy::OnRttUpdate",
"remote_ssrc", remote_ssrc_, "avg_rtt_ms", avg_rtt_ms);
avg_rtt_ms_ = avg_rtt_ms;
}

Просмотреть файл

@ -46,7 +46,6 @@
#include "rtc_base/location.h"
#include "rtc_base/logging.h"
#include "rtc_base/strings/string_builder.h"
#include "rtc_base/trace_event.h"
#include "system_wrappers/include/field_trial.h"
#include "system_wrappers/include/metrics.h"
#include "system_wrappers/include/ntp_time.h"
@ -686,13 +685,6 @@ void RtpVideoStreamReceiver2::OnRtpPacket(const RtpPacketReceived& packet) {
void RtpVideoStreamReceiver2::RequestKeyFrame() {
RTC_DCHECK_RUN_ON(&worker_task_checker_);
TRACE_EVENT2("webrtc", "RtpVideoStreamReceiver2::RequestKeyFrame",
"remote_ssrc", config_.rtp.remote_ssrc, "method",
keyframe_request_sender_ ? "KFRSender"
: keyframe_request_method_ == KeyFrameReqMethod::kPliRtcp ? "PLI"
: keyframe_request_method_ == KeyFrameReqMethod::kFirRtcp ? "FIR"
: keyframe_request_method_ == KeyFrameReqMethod::kNone ? "None"
: "Other");
// TODO(bugs.webrtc.org/10336): Allow the sender to ignore key frame requests
// issued by anything other than the LossNotificationController if it (the
// sender) is relying on LNTF alone.
@ -1110,11 +1102,6 @@ void RtpVideoStreamReceiver2::FrameDecoded(int64_t picture_id) {
if (seq_num != -1) {
uint32_t num_packets_cleared = packet_buffer_.ClearTo(seq_num);
if (num_packets_cleared > 0) {
TRACE_EVENT2("webrtc",
"RtpVideoStreamReceiver2::FrameDecoded Cleared Old Packets",
"remote_ssrc", config_.rtp.remote_ssrc, "seq_num", seq_num);
}
vcm_receive_statistics_->OnDiscardedPackets(num_packets_cleared);
reference_finder_->ClearTo(seq_num);
}