Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(204)

Unified Diff: webrtc/modules/rtp_rtcp/source/rtp_sender.h

Issue 2217383002: Use RtpPacketToSend in RtpSenderVideo (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/rtp_rtcp/source/rtp_sender.h
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_sender.h b/webrtc/modules/rtp_rtcp/source/rtp_sender.h
index dac96edd263493a88dc966bf122c8f52c7421499..103b86897d3f42f98f0dd852d5ed3629796fa323 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_sender.h
+++ b/webrtc/modules/rtp_rtcp/source/rtp_sender.h
@@ -114,66 +114,12 @@ class RTPSender {
uint32_t* transport_frame_id_out);
// RTP header extension
- int32_t SetTransmissionTimeOffset(int32_t transmission_time_offset);
- int32_t SetAbsoluteSendTime(uint32_t absolute_send_time);
- void SetVideoRotation(VideoRotation rotation);
- int32_t SetTransportSequenceNumber(uint16_t sequence_number);
-
int32_t RegisterRtpHeaderExtension(RTPExtensionType type, uint8_t id);
bool IsRtpHeaderExtensionRegistered(RTPExtensionType type);
int32_t DeregisterRtpHeaderExtension(RTPExtensionType type);
size_t RtpHeaderExtensionLength() const;
- uint16_t BuildRtpHeaderExtension(uint8_t* data_buffer, bool marker_bit) const
- EXCLUSIVE_LOCKS_REQUIRED(send_critsect_);
-
- uint8_t BuildTransmissionTimeOffsetExtension(uint8_t* data_buffer) const
- EXCLUSIVE_LOCKS_REQUIRED(send_critsect_);
- uint8_t BuildAudioLevelExtension(uint8_t* data_buffer) const
- EXCLUSIVE_LOCKS_REQUIRED(send_critsect_);
- uint8_t BuildAbsoluteSendTimeExtension(uint8_t* data_buffer) const
- EXCLUSIVE_LOCKS_REQUIRED(send_critsect_);
- uint8_t BuildVideoRotationExtension(uint8_t* data_buffer) const
- EXCLUSIVE_LOCKS_REQUIRED(send_critsect_);
- uint8_t BuildTransportSequenceNumberExtension(uint8_t* data_buffer,
- uint16_t sequence_number) const
- EXCLUSIVE_LOCKS_REQUIRED(send_critsect_);
- uint8_t BuildPlayoutDelayExtension(uint8_t* data_buffer,
- uint16_t min_playout_delay_ms,
- uint16_t max_playout_delay_ms) const
- EXCLUSIVE_LOCKS_REQUIRED(send_critsect_);
-
- // Verifies that the specified extension is registered, and that it is
- // present in rtp packet. If extension is not registered kNotRegistered is
- // returned. If extension cannot be found in the rtp header, or if it is
- // malformed, kError is returned. Otherwise *extension_offset is set to the
- // offset of the extension from the beginning of the rtp packet and kOk is
- // returned.
- enum class ExtensionStatus {
- kNotRegistered,
- kOk,
- kError,
- };
- ExtensionStatus VerifyExtension(RTPExtensionType extension_type,
- uint8_t* rtp_packet,
- size_t rtp_packet_length,
- const RTPHeader& rtp_header,
- size_t extension_length_bytes,
- size_t* extension_offset) const
- EXCLUSIVE_LOCKS_REQUIRED(send_critsect_);
-
- bool UpdateAudioLevel(uint8_t* rtp_packet,
- size_t rtp_packet_length,
- const RTPHeader& rtp_header,
- bool is_voiced,
- uint8_t dBov) const;
-
- bool UpdateVideoRotation(uint8_t* rtp_packet,
- size_t rtp_packet_length,
- const RTPHeader& rtp_header,
- VideoRotation rotation) const;
-
bool TimeToSendPacket(uint16_t sequence_number,
int64_t capture_time_ms,
bool retransmission,
@@ -204,19 +150,16 @@ class RTPSender {
void SetRtxPayloadType(int payload_type, int associated_payload_type);
- // Functions wrapping RTPSenderInterface.
- int32_t BuildRTPheader(uint8_t* data_buffer,
- int8_t payload_type,
- bool marker_bit,
- uint32_t capture_timestamp,
- int64_t capture_time_ms,
- bool timestamp_provided = true,
- bool inc_sequence_number = true);
- int32_t BuildRtpHeader(uint8_t* data_buffer,
- int8_t payload_type,
- bool marker_bit,
- uint32_t capture_timestamp,
- int64_t capture_time_ms);
+ // Create empty packet, fills ssrc. Unless |minimalistic| flag is set
+ // also set csrcs and reserve place for registered header extensions
+ // RtpSender updates before sending.
+ std::unique_ptr<RtpPacketToSend> AllocatePacket(bool minimalistic) const;
+ // Allocates sequence_number, update packet->Timstamp() with start_timestamp_
+ // offset, updates RtpSender last_send fields with values from |packet|.
+ // Return false of RtpSender not ready to send any more (i.e. destructing).
+ bool PrepareToSend(RtpPacketToSend* packet);
+
+ uint32_t TimestampOffset(uint32_t capture_rtp_timestamp) const;
size_t RtpHeaderLength() const;
uint16_t AllocateSequenceNumber(uint16_t packets_to_send);
@@ -226,13 +169,6 @@ class RTPSender {
uint32_t Timestamp() const;
uint32_t SSRC() const;
- // Deprecated. Create RtpPacketToSend instead and use next function.
- bool SendToNetwork(uint8_t* data_buffer,
- size_t payload_length,
- size_t rtp_header_length,
- int64_t capture_time_ms,
- StorageType storage,
- RtpPacketSender::Priority priority);
bool SendToNetwork(std::unique_ptr<RtpPacketToSend> packet,
StorageType storage,
RtpPacketSender::Priority priority);
@@ -292,7 +228,6 @@ class RTPSender {
RtpState GetRtpState() const;
void SetRtxRtpState(const RtpState& rtp_state);
RtpState GetRtxRtpState() const;
- bool ActivateCVORtpHeaderExtension();
protected:
int32_t CheckPayloadType(int8_t payload_type, RtpVideoCodecTypes* video_type);
@@ -334,13 +269,6 @@ class RTPSender {
// Find the byte position of the RTP extension as indicated by |type| in
// |rtp_packet|. Return false if such extension doesn't exist.
- bool FindHeaderExtensionPosition(RTPExtensionType type,
- const uint8_t* rtp_packet,
- size_t rtp_packet_length,
- const RTPHeader& rtp_header,
- size_t* position) const
- EXCLUSIVE_LOCKS_REQUIRED(send_critsect_);
-
bool UpdateTransportSequenceNumber(RtpPacketToSend* packet,
int* packet_id) const;
@@ -378,11 +306,6 @@ class RTPSender {
std::map<int8_t, RtpUtility::Payload*> payload_type_map_;
RtpHeaderExtensionMap rtp_header_extension_map_ GUARDED_BY(send_critsect_);
- int32_t transmission_time_offset_;
- uint32_t absolute_send_time_;
- VideoRotation rotation_;
- bool video_rotation_active_;
- uint16_t transport_sequence_number_;
// Tracks the current request for playout delay limits from application
// and decides whether the current RTP frame should include the playout

Powered by Google App Engine
This is Rietveld 408576698