| 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 10 matching lines...) Expand all Loading... |
| 21 #include "webrtc/base/logging.h" | 21 #include "webrtc/base/logging.h" |
| 22 #include "webrtc/base/ptr_util.h" | 22 #include "webrtc/base/ptr_util.h" |
| 23 #include "webrtc/base/trace_event.h" | 23 #include "webrtc/base/trace_event.h" |
| 24 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" | 24 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" |
| 25 #include "webrtc/modules/rtp_rtcp/source/byte_io.h" | 25 #include "webrtc/modules/rtp_rtcp/source/byte_io.h" |
| 26 #include "webrtc/modules/rtp_rtcp/source/rtp_format_video_generic.h" | 26 #include "webrtc/modules/rtp_rtcp/source/rtp_format_video_generic.h" |
| 27 #include "webrtc/modules/rtp_rtcp/source/rtp_format_vp8.h" | 27 #include "webrtc/modules/rtp_rtcp/source/rtp_format_vp8.h" |
| 28 #include "webrtc/modules/rtp_rtcp/source/rtp_format_vp9.h" | 28 #include "webrtc/modules/rtp_rtcp/source/rtp_format_vp9.h" |
| 29 #include "webrtc/modules/rtp_rtcp/source/rtp_header_extensions.h" | 29 #include "webrtc/modules/rtp_rtcp/source/rtp_header_extensions.h" |
| 30 #include "webrtc/modules/rtp_rtcp/source/rtp_packet_to_send.h" | 30 #include "webrtc/modules/rtp_rtcp/source/rtp_packet_to_send.h" |
| 31 | 31 #include "webrtc/system_wrappers/include/field_trial.h" |
| 32 namespace webrtc { | 32 namespace webrtc { |
| 33 | 33 |
| 34 namespace { | 34 namespace { |
| 35 constexpr size_t kRedForFecHeaderLength = 1; | 35 constexpr size_t kRedForFecHeaderLength = 1; |
| 36 | 36 |
| 37 void BuildRedPayload(const RtpPacketToSend& media_packet, | 37 void BuildRedPayload(const RtpPacketToSend& media_packet, |
| 38 RtpPacketToSend* red_packet) { | 38 RtpPacketToSend* red_packet) { |
| 39 uint8_t* red_payload = red_packet->AllocatePayload( | 39 uint8_t* red_payload = red_packet->AllocatePayload( |
| 40 kRedForFecHeaderLength + media_packet.payload_size()); | 40 kRedForFecHeaderLength + media_packet.payload_size()); |
| 41 RTC_DCHECK(red_payload); | 41 RTC_DCHECK(red_payload); |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 if (video_header) { | 321 if (video_header) { |
| 322 // Set rotation when key frame or when changed (to follow standard). | 322 // Set rotation when key frame or when changed (to follow standard). |
| 323 // Or when different from 0 (to follow current receiver implementation). | 323 // Or when different from 0 (to follow current receiver implementation). |
| 324 VideoRotation current_rotation = video_header->rotation; | 324 VideoRotation current_rotation = video_header->rotation; |
| 325 if (frame_type == kVideoFrameKey || current_rotation != last_rotation_ || | 325 if (frame_type == kVideoFrameKey || current_rotation != last_rotation_ || |
| 326 current_rotation != kVideoRotation_0) | 326 current_rotation != kVideoRotation_0) |
| 327 last_packet->SetExtension<VideoOrientation>(current_rotation); | 327 last_packet->SetExtension<VideoOrientation>(current_rotation); |
| 328 last_rotation_ = current_rotation; | 328 last_rotation_ = current_rotation; |
| 329 // Report content type only for key frames. | 329 // Report content type only for key frames. |
| 330 if (frame_type == kVideoFrameKey && | 330 if (frame_type == kVideoFrameKey && |
| 331 video_header->content_type != VideoContentType::UNSPECIFIED) { | 331 video_header->content_type != VideoContentType::UNSPECIFIED && |
| 332 webrtc::field_trial::IsEnabled("WebRTC-VideoContentTypeExtension")) { |
| 332 last_packet->SetExtension<VideoContentTypeExtension>( | 333 last_packet->SetExtension<VideoContentTypeExtension>( |
| 333 video_header->content_type); | 334 video_header->content_type); |
| 334 } | 335 } |
| 335 } | 336 } |
| 336 | 337 |
| 337 // FEC settings. | 338 // FEC settings. |
| 338 const FecProtectionParams& fec_params = | 339 const FecProtectionParams& fec_params = |
| 339 frame_type == kVideoFrameKey ? key_fec_params_ : delta_fec_params_; | 340 frame_type == kVideoFrameKey ? key_fec_params_ : delta_fec_params_; |
| 340 if (flexfec_enabled()) | 341 if (flexfec_enabled()) |
| 341 flexfec_sender_->SetFecParameters(fec_params); | 342 flexfec_sender_->SetFecParameters(fec_params); |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 rtc::CritScope cs(&crit_); | 433 rtc::CritScope cs(&crit_); |
| 433 return retransmission_settings_; | 434 return retransmission_settings_; |
| 434 } | 435 } |
| 435 | 436 |
| 436 void RTPSenderVideo::SetSelectiveRetransmissions(uint8_t settings) { | 437 void RTPSenderVideo::SetSelectiveRetransmissions(uint8_t settings) { |
| 437 rtc::CritScope cs(&crit_); | 438 rtc::CritScope cs(&crit_); |
| 438 retransmission_settings_ = settings; | 439 retransmission_settings_ = settings; |
| 439 } | 440 } |
| 440 | 441 |
| 441 } // namespace webrtc | 442 } // namespace webrtc |
| OLD | NEW |