OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 2263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2274 const std::vector<VideoCodecSettings>& recv_codecs, | 2274 const std::vector<VideoCodecSettings>& recv_codecs, |
2275 bool red_disabled_by_remote_side) | 2275 bool red_disabled_by_remote_side) |
2276 : call_(call), | 2276 : call_(call), |
2277 stream_params_(sp), | 2277 stream_params_(sp), |
2278 stream_(NULL), | 2278 stream_(NULL), |
2279 default_stream_(default_stream), | 2279 default_stream_(default_stream), |
2280 config_(std::move(config)), | 2280 config_(std::move(config)), |
2281 red_disabled_by_remote_side_(red_disabled_by_remote_side), | 2281 red_disabled_by_remote_side_(red_disabled_by_remote_side), |
2282 external_decoder_factory_(external_decoder_factory), | 2282 external_decoder_factory_(external_decoder_factory), |
2283 sink_(NULL), | 2283 sink_(NULL), |
2284 last_width_(-1), | |
2285 last_height_(-1), | |
2286 first_frame_timestamp_(-1), | 2284 first_frame_timestamp_(-1), |
2287 estimated_remote_start_ntp_time_ms_(0) { | 2285 estimated_remote_start_ntp_time_ms_(0) { |
2288 config_.renderer = this; | 2286 config_.renderer = this; |
2289 std::vector<AllocatedDecoder> old_decoders; | 2287 std::vector<AllocatedDecoder> old_decoders; |
2290 ConfigureCodecs(recv_codecs, &old_decoders); | 2288 ConfigureCodecs(recv_codecs, &old_decoders); |
2291 RecreateWebRtcStream(); | 2289 RecreateWebRtcStream(); |
2292 RTC_DCHECK(old_decoders.empty()); | 2290 RTC_DCHECK(old_decoders.empty()); |
2293 } | 2291 } |
2294 | 2292 |
2295 WebRtcVideoChannel2::WebRtcVideoReceiveStream::AllocatedDecoder:: | 2293 WebRtcVideoChannel2::WebRtcVideoReceiveStream::AllocatedDecoder:: |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2517 int64_t elapsed_time_ms = rtp_time_elapsed_since_first_frame / | 2515 int64_t elapsed_time_ms = rtp_time_elapsed_since_first_frame / |
2518 (cricket::kVideoCodecClockrate / 1000); | 2516 (cricket::kVideoCodecClockrate / 1000); |
2519 if (frame.ntp_time_ms() > 0) | 2517 if (frame.ntp_time_ms() > 0) |
2520 estimated_remote_start_ntp_time_ms_ = frame.ntp_time_ms() - elapsed_time_ms; | 2518 estimated_remote_start_ntp_time_ms_ = frame.ntp_time_ms() - elapsed_time_ms; |
2521 | 2519 |
2522 if (sink_ == NULL) { | 2520 if (sink_ == NULL) { |
2523 LOG(LS_WARNING) << "VideoReceiveStream not connected to a VideoSink."; | 2521 LOG(LS_WARNING) << "VideoReceiveStream not connected to a VideoSink."; |
2524 return; | 2522 return; |
2525 } | 2523 } |
2526 | 2524 |
2527 last_width_ = frame.width(); | |
2528 last_height_ = frame.height(); | |
2529 | |
2530 WebRtcVideoFrame render_frame( | 2525 WebRtcVideoFrame render_frame( |
2531 frame.video_frame_buffer(), frame.rotation(), | 2526 frame.video_frame_buffer(), frame.rotation(), |
2532 frame.render_time_ms() * rtc::kNumNanosecsPerMicrosec, frame.timestamp()); | 2527 frame.render_time_ms() * rtc::kNumNanosecsPerMicrosec, frame.timestamp()); |
2533 sink_->OnFrame(render_frame); | 2528 sink_->OnFrame(render_frame); |
2534 } | 2529 } |
2535 | 2530 |
2536 bool WebRtcVideoChannel2::WebRtcVideoReceiveStream::IsDefaultStream() const { | 2531 bool WebRtcVideoChannel2::WebRtcVideoReceiveStream::IsDefaultStream() const { |
2537 return default_stream_; | 2532 return default_stream_; |
2538 } | 2533 } |
2539 | 2534 |
(...skipping 26 matching lines...) Expand all Loading... |
2566 stats.rtp_stats.transmitted.header_bytes + | 2561 stats.rtp_stats.transmitted.header_bytes + |
2567 stats.rtp_stats.transmitted.padding_bytes; | 2562 stats.rtp_stats.transmitted.padding_bytes; |
2568 info.packets_rcvd = stats.rtp_stats.transmitted.packets; | 2563 info.packets_rcvd = stats.rtp_stats.transmitted.packets; |
2569 info.packets_lost = stats.rtcp_stats.cumulative_lost; | 2564 info.packets_lost = stats.rtcp_stats.cumulative_lost; |
2570 info.fraction_lost = | 2565 info.fraction_lost = |
2571 static_cast<float>(stats.rtcp_stats.fraction_lost) / (1 << 8); | 2566 static_cast<float>(stats.rtcp_stats.fraction_lost) / (1 << 8); |
2572 | 2567 |
2573 info.framerate_rcvd = stats.network_frame_rate; | 2568 info.framerate_rcvd = stats.network_frame_rate; |
2574 info.framerate_decoded = stats.decode_frame_rate; | 2569 info.framerate_decoded = stats.decode_frame_rate; |
2575 info.framerate_output = stats.render_frame_rate; | 2570 info.framerate_output = stats.render_frame_rate; |
| 2571 info.frame_width = stats.width; |
| 2572 info.frame_height = stats.height; |
2576 | 2573 |
2577 { | 2574 { |
2578 rtc::CritScope frame_cs(&sink_lock_); | 2575 rtc::CritScope frame_cs(&sink_lock_); |
2579 info.frame_width = last_width_; | |
2580 info.frame_height = last_height_; | |
2581 info.capture_start_ntp_time_ms = estimated_remote_start_ntp_time_ms_; | 2576 info.capture_start_ntp_time_ms = estimated_remote_start_ntp_time_ms_; |
2582 } | 2577 } |
2583 | 2578 |
2584 info.decode_ms = stats.decode_ms; | 2579 info.decode_ms = stats.decode_ms; |
2585 info.max_decode_ms = stats.max_decode_ms; | 2580 info.max_decode_ms = stats.max_decode_ms; |
2586 info.current_delay_ms = stats.current_delay_ms; | 2581 info.current_delay_ms = stats.current_delay_ms; |
2587 info.target_delay_ms = stats.target_delay_ms; | 2582 info.target_delay_ms = stats.target_delay_ms; |
2588 info.jitter_buffer_ms = stats.jitter_buffer_ms; | 2583 info.jitter_buffer_ms = stats.jitter_buffer_ms; |
2589 info.min_playout_delay_ms = stats.min_playout_delay_ms; | 2584 info.min_playout_delay_ms = stats.min_playout_delay_ms; |
2590 info.render_delay_ms = stats.render_delay_ms; | 2585 info.render_delay_ms = stats.render_delay_ms; |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2713 rtx_mapping[video_codecs[i].codec.id] != | 2708 rtx_mapping[video_codecs[i].codec.id] != |
2714 fec_settings.red_payload_type) { | 2709 fec_settings.red_payload_type) { |
2715 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; | 2710 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; |
2716 } | 2711 } |
2717 } | 2712 } |
2718 | 2713 |
2719 return video_codecs; | 2714 return video_codecs; |
2720 } | 2715 } |
2721 | 2716 |
2722 } // namespace cricket | 2717 } // namespace cricket |
OLD | NEW |