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()) {