| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 #include "webrtc/video/video_send_stream.h" | 10 #include "webrtc/video/video_send_stream.h" |
| (...skipping 1014 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1025 } | 1025 } |
| 1026 } | 1026 } |
| 1027 | 1027 |
| 1028 EncodedImageCallback::Result VideoSendStreamImpl::OnEncodedImage( | 1028 EncodedImageCallback::Result VideoSendStreamImpl::OnEncodedImage( |
| 1029 const EncodedImage& encoded_image, | 1029 const EncodedImage& encoded_image, |
| 1030 const CodecSpecificInfo* codec_specific_info, | 1030 const CodecSpecificInfo* codec_specific_info, |
| 1031 const RTPFragmentationHeader* fragmentation) { | 1031 const RTPFragmentationHeader* fragmentation) { |
| 1032 // Encoded is called on whatever thread the real encoder implementation run | 1032 // Encoded is called on whatever thread the real encoder implementation run |
| 1033 // on. In the case of hardware encoders, there might be several encoders | 1033 // on. In the case of hardware encoders, there might be several encoders |
| 1034 // running in parallel on different threads. | 1034 // running in parallel on different threads. |
| 1035 size_t simulcast_idx = 0; |
| 1036 if (codec_specific_info->codecType == kVideoCodecVP8) { |
| 1037 simulcast_idx = codec_specific_info->codecSpecific.VP8.simulcastIdx; |
| 1038 } |
| 1035 if (config_->post_encode_callback) { | 1039 if (config_->post_encode_callback) { |
| 1036 config_->post_encode_callback->EncodedFrameCallback( | 1040 config_->post_encode_callback->EncodedFrameCallback(EncodedFrame( |
| 1037 EncodedFrame(encoded_image._buffer, encoded_image._length, | 1041 encoded_image._buffer, encoded_image._length, encoded_image._frameType, |
| 1038 encoded_image._frameType, encoded_image._encodedWidth, | 1042 simulcast_idx, encoded_image._timeStamp)); |
| 1039 encoded_image._encodedHeight, encoded_image._timeStamp)); | |
| 1040 } | 1043 } |
| 1041 { | 1044 { |
| 1042 rtc::CritScope lock(&encoder_activity_crit_sect_); | 1045 rtc::CritScope lock(&encoder_activity_crit_sect_); |
| 1043 if (check_encoder_activity_task_) | 1046 if (check_encoder_activity_task_) |
| 1044 check_encoder_activity_task_->UpdateEncoderActivity(); | 1047 check_encoder_activity_task_->UpdateEncoderActivity(); |
| 1045 } | 1048 } |
| 1046 | 1049 |
| 1047 protection_bitrate_calculator_.UpdateWithEncodedData(encoded_image); | 1050 protection_bitrate_calculator_.UpdateWithEncodedData(encoded_image); |
| 1048 EncodedImageCallback::Result result = payload_router_.OnEncodedImage( | 1051 EncodedImageCallback::Result result = payload_router_.OnEncodedImage( |
| 1049 encoded_image, codec_specific_info, fragmentation); | 1052 encoded_image, codec_specific_info, fragmentation); |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1338 std::min(config_->rtp.max_packet_size, | 1341 std::min(config_->rtp.max_packet_size, |
| 1339 kPathMTU - transport_overhead_bytes_per_packet_); | 1342 kPathMTU - transport_overhead_bytes_per_packet_); |
| 1340 | 1343 |
| 1341 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { | 1344 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { |
| 1342 rtp_rtcp->SetMaxRtpPacketSize(rtp_packet_size); | 1345 rtp_rtcp->SetMaxRtpPacketSize(rtp_packet_size); |
| 1343 } | 1346 } |
| 1344 } | 1347 } |
| 1345 | 1348 |
| 1346 } // namespace internal | 1349 } // namespace internal |
| 1347 } // namespace webrtc | 1350 } // namespace webrtc |
| OLD | NEW |