Index: webrtc/modules/rtp_rtcp/source/rtp_packet_history.h |
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_packet_history.h b/webrtc/modules/rtp_rtcp/source/rtp_packet_history.h |
index dc2b35a375511d226ebd9af0df64809531b16d03..01b8b59403b16b5ba9491f8f8811522bc38bdfdb 100644 |
--- a/webrtc/modules/rtp_rtcp/source/rtp_packet_history.h |
+++ b/webrtc/modules/rtp_rtcp/source/rtp_packet_history.h |
@@ -49,8 +49,19 @@ class RtpPacketHistory { |
int64_t min_elapsed_time_ms, |
bool retransmit); |
+ // Gets the packet, of which the size is closest to |packet_size|. |
std::unique_ptr<RtpPacketToSend> GetBestFittingPacket( |
- size_t packet_size) const; |
+ size_t packet_size) const { |
+ return GetBestFittingPacket(packet_size, true); |
+ } |
+ |
+ // Gets the best fitting packet. When |include_header| is true, it gets the |
+ // packet of which the total size is closest to |packet_size|, otherwise, it |
+ // fits the payload size. |
+ // TODO(minyue): Remove this method when we start to always include header. |
+ std::unique_ptr<RtpPacketToSend> GetBestFittingPacket( |
+ size_t packet_size, |
+ bool include_header) const; |
bool HasRtpPacket(uint16_t sequence_number) const; |
@@ -70,7 +81,7 @@ class RtpPacketHistory { |
void Free() EXCLUSIVE_LOCKS_REQUIRED(critsect_); |
bool FindSeqNum(uint16_t sequence_number, int* index) const |
EXCLUSIVE_LOCKS_REQUIRED(critsect_); |
- int FindBestFittingPacket(size_t size) const |
+ int FindBestFittingPacket(size_t size, bool include_header) const |
EXCLUSIVE_LOCKS_REQUIRED(critsect_); |
Clock* clock_; |