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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
279 int VideoProcessor::NumberDroppedFrames() { | 279 int VideoProcessor::NumberDroppedFrames() { |
280 RTC_DCHECK_CALLED_SEQUENTIALLY(&sequence_checker_); | 280 RTC_DCHECK_CALLED_SEQUENTIALLY(&sequence_checker_); |
281 return num_dropped_frames_; | 281 return num_dropped_frames_; |
282 } | 282 } |
283 | 283 |
284 int VideoProcessor::NumberSpatialResizes() { | 284 int VideoProcessor::NumberSpatialResizes() { |
285 RTC_DCHECK_CALLED_SEQUENTIALLY(&sequence_checker_); | 285 RTC_DCHECK_CALLED_SEQUENTIALLY(&sequence_checker_); |
286 return num_spatial_resizes_; | 286 return num_spatial_resizes_; |
287 } | 287 } |
288 | 288 |
289 void VideoProcessor::FrameEncoded( | 289 void VideoProcessor::FrameEncoded(webrtc::VideoCodecType codec, |
290 webrtc::VideoCodecType codec, | 290 const EncodedImage& encoded_image) { |
291 const EncodedImage& encoded_image, | |
292 const webrtc::RTPFragmentationHeader* fragmentation) { | |
293 RTC_DCHECK_CALLED_SEQUENTIALLY(&sequence_checker_); | 291 RTC_DCHECK_CALLED_SEQUENTIALLY(&sequence_checker_); |
294 | 292 |
295 // For the highest measurement accuracy of the encode time, the start/stop | 293 // For the highest measurement accuracy of the encode time, the start/stop |
296 // time recordings should wrap the Encode call as tightly as possible. | 294 // time recordings should wrap the Encode call as tightly as possible. |
297 int64_t encode_stop_ns = rtc::TimeNanos(); | 295 int64_t encode_stop_ns = rtc::TimeNanos(); |
298 | 296 |
299 if (encoded_frame_writer_) { | 297 if (encoded_frame_writer_) { |
300 RTC_CHECK(encoded_frame_writer_->WriteFrame(encoded_image, codec)); | 298 RTC_CHECK(encoded_frame_writer_->WriteFrame(encoded_image, codec)); |
301 } | 299 } |
302 | 300 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
388 memcpy(&copied_image, &encoded_image, sizeof(copied_image)); | 386 memcpy(&copied_image, &encoded_image, sizeof(copied_image)); |
389 copied_image._size = copied_buffer_size; | 387 copied_image._size = copied_buffer_size; |
390 copied_image._buffer = copied_buffer.get(); | 388 copied_image._buffer = copied_buffer.get(); |
391 | 389 |
392 if (!exclude_this_frame) { | 390 if (!exclude_this_frame) { |
393 frame_stat->packets_dropped = | 391 frame_stat->packets_dropped = |
394 packet_manipulator_->ManipulatePackets(&copied_image); | 392 packet_manipulator_->ManipulatePackets(&copied_image); |
395 } | 393 } |
396 frame_info->manipulated_length = copied_image._length; | 394 frame_info->manipulated_length = copied_image._length; |
397 | 395 |
398 // Keep track of if frames are lost due to packet loss so we can tell | 396 // Keep track of if frames are lost due to packet loss so we can tell |
åsapersson
2017/08/22 09:49:42
Update/remove comment.
brandtr
2017/08/22 09:51:58
Will be done in the "big" CL: https://codereview.w
brandtr
2017/08/22 09:53:03
Actually, updated this CL to do the removal since
| |
399 // this to the encoder (this is handled by the RTP logic in the full stack). | 397 // this to the encoder (this is handled by the RTP logic in the full stack). |
400 // TODO(kjellander): Pass fragmentation header to the decoder when | 398 // TODO(kjellander): Pass fragmentation header to the decoder when |
401 // CL 172001 has been submitted and PacketManipulator supports this. | 399 // CL 172001 has been submitted and PacketManipulator supports this. |
402 | 400 |
403 // For the highest measurement accuracy of the decode time, the start/stop | 401 // For the highest measurement accuracy of the decode time, the start/stop |
404 // time recordings should wrap the Decode call as tightly as possible. | 402 // time recordings should wrap the Decode call as tightly as possible. |
405 frame_info->decode_start_ns = rtc::TimeNanos(); | 403 frame_info->decode_start_ns = rtc::TimeNanos(); |
406 frame_stat->decode_return_code = | 404 frame_stat->decode_return_code = |
407 decoder_->Decode(copied_image, last_frame_missing, nullptr); | 405 decoder_->Decode(copied_image, last_frame_missing, nullptr); |
408 | 406 |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
506 | 504 |
507 RTC_DCHECK_GT(timestamp, 0); | 505 RTC_DCHECK_GT(timestamp, 0); |
508 const int ticks_per_frame = | 506 const int ticks_per_frame = |
509 kRtpClockRateHz / config_.codec_settings.maxFramerate; | 507 kRtpClockRateHz / config_.codec_settings.maxFramerate; |
510 RTC_DCHECK_EQ(timestamp % ticks_per_frame, 0); | 508 RTC_DCHECK_EQ(timestamp % ticks_per_frame, 0); |
511 return (timestamp / ticks_per_frame) - 1; | 509 return (timestamp / ticks_per_frame) - 1; |
512 } | 510 } |
513 | 511 |
514 } // namespace test | 512 } // namespace test |
515 } // namespace webrtc | 513 } // namespace webrtc |
OLD | NEW |