| Index: webrtc/modules/rtp_rtcp/source/rtp_sender.cc
|
| diff --git a/webrtc/modules/rtp_rtcp/source/rtp_sender.cc b/webrtc/modules/rtp_rtcp/source/rtp_sender.cc
|
| index 58dbc3ebffb983e84f17c94ba2dbb599fd13e169..2fe80ae90f5c154099a459287e76ea575439316a 100644
|
| --- a/webrtc/modules/rtp_rtcp/source/rtp_sender.cc
|
| +++ b/webrtc/modules/rtp_rtcp/source/rtp_sender.cc
|
| @@ -448,15 +448,14 @@
|
| return video_rotation_active_;
|
| }
|
|
|
| -bool RTPSender::SendOutgoingData(FrameType frame_type,
|
| - int8_t payload_type,
|
| - uint32_t capture_timestamp,
|
| - int64_t capture_time_ms,
|
| - const uint8_t* payload_data,
|
| - size_t payload_size,
|
| - const RTPFragmentationHeader* fragmentation,
|
| - const RTPVideoHeader* rtp_header,
|
| - uint32_t* transport_frame_id_out) {
|
| +int32_t RTPSender::SendOutgoingData(FrameType frame_type,
|
| + int8_t payload_type,
|
| + uint32_t capture_timestamp,
|
| + int64_t capture_time_ms,
|
| + const uint8_t* payload_data,
|
| + size_t payload_size,
|
| + const RTPFragmentationHeader* fragmentation,
|
| + const RTPVideoHeader* rtp_hdr) {
|
| uint32_t ssrc;
|
| uint16_t sequence_number;
|
| {
|
| @@ -464,35 +463,36 @@
|
| rtc::CritScope lock(&send_critsect_);
|
| ssrc = ssrc_;
|
| sequence_number = sequence_number_;
|
| - if (!sending_media_)
|
| - return true;
|
| + if (!sending_media_) {
|
| + return 0;
|
| + }
|
| }
|
| RtpVideoCodecTypes video_type = kRtpVideoGeneric;
|
| if (CheckPayloadType(payload_type, &video_type) != 0) {
|
| LOG(LS_ERROR) << "Don't send data with unknown payload type: "
|
| << static_cast<int>(payload_type) << ".";
|
| - return false;
|
| - }
|
| -
|
| - bool result;
|
| + return -1;
|
| + }
|
| +
|
| + int32_t ret_val;
|
| if (audio_configured_) {
|
| TRACE_EVENT_ASYNC_STEP1("webrtc", "Audio", capture_timestamp,
|
| "Send", "type", FrameTypeToString(frame_type));
|
| assert(frame_type == kAudioFrameSpeech || frame_type == kAudioFrameCN ||
|
| frame_type == kEmptyFrame);
|
|
|
| - result = audio_->SendAudio(frame_type, payload_type, capture_timestamp,
|
| - payload_data, payload_size, fragmentation);
|
| + ret_val = audio_->SendAudio(frame_type, payload_type, capture_timestamp,
|
| + payload_data, payload_size, fragmentation);
|
| } else {
|
| TRACE_EVENT_ASYNC_STEP1("webrtc", "Video", capture_time_ms,
|
| "Send", "type", FrameTypeToString(frame_type));
|
| assert(frame_type != kAudioFrameSpeech && frame_type != kAudioFrameCN);
|
|
|
| if (frame_type == kEmptyFrame)
|
| - return true;
|
| -
|
| - if (rtp_header) {
|
| - playout_delay_oracle_.UpdateRequest(ssrc, rtp_header->playout_delay,
|
| + return 0;
|
| +
|
| + if (rtp_hdr) {
|
| + playout_delay_oracle_.UpdateRequest(ssrc, rtp_hdr->playout_delay,
|
| sequence_number);
|
| }
|
|
|
| @@ -507,16 +507,9 @@
|
| }
|
| }
|
|
|
| - result = video_->SendVideo(video_type, frame_type, payload_type,
|
| - capture_timestamp, capture_time_ms, payload_data,
|
| - payload_size, fragmentation, rtp_header);
|
| - }
|
| -
|
| - if (transport_frame_id_out) {
|
| - rtc::CritScope lock(&send_critsect_);
|
| - // TODO(sergeyu): Move RTP timestamp calculation from BuildRTPheader() to
|
| - // SendOutgoingData() and pass it to SendVideo()/SendAudio() calls.
|
| - *transport_frame_id_out = timestamp_;
|
| + ret_val = video_->SendVideo(
|
| + video_type, frame_type, payload_type, capture_timestamp,
|
| + capture_time_ms, payload_data, payload_size, fragmentation, rtp_hdr);
|
| }
|
|
|
| rtc::CritScope cs(&statistics_crit_);
|
| @@ -530,7 +523,7 @@
|
| frame_count_observer_->FrameCountUpdated(frame_counts_, ssrc);
|
| }
|
|
|
| - return result;
|
| + return ret_val;
|
| }
|
|
|
| size_t RTPSender::TrySendRedundantPayloads(size_t bytes_to_send,
|
| @@ -952,12 +945,12 @@
|
| }
|
|
|
| // TODO(pwestin): send in the RtpHeaderParser to avoid parsing it again.
|
| -bool RTPSender::SendToNetwork(uint8_t* buffer,
|
| - size_t payload_length,
|
| - size_t rtp_header_length,
|
| - int64_t capture_time_ms,
|
| - StorageType storage,
|
| - RtpPacketSender::Priority priority) {
|
| +int32_t RTPSender::SendToNetwork(uint8_t* buffer,
|
| + size_t payload_length,
|
| + size_t rtp_header_length,
|
| + int64_t capture_time_ms,
|
| + StorageType storage,
|
| + RtpPacketSender::Priority priority) {
|
| size_t length = payload_length + rtp_header_length;
|
| RtpUtility::RtpHeaderParser rtp_parser(buffer, length);
|
|
|
| @@ -979,7 +972,7 @@
|
| // Used for NACK and to spread out the transmission of packets.
|
| if (packet_history_.PutRTPPacket(buffer, length, capture_time_ms, storage) !=
|
| 0) {
|
| - return false;
|
| + return -1;
|
| }
|
|
|
| if (paced_sender_) {
|
| @@ -996,7 +989,7 @@
|
| "PacedSend", corrected_time_ms,
|
| "capture_time_ms", corrected_time_ms);
|
| }
|
| - return true;
|
| + return 0;
|
| }
|
|
|
| PacketOptions options;
|
| @@ -1017,14 +1010,14 @@
|
| packet_history_.SetSent(rtp_header.sequenceNumber);
|
|
|
| if (!sent)
|
| - return false;
|
| + return -1;
|
|
|
| {
|
| rtc::CritScope lock(&send_critsect_);
|
| media_has_been_sent_ = true;
|
| }
|
| UpdateRtpStats(buffer, length, rtp_header, false, false);
|
| - return true;
|
| + return 0;
|
| }
|
|
|
| void RTPSender::UpdateDelayStatistics(int64_t capture_time_ms, int64_t now_ms) {
|
|
|