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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 uint8_t dtmfbuffer[IP_PACKET_SIZE]; | 411 uint8_t dtmfbuffer[IP_PACKET_SIZE]; |
412 uint8_t sendCount = 1; | 412 uint8_t sendCount = 1; |
413 int32_t retVal = 0; | 413 int32_t retVal = 0; |
414 | 414 |
415 if (ended) { | 415 if (ended) { |
416 // resend last packet in an event 3 times | 416 // resend last packet in an event 3 times |
417 sendCount = 3; | 417 sendCount = 3; |
418 } | 418 } |
419 do { | 419 do { |
420 // Send DTMF data | 420 // Send DTMF data |
421 rtp_sender_->BuildRtpHeader(dtmfbuffer, dtmf_payload_type, marker_bit, | 421 int32_t header_length = rtp_sender_->BuildRtpHeader( |
422 dtmf_timestamp, clock_->TimeInMilliseconds()); | 422 dtmfbuffer, dtmf_payload_type, marker_bit, dtmf_timestamp, |
| 423 clock_->TimeInMilliseconds()); |
| 424 if (header_length <= 0) |
| 425 return -1; |
423 | 426 |
424 // reset CSRC and X bit | 427 // reset CSRC and X bit |
425 dtmfbuffer[0] &= 0xe0; | 428 dtmfbuffer[0] &= 0xe0; |
426 | 429 |
427 // Create DTMF data | 430 // Create DTMF data |
428 /* From RFC 2833: | 431 /* From RFC 2833: |
429 | 432 |
430 0 1 2 3 | 433 0 1 2 3 |
431 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 | 434 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 |
432 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 435 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
(...skipping 17 matching lines...) Expand all Loading... |
450 "timestamp", dtmf_timestamp, "seqnum", rtp_sender_->SequenceNumber()); | 453 "timestamp", dtmf_timestamp, "seqnum", rtp_sender_->SequenceNumber()); |
451 retVal = rtp_sender_->SendToNetwork(dtmfbuffer, 4, 12, rtc::TimeMillis(), | 454 retVal = rtp_sender_->SendToNetwork(dtmfbuffer, 4, 12, rtc::TimeMillis(), |
452 kAllowRetransmission, | 455 kAllowRetransmission, |
453 RtpPacketSender::kHighPriority); | 456 RtpPacketSender::kHighPriority); |
454 sendCount--; | 457 sendCount--; |
455 } while (sendCount > 0 && retVal == 0); | 458 } while (sendCount > 0 && retVal == 0); |
456 | 459 |
457 return retVal; | 460 return retVal; |
458 } | 461 } |
459 } // namespace webrtc | 462 } // namespace webrtc |
OLD | NEW |