Moves locking outside function in RtpSender.

This CL moves the action of acquiring the lock outside
UpdateTransportSequenceNumber. This prepares for an upcoming CL where
the lock is used outside this call at the call sites and avoids the lock-unlock
overhead that would otherwise occur.

Also removing the const declaration as it modifies the state of
transport_sequence_number_allocator_.

Bug: webrtc:9796
Change-Id: I0bd4a0fd2fdbf6291867eb913690c61269eab8c5
Reviewed-on: https://webrtc-review.googlesource.com/c/102684
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25068}
This commit is contained in:
Sebastian Jansson
2018-10-09 18:27:36 +02:00
committed by Commit Bot
parent 789f459a06
commit 30e2d6ee00
2 changed files with 24 additions and 9 deletions

View File

@ -247,8 +247,8 @@ class RTPSender {
int64_t capture_time_ms,
uint32_t ssrc);
bool UpdateTransportSequenceNumber(RtpPacketToSend* packet,
int* packet_id) const;
bool UpdateTransportSequenceNumber(RtpPacketToSend* packet, int* packet_id)
RTC_EXCLUSIVE_LOCKS_REQUIRED(send_critsect_);
void UpdateRtpStats(const RtpPacketToSend& packet,
bool is_rtx,