Rename "OnReceivedFrame" to "OnAssembledFrame"
The new name fits better.
Bug: None
Change-Id: I1f201ff07915ed6c18efeefb7380e2b286742bb9
Reviewed-on: https://webrtc-review.googlesource.com/c/123800
Commit-Queue: Elad Alon <eladalon@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26814}
diff --git a/modules/video_coding/packet_buffer.cc b/modules/video_coding/packet_buffer.cc
index 781a5a2..11cc06e 100644
--- a/modules/video_coding/packet_buffer.cc
+++ b/modules/video_coding/packet_buffer.cc
@@ -36,15 +36,15 @@
Clock* clock,
size_t start_buffer_size,
size_t max_buffer_size,
- OnReceivedFrameCallback* received_frame_callback) {
+ OnAssembledFrameCallback* assembled_frame_callback) {
return rtc::scoped_refptr<PacketBuffer>(new PacketBuffer(
- clock, start_buffer_size, max_buffer_size, received_frame_callback));
+ clock, start_buffer_size, max_buffer_size, assembled_frame_callback));
}
PacketBuffer::PacketBuffer(Clock* clock,
size_t start_buffer_size,
size_t max_buffer_size,
- OnReceivedFrameCallback* received_frame_callback)
+ OnAssembledFrameCallback* assembled_frame_callback)
: clock_(clock),
size_(start_buffer_size),
max_size_(max_buffer_size),
@@ -53,7 +53,7 @@
is_cleared_to_first_seq_num_(false),
data_buffer_(start_buffer_size),
sequence_buffer_(start_buffer_size),
- received_frame_callback_(received_frame_callback),
+ assembled_frame_callback_(assembled_frame_callback),
unique_frames_seen_(0),
sps_pps_idr_is_h264_keyframe_(
field_trial::IsEnabled("WebRTC-SpsPpsIdrIsH264Keyframe")) {
@@ -133,7 +133,7 @@
}
for (std::unique_ptr<RtpFrameObject>& frame : found_frames)
- received_frame_callback_->OnReceivedFrame(std::move(frame));
+ assembled_frame_callback_->OnAssembledFrame(std::move(frame));
return true;
}
@@ -203,7 +203,7 @@
}
for (std::unique_ptr<RtpFrameObject>& frame : found_frames)
- received_frame_callback_->OnReceivedFrame(std::move(frame));
+ assembled_frame_callback_->OnAssembledFrame(std::move(frame));
}
absl::optional<int64_t> PacketBuffer::LastReceivedPacketMs() const {
diff --git a/modules/video_coding/packet_buffer.h b/modules/video_coding/packet_buffer.h
index 0da504f..20e0bff 100644
--- a/modules/video_coding/packet_buffer.h
+++ b/modules/video_coding/packet_buffer.h
@@ -32,11 +32,11 @@
class RtpFrameObject;
-// A received frame is a frame which has received all its packets.
-class OnReceivedFrameCallback {
+// A frame is assembled when all of its packets have been received.
+class OnAssembledFrameCallback {
public:
- virtual ~OnReceivedFrameCallback() {}
- virtual void OnReceivedFrame(std::unique_ptr<RtpFrameObject> frame) = 0;
+ virtual ~OnAssembledFrameCallback() {}
+ virtual void OnAssembledFrame(std::unique_ptr<RtpFrameObject> frame) = 0;
};
class PacketBuffer {
@@ -45,7 +45,7 @@
Clock* clock,
size_t start_buffer_size,
size_t max_buffer_size,
- OnReceivedFrameCallback* frame_callback);
+ OnAssembledFrameCallback* frame_callback);
virtual ~PacketBuffer();
@@ -72,7 +72,7 @@
PacketBuffer(Clock* clock,
size_t start_buffer_size,
size_t max_buffer_size,
- OnReceivedFrameCallback* frame_callback);
+ OnAssembledFrameCallback* frame_callback);
private:
friend RtpFrameObject;
@@ -155,8 +155,9 @@
// and information needed to determine the continuity between packets.
std::vector<ContinuityInfo> sequence_buffer_ RTC_GUARDED_BY(crit_);
- // Called when a received frame is found.
- OnReceivedFrameCallback* const received_frame_callback_;
+ // Called when all packets in a frame are received, allowing the frame
+ // to be assembled.
+ OnAssembledFrameCallback* const assembled_frame_callback_;
// Timestamp (not RTP timestamp) of the last received packet/keyframe packet.
absl::optional<int64_t> last_received_packet_ms_ RTC_GUARDED_BY(crit_);
diff --git a/modules/video_coding/video_packet_buffer_unittest.cc b/modules/video_coding/video_packet_buffer_unittest.cc
index 72bb990..c51c3b4 100644
--- a/modules/video_coding/video_packet_buffer_unittest.cc
+++ b/modules/video_coding/video_packet_buffer_unittest.cc
@@ -25,7 +25,7 @@
namespace video_coding {
class TestPacketBuffer : public ::testing::Test,
- public OnReceivedFrameCallback {
+ public OnAssembledFrameCallback {
protected:
TestPacketBuffer() : TestPacketBuffer("") {}
explicit TestPacketBuffer(std::string field_trials)
@@ -37,7 +37,7 @@
uint16_t Rand() { return rand_.Rand<uint16_t>(); }
- void OnReceivedFrame(std::unique_ptr<RtpFrameObject> frame) override {
+ void OnAssembledFrame(std::unique_ptr<RtpFrameObject> frame) override {
uint16_t first_seq_num = frame->first_seq_num();
if (frames_from_callback_.find(first_seq_num) !=
frames_from_callback_.end()) {
diff --git a/test/fuzzers/packet_buffer_fuzzer.cc b/test/fuzzers/packet_buffer_fuzzer.cc
index 56d1557..709c14c 100644
--- a/test/fuzzers/packet_buffer_fuzzer.cc
+++ b/test/fuzzers/packet_buffer_fuzzer.cc
@@ -15,8 +15,8 @@
namespace webrtc {
namespace {
-class NullCallback : public video_coding::OnReceivedFrameCallback {
- void OnReceivedFrame(std::unique_ptr<video_coding::RtpFrameObject> frame) {}
+class NullCallback : public video_coding::OnAssembledFrameCallback {
+ void OnAssembledFrame(std::unique_ptr<video_coding::RtpFrameObject> frame) {}
};
} // namespace
diff --git a/video/buffered_frame_decryptor_unittest.cc b/video/buffered_frame_decryptor_unittest.cc
index ff3f11a..9230b47 100644
--- a/video/buffered_frame_decryptor_unittest.cc
+++ b/video/buffered_frame_decryptor_unittest.cc
@@ -60,7 +60,7 @@
class BufferedFrameDecryptorTest
: public ::testing::Test,
public OnDecryptedFrameCallback,
- public video_coding::OnReceivedFrameCallback {
+ public video_coding::OnAssembledFrameCallback {
public:
// Implements the OnDecryptedFrameCallbackInterface
void OnDecryptedFrame(
@@ -68,8 +68,8 @@
decrypted_frame_call_count_++;
}
- // Implements the OnReceivedFrameCallback interface.
- void OnReceivedFrame(
+ // Implements the OnAssembledFrameCallback interface.
+ void OnAssembledFrame(
std::unique_ptr<video_coding::RtpFrameObject> frame) override {}
// Returns a new fake RtpFrameObject it abstracts the difficult construction
diff --git a/video/rtp_video_stream_receiver.cc b/video/rtp_video_stream_receiver.cc
index 1b17ac4..df492ff 100644
--- a/video/rtp_video_stream_receiver.cc
+++ b/video/rtp_video_stream_receiver.cc
@@ -382,7 +382,7 @@
return rtp_rtcp_->SendNACK(sequence_numbers, length);
}
-void RtpVideoStreamReceiver::OnReceivedFrame(
+void RtpVideoStreamReceiver::OnAssembledFrame(
std::unique_ptr<video_coding::RtpFrameObject> frame) {
RTC_DCHECK_RUN_ON(&network_tc_);
// Request a key frame as soon as possible.
diff --git a/video/rtp_video_stream_receiver.h b/video/rtp_video_stream_receiver.h
index c1ee662..08c3e5a 100644
--- a/video/rtp_video_stream_receiver.h
+++ b/video/rtp_video_stream_receiver.h
@@ -59,7 +59,7 @@
public RtpPacketSinkInterface,
public VCMFrameTypeCallback,
public VCMPacketRequestCallback,
- public video_coding::OnReceivedFrameCallback,
+ public video_coding::OnAssembledFrameCallback,
public video_coding::OnCompleteFrameCallback,
public OnDecryptedFrameCallback {
public:
@@ -127,8 +127,8 @@
int32_t ResendPackets(const uint16_t* sequenceNumbers,
uint16_t length) override;
- // Implements OnReceivedFrameCallback.
- void OnReceivedFrame(
+ // Implements OnAssembledFrameCallback.
+ void OnAssembledFrame(
std::unique_ptr<video_coding::RtpFrameObject> frame) override;
// Implements OnCompleteFrameCallback.