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}
This commit is contained in:
@ -36,15 +36,15 @@ rtc::scoped_refptr<PacketBuffer> PacketBuffer::Create(
|
||||
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 @@ PacketBuffer::PacketBuffer(Clock* clock,
|
||||
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 @@ bool PacketBuffer::InsertPacket(VCMPacket* packet) {
|
||||
}
|
||||
|
||||
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 @@ void PacketBuffer::PaddingReceived(uint16_t seq_num) {
|
||||
}
|
||||
|
||||
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 {
|
||||
|
||||
@ -32,11 +32,11 @@ namespace video_coding {
|
||||
|
||||
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 @@ class PacketBuffer {
|
||||
Clock* clock,
|
||||
size_t start_buffer_size,
|
||||
size_t max_buffer_size,
|
||||
OnReceivedFrameCallback* frame_callback);
|
||||
OnAssembledFrameCallback* frame_callback);
|
||||
|
||||
virtual ~PacketBuffer();
|
||||
|
||||
@ -72,7 +72,7 @@ class PacketBuffer {
|
||||
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 @@ class PacketBuffer {
|
||||
// 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_);
|
||||
|
||||
@ -25,7 +25,7 @@ namespace webrtc {
|
||||
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 @@ class TestPacketBuffer : public ::testing::Test,
|
||||
|
||||
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()) {
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -60,7 +60,7 @@ class FakePacketBuffer : public video_coding::PacketBuffer {
|
||||
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 @@ class BufferedFrameDecryptorTest
|
||||
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
|
||||
|
||||
@ -382,7 +382,7 @@ int32_t RtpVideoStreamReceiver::ResendPackets(const uint16_t* sequence_numbers,
|
||||
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.
|
||||
|
||||
@ -59,7 +59,7 @@ class RtpVideoStreamReceiver : public RecoveredPacketReceiver,
|
||||
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 @@ class RtpVideoStreamReceiver : public RecoveredPacketReceiver,
|
||||
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.
|
||||
|
||||
Reference in New Issue
Block a user