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,
|
Clock* clock,
|
||||||
size_t start_buffer_size,
|
size_t start_buffer_size,
|
||||||
size_t max_buffer_size,
|
size_t max_buffer_size,
|
||||||
OnReceivedFrameCallback* received_frame_callback) {
|
OnAssembledFrameCallback* assembled_frame_callback) {
|
||||||
return rtc::scoped_refptr<PacketBuffer>(new PacketBuffer(
|
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,
|
PacketBuffer::PacketBuffer(Clock* clock,
|
||||||
size_t start_buffer_size,
|
size_t start_buffer_size,
|
||||||
size_t max_buffer_size,
|
size_t max_buffer_size,
|
||||||
OnReceivedFrameCallback* received_frame_callback)
|
OnAssembledFrameCallback* assembled_frame_callback)
|
||||||
: clock_(clock),
|
: clock_(clock),
|
||||||
size_(start_buffer_size),
|
size_(start_buffer_size),
|
||||||
max_size_(max_buffer_size),
|
max_size_(max_buffer_size),
|
||||||
@ -53,7 +53,7 @@ PacketBuffer::PacketBuffer(Clock* clock,
|
|||||||
is_cleared_to_first_seq_num_(false),
|
is_cleared_to_first_seq_num_(false),
|
||||||
data_buffer_(start_buffer_size),
|
data_buffer_(start_buffer_size),
|
||||||
sequence_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),
|
unique_frames_seen_(0),
|
||||||
sps_pps_idr_is_h264_keyframe_(
|
sps_pps_idr_is_h264_keyframe_(
|
||||||
field_trial::IsEnabled("WebRTC-SpsPpsIdrIsH264Keyframe")) {
|
field_trial::IsEnabled("WebRTC-SpsPpsIdrIsH264Keyframe")) {
|
||||||
@ -133,7 +133,7 @@ bool PacketBuffer::InsertPacket(VCMPacket* packet) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (std::unique_ptr<RtpFrameObject>& frame : found_frames)
|
for (std::unique_ptr<RtpFrameObject>& frame : found_frames)
|
||||||
received_frame_callback_->OnReceivedFrame(std::move(frame));
|
assembled_frame_callback_->OnAssembledFrame(std::move(frame));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -203,7 +203,7 @@ void PacketBuffer::PaddingReceived(uint16_t seq_num) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (std::unique_ptr<RtpFrameObject>& frame : found_frames)
|
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 {
|
absl::optional<int64_t> PacketBuffer::LastReceivedPacketMs() const {
|
||||||
|
|||||||
@ -32,11 +32,11 @@ namespace video_coding {
|
|||||||
|
|
||||||
class RtpFrameObject;
|
class RtpFrameObject;
|
||||||
|
|
||||||
// A received frame is a frame which has received all its packets.
|
// A frame is assembled when all of its packets have been received.
|
||||||
class OnReceivedFrameCallback {
|
class OnAssembledFrameCallback {
|
||||||
public:
|
public:
|
||||||
virtual ~OnReceivedFrameCallback() {}
|
virtual ~OnAssembledFrameCallback() {}
|
||||||
virtual void OnReceivedFrame(std::unique_ptr<RtpFrameObject> frame) = 0;
|
virtual void OnAssembledFrame(std::unique_ptr<RtpFrameObject> frame) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
class PacketBuffer {
|
class PacketBuffer {
|
||||||
@ -45,7 +45,7 @@ class PacketBuffer {
|
|||||||
Clock* clock,
|
Clock* clock,
|
||||||
size_t start_buffer_size,
|
size_t start_buffer_size,
|
||||||
size_t max_buffer_size,
|
size_t max_buffer_size,
|
||||||
OnReceivedFrameCallback* frame_callback);
|
OnAssembledFrameCallback* frame_callback);
|
||||||
|
|
||||||
virtual ~PacketBuffer();
|
virtual ~PacketBuffer();
|
||||||
|
|
||||||
@ -72,7 +72,7 @@ class PacketBuffer {
|
|||||||
PacketBuffer(Clock* clock,
|
PacketBuffer(Clock* clock,
|
||||||
size_t start_buffer_size,
|
size_t start_buffer_size,
|
||||||
size_t max_buffer_size,
|
size_t max_buffer_size,
|
||||||
OnReceivedFrameCallback* frame_callback);
|
OnAssembledFrameCallback* frame_callback);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend RtpFrameObject;
|
friend RtpFrameObject;
|
||||||
@ -155,8 +155,9 @@ class PacketBuffer {
|
|||||||
// and information needed to determine the continuity between packets.
|
// and information needed to determine the continuity between packets.
|
||||||
std::vector<ContinuityInfo> sequence_buffer_ RTC_GUARDED_BY(crit_);
|
std::vector<ContinuityInfo> sequence_buffer_ RTC_GUARDED_BY(crit_);
|
||||||
|
|
||||||
// Called when a received frame is found.
|
// Called when all packets in a frame are received, allowing the frame
|
||||||
OnReceivedFrameCallback* const received_frame_callback_;
|
// to be assembled.
|
||||||
|
OnAssembledFrameCallback* const assembled_frame_callback_;
|
||||||
|
|
||||||
// Timestamp (not RTP timestamp) of the last received packet/keyframe packet.
|
// Timestamp (not RTP timestamp) of the last received packet/keyframe packet.
|
||||||
absl::optional<int64_t> last_received_packet_ms_ RTC_GUARDED_BY(crit_);
|
absl::optional<int64_t> last_received_packet_ms_ RTC_GUARDED_BY(crit_);
|
||||||
|
|||||||
@ -25,7 +25,7 @@ namespace webrtc {
|
|||||||
namespace video_coding {
|
namespace video_coding {
|
||||||
|
|
||||||
class TestPacketBuffer : public ::testing::Test,
|
class TestPacketBuffer : public ::testing::Test,
|
||||||
public OnReceivedFrameCallback {
|
public OnAssembledFrameCallback {
|
||||||
protected:
|
protected:
|
||||||
TestPacketBuffer() : TestPacketBuffer("") {}
|
TestPacketBuffer() : TestPacketBuffer("") {}
|
||||||
explicit TestPacketBuffer(std::string field_trials)
|
explicit TestPacketBuffer(std::string field_trials)
|
||||||
@ -37,7 +37,7 @@ class TestPacketBuffer : public ::testing::Test,
|
|||||||
|
|
||||||
uint16_t Rand() { return rand_.Rand<uint16_t>(); }
|
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();
|
uint16_t first_seq_num = frame->first_seq_num();
|
||||||
if (frames_from_callback_.find(first_seq_num) !=
|
if (frames_from_callback_.find(first_seq_num) !=
|
||||||
frames_from_callback_.end()) {
|
frames_from_callback_.end()) {
|
||||||
|
|||||||
@ -15,8 +15,8 @@
|
|||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
namespace {
|
namespace {
|
||||||
class NullCallback : public video_coding::OnReceivedFrameCallback {
|
class NullCallback : public video_coding::OnAssembledFrameCallback {
|
||||||
void OnReceivedFrame(std::unique_ptr<video_coding::RtpFrameObject> frame) {}
|
void OnAssembledFrame(std::unique_ptr<video_coding::RtpFrameObject> frame) {}
|
||||||
};
|
};
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
|||||||
@ -60,7 +60,7 @@ class FakePacketBuffer : public video_coding::PacketBuffer {
|
|||||||
class BufferedFrameDecryptorTest
|
class BufferedFrameDecryptorTest
|
||||||
: public ::testing::Test,
|
: public ::testing::Test,
|
||||||
public OnDecryptedFrameCallback,
|
public OnDecryptedFrameCallback,
|
||||||
public video_coding::OnReceivedFrameCallback {
|
public video_coding::OnAssembledFrameCallback {
|
||||||
public:
|
public:
|
||||||
// Implements the OnDecryptedFrameCallbackInterface
|
// Implements the OnDecryptedFrameCallbackInterface
|
||||||
void OnDecryptedFrame(
|
void OnDecryptedFrame(
|
||||||
@ -68,8 +68,8 @@ class BufferedFrameDecryptorTest
|
|||||||
decrypted_frame_call_count_++;
|
decrypted_frame_call_count_++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Implements the OnReceivedFrameCallback interface.
|
// Implements the OnAssembledFrameCallback interface.
|
||||||
void OnReceivedFrame(
|
void OnAssembledFrame(
|
||||||
std::unique_ptr<video_coding::RtpFrameObject> frame) override {}
|
std::unique_ptr<video_coding::RtpFrameObject> frame) override {}
|
||||||
|
|
||||||
// Returns a new fake RtpFrameObject it abstracts the difficult construction
|
// 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);
|
return rtp_rtcp_->SendNACK(sequence_numbers, length);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RtpVideoStreamReceiver::OnReceivedFrame(
|
void RtpVideoStreamReceiver::OnAssembledFrame(
|
||||||
std::unique_ptr<video_coding::RtpFrameObject> frame) {
|
std::unique_ptr<video_coding::RtpFrameObject> frame) {
|
||||||
RTC_DCHECK_RUN_ON(&network_tc_);
|
RTC_DCHECK_RUN_ON(&network_tc_);
|
||||||
// Request a key frame as soon as possible.
|
// Request a key frame as soon as possible.
|
||||||
|
|||||||
@ -59,7 +59,7 @@ class RtpVideoStreamReceiver : public RecoveredPacketReceiver,
|
|||||||
public RtpPacketSinkInterface,
|
public RtpPacketSinkInterface,
|
||||||
public VCMFrameTypeCallback,
|
public VCMFrameTypeCallback,
|
||||||
public VCMPacketRequestCallback,
|
public VCMPacketRequestCallback,
|
||||||
public video_coding::OnReceivedFrameCallback,
|
public video_coding::OnAssembledFrameCallback,
|
||||||
public video_coding::OnCompleteFrameCallback,
|
public video_coding::OnCompleteFrameCallback,
|
||||||
public OnDecryptedFrameCallback {
|
public OnDecryptedFrameCallback {
|
||||||
public:
|
public:
|
||||||
@ -127,8 +127,8 @@ class RtpVideoStreamReceiver : public RecoveredPacketReceiver,
|
|||||||
int32_t ResendPackets(const uint16_t* sequenceNumbers,
|
int32_t ResendPackets(const uint16_t* sequenceNumbers,
|
||||||
uint16_t length) override;
|
uint16_t length) override;
|
||||||
|
|
||||||
// Implements OnReceivedFrameCallback.
|
// Implements OnAssembledFrameCallback.
|
||||||
void OnReceivedFrame(
|
void OnAssembledFrame(
|
||||||
std::unique_ptr<video_coding::RtpFrameObject> frame) override;
|
std::unique_ptr<video_coding::RtpFrameObject> frame) override;
|
||||||
|
|
||||||
// Implements OnCompleteFrameCallback.
|
// Implements OnCompleteFrameCallback.
|
||||||
|
|||||||
Reference in New Issue
Block a user