Chromium Code Reviews| 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 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 441 bool RTPSender::ActivateCVORtpHeaderExtension() { | 441 bool RTPSender::ActivateCVORtpHeaderExtension() { |
| 442 if (!video_rotation_active_) { | 442 if (!video_rotation_active_) { |
| 443 rtc::CritScope lock(&send_critsect_); | 443 rtc::CritScope lock(&send_critsect_); |
| 444 if (rtp_header_extension_map_.SetActive(kRtpExtensionVideoRotation, true)) { | 444 if (rtp_header_extension_map_.SetActive(kRtpExtensionVideoRotation, true)) { |
| 445 video_rotation_active_ = true; | 445 video_rotation_active_ = true; |
| 446 } | 446 } |
| 447 } | 447 } |
| 448 return video_rotation_active_; | 448 return video_rotation_active_; |
| 449 } | 449 } |
| 450 | 450 |
| 451 int32_t RTPSender::SendOutgoingData(FrameType frame_type, | 451 int32_t RTPSender::SendOutgoingData(FrameType frame_type, |
|
stefan-webrtc
2016/07/28 08:51:17
As you are anyway introducing this new method, may
Sergey Ulanov
2016/07/28 20:52:46
Done.
stefan-webrtc
2016/07/29 07:13:37
Sure, maybe module_common_types.h?
Sergey Ulanov
2016/08/01 07:22:13
Another issue is that we need to keep the current
| |
| 452 int8_t payload_type, | 452 int8_t payload_type, |
| 453 uint32_t capture_timestamp, | 453 uint32_t capture_timestamp, |
| 454 int64_t capture_time_ms, | 454 int64_t capture_time_ms, |
| 455 const uint8_t* payload_data, | 455 const uint8_t* payload_data, |
| 456 size_t payload_size, | 456 size_t payload_size, |
| 457 const RTPFragmentationHeader* fragmentation, | 457 const RTPFragmentationHeader* fragmentation, |
| 458 const RTPVideoHeader* rtp_hdr) { | 458 const RTPVideoHeader* rtp_hdr, |
| 459 uint32_t* frame_id_out) { | |
| 459 uint32_t ssrc; | 460 uint32_t ssrc; |
| 460 uint16_t sequence_number; | 461 uint16_t sequence_number; |
| 461 { | 462 { |
| 462 // Drop this packet if we're not sending media packets. | 463 // Drop this packet if we're not sending media packets. |
| 463 rtc::CritScope lock(&send_critsect_); | 464 rtc::CritScope lock(&send_critsect_); |
| 464 ssrc = ssrc_; | 465 ssrc = ssrc_; |
| 465 sequence_number = sequence_number_; | 466 sequence_number = sequence_number_; |
| 466 if (!sending_media_) { | 467 if (!sending_media_) { |
| 467 return 0; | 468 return 0; |
| 468 } | 469 } |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 505 rtp_header_extension_map_.SetActive(kRtpExtensionPlayoutDelay, | 506 rtp_header_extension_map_.SetActive(kRtpExtensionPlayoutDelay, |
| 506 playout_delay_active_); | 507 playout_delay_active_); |
| 507 } | 508 } |
| 508 } | 509 } |
| 509 | 510 |
| 510 ret_val = video_->SendVideo( | 511 ret_val = video_->SendVideo( |
| 511 video_type, frame_type, payload_type, capture_timestamp, | 512 video_type, frame_type, payload_type, capture_timestamp, |
| 512 capture_time_ms, payload_data, payload_size, fragmentation, rtp_hdr); | 513 capture_time_ms, payload_data, payload_size, fragmentation, rtp_hdr); |
| 513 } | 514 } |
| 514 | 515 |
| 516 if (frame_id_out) { | |
| 517 rtc::CritScope lock(&send_critsect_); | |
| 518 // TODO(sergeyu): Move RTP timestamp calculation from BuildRTPheader() to | |
| 519 // SendOutgoingData() and pass it to SendVideo()/SendAudio() calls. | |
| 520 *frame_id_out = timestamp_; | |
| 521 } | |
| 522 | |
| 515 rtc::CritScope cs(&statistics_crit_); | 523 rtc::CritScope cs(&statistics_crit_); |
| 516 // Note: This is currently only counting for video. | 524 // Note: This is currently only counting for video. |
| 517 if (frame_type == kVideoFrameKey) { | 525 if (frame_type == kVideoFrameKey) { |
| 518 ++frame_counts_.key_frames; | 526 ++frame_counts_.key_frames; |
| 519 } else if (frame_type == kVideoFrameDelta) { | 527 } else if (frame_type == kVideoFrameDelta) { |
| 520 ++frame_counts_.delta_frames; | 528 ++frame_counts_.delta_frames; |
| 521 } | 529 } |
| 522 if (frame_count_observer_) { | 530 if (frame_count_observer_) { |
| 523 frame_count_observer_->FrameCountUpdated(frame_counts_, ssrc); | 531 frame_count_observer_->FrameCountUpdated(frame_counts_, ssrc); |
| 524 } | 532 } |
| (...skipping 1359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1884 rtc::CritScope lock(&send_critsect_); | 1892 rtc::CritScope lock(&send_critsect_); |
| 1885 | 1893 |
| 1886 RtpState state; | 1894 RtpState state; |
| 1887 state.sequence_number = sequence_number_rtx_; | 1895 state.sequence_number = sequence_number_rtx_; |
| 1888 state.start_timestamp = start_timestamp_; | 1896 state.start_timestamp = start_timestamp_; |
| 1889 | 1897 |
| 1890 return state; | 1898 return state; |
| 1891 } | 1899 } |
| 1892 | 1900 |
| 1893 } // namespace webrtc | 1901 } // namespace webrtc |
| OLD | NEW |