| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 virtual size_t RtpHeaderLength() const = 0; | 69 virtual size_t RtpHeaderLength() const = 0; |
| 70 // Returns the next sequence number to use for a packet and allocates | 70 // Returns the next sequence number to use for a packet and allocates |
| 71 // 'packets_to_send' number of sequence numbers. It's important all allocated | 71 // 'packets_to_send' number of sequence numbers. It's important all allocated |
| 72 // sequence numbers are used in sequence to avoid perceived packet loss. | 72 // sequence numbers are used in sequence to avoid perceived packet loss. |
| 73 virtual uint16_t AllocateSequenceNumber(uint16_t packets_to_send) = 0; | 73 virtual uint16_t AllocateSequenceNumber(uint16_t packets_to_send) = 0; |
| 74 virtual uint16_t SequenceNumber() const = 0; | 74 virtual uint16_t SequenceNumber() const = 0; |
| 75 virtual size_t MaxPayloadLength() const = 0; | 75 virtual size_t MaxPayloadLength() const = 0; |
| 76 virtual size_t MaxDataPayloadLength() const = 0; | 76 virtual size_t MaxDataPayloadLength() const = 0; |
| 77 virtual uint16_t ActualSendBitrateKbit() const = 0; | 77 virtual uint16_t ActualSendBitrateKbit() const = 0; |
| 78 | 78 |
| 79 virtual bool SendToNetwork(uint8_t* data_buffer, | 79 virtual int32_t SendToNetwork(uint8_t* data_buffer, |
| 80 size_t payload_length, | 80 size_t payload_length, |
| 81 size_t rtp_header_length, | 81 size_t rtp_header_length, |
| 82 int64_t capture_time_ms, | 82 int64_t capture_time_ms, |
| 83 StorageType storage, | 83 StorageType storage, |
| 84 RtpPacketSender::Priority priority) = 0; | 84 RtpPacketSender::Priority priority) = 0; |
| 85 | 85 |
| 86 virtual bool UpdateVideoRotation(uint8_t* rtp_packet, | 86 virtual bool UpdateVideoRotation(uint8_t* rtp_packet, |
| 87 size_t rtp_packet_length, | 87 size_t rtp_packet_length, |
| 88 const RTPHeader& rtp_header, | 88 const RTPHeader& rtp_header, |
| 89 VideoRotation rotation) const = 0; | 89 VideoRotation rotation) const = 0; |
| 90 virtual bool IsRtpHeaderExtensionRegistered(RTPExtensionType type) = 0; | 90 virtual bool IsRtpHeaderExtensionRegistered(RTPExtensionType type) = 0; |
| 91 virtual bool ActivateCVORtpHeaderExtension() = 0; | 91 virtual bool ActivateCVORtpHeaderExtension() = 0; |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 class RTPSender : public RTPSenderInterface { | 94 class RTPSender : public RTPSenderInterface { |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 uint32_t GenerateNewSSRC(); | 147 uint32_t GenerateNewSSRC(); |
| 148 void SetSSRC(uint32_t ssrc); | 148 void SetSSRC(uint32_t ssrc); |
| 149 | 149 |
| 150 uint16_t SequenceNumber() const override; | 150 uint16_t SequenceNumber() const override; |
| 151 void SetSequenceNumber(uint16_t seq); | 151 void SetSequenceNumber(uint16_t seq); |
| 152 | 152 |
| 153 void SetCsrcs(const std::vector<uint32_t>& csrcs); | 153 void SetCsrcs(const std::vector<uint32_t>& csrcs); |
| 154 | 154 |
| 155 void SetMaxPayloadLength(size_t max_payload_length); | 155 void SetMaxPayloadLength(size_t max_payload_length); |
| 156 | 156 |
| 157 bool SendOutgoingData(FrameType frame_type, | 157 int32_t SendOutgoingData(FrameType frame_type, |
| 158 int8_t payload_type, | 158 int8_t payload_type, |
| 159 uint32_t timestamp, | 159 uint32_t timestamp, |
| 160 int64_t capture_time_ms, | 160 int64_t capture_time_ms, |
| 161 const uint8_t* payload_data, | 161 const uint8_t* payload_data, |
| 162 size_t payload_size, | 162 size_t payload_size, |
| 163 const RTPFragmentationHeader* fragmentation, | 163 const RTPFragmentationHeader* fragmentation, |
| 164 const RTPVideoHeader* rtp_header, | 164 const RTPVideoHeader* rtp_header); |
| 165 uint32_t* transport_frame_id_out); | |
| 166 | 165 |
| 167 // RTP header extension | 166 // RTP header extension |
| 168 int32_t SetTransmissionTimeOffset(int32_t transmission_time_offset); | 167 int32_t SetTransmissionTimeOffset(int32_t transmission_time_offset); |
| 169 int32_t SetAbsoluteSendTime(uint32_t absolute_send_time); | 168 int32_t SetAbsoluteSendTime(uint32_t absolute_send_time); |
| 170 void SetVideoRotation(VideoRotation rotation); | 169 void SetVideoRotation(VideoRotation rotation); |
| 171 int32_t SetTransportSequenceNumber(uint16_t sequence_number); | 170 int32_t SetTransportSequenceNumber(uint16_t sequence_number); |
| 172 | 171 |
| 173 int32_t RegisterRtpHeaderExtension(RTPExtensionType type, uint8_t id); | 172 int32_t RegisterRtpHeaderExtension(RTPExtensionType type, uint8_t id); |
| 174 bool IsRtpHeaderExtensionRegistered(RTPExtensionType type) override; | 173 bool IsRtpHeaderExtensionRegistered(RTPExtensionType type) override; |
| 175 int32_t DeregisterRtpHeaderExtension(RTPExtensionType type); | 174 int32_t DeregisterRtpHeaderExtension(RTPExtensionType type); |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 int64_t capture_time_ms) override; | 269 int64_t capture_time_ms) override; |
| 271 | 270 |
| 272 size_t RtpHeaderLength() const override; | 271 size_t RtpHeaderLength() const override; |
| 273 uint16_t AllocateSequenceNumber(uint16_t packets_to_send) override; | 272 uint16_t AllocateSequenceNumber(uint16_t packets_to_send) override; |
| 274 size_t MaxPayloadLength() const override; | 273 size_t MaxPayloadLength() const override; |
| 275 | 274 |
| 276 // Current timestamp. | 275 // Current timestamp. |
| 277 uint32_t Timestamp() const override; | 276 uint32_t Timestamp() const override; |
| 278 uint32_t SSRC() const override; | 277 uint32_t SSRC() const override; |
| 279 | 278 |
| 280 bool SendToNetwork(uint8_t* data_buffer, | 279 int32_t SendToNetwork(uint8_t* data_buffer, |
| 281 size_t payload_length, | 280 size_t payload_length, |
| 282 size_t rtp_header_length, | 281 size_t rtp_header_length, |
| 283 int64_t capture_time_ms, | 282 int64_t capture_time_ms, |
| 284 StorageType storage, | 283 StorageType storage, |
| 285 RtpPacketSender::Priority priority) override; | 284 RtpPacketSender::Priority priority) override; |
| 286 | 285 |
| 287 // Audio. | 286 // Audio. |
| 288 | 287 |
| 289 // Send a DTMF tone using RFC 2833 (4733). | 288 // Send a DTMF tone using RFC 2833 (4733). |
| 290 int32_t SendTelephoneEvent(uint8_t key, uint16_t time_ms, uint8_t level); | 289 int32_t SendTelephoneEvent(uint8_t key, uint16_t time_ms, uint8_t level); |
| 291 | 290 |
| 292 // Set audio packet size, used to determine when it's time to send a DTMF | 291 // Set audio packet size, used to determine when it's time to send a DTMF |
| 293 // packet in silence (CNG). | 292 // packet in silence (CNG). |
| 294 int32_t SetAudioPacketSize(uint16_t packet_size_samples); | 293 int32_t SetAudioPacketSize(uint16_t packet_size_samples); |
| 295 | 294 |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 std::map<int8_t, int8_t> rtx_payload_type_map_ GUARDED_BY(send_critsect_); | 496 std::map<int8_t, int8_t> rtx_payload_type_map_ GUARDED_BY(send_critsect_); |
| 498 | 497 |
| 499 RateLimiter* const retransmission_rate_limiter_; | 498 RateLimiter* const retransmission_rate_limiter_; |
| 500 | 499 |
| 501 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RTPSender); | 500 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RTPSender); |
| 502 }; | 501 }; |
| 503 | 502 |
| 504 } // namespace webrtc | 503 } // namespace webrtc |
| 505 | 504 |
| 506 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_H_ | 505 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_H_ |
| OLD | NEW |