OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2014 Google Inc. | 3 * Copyright 2014 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 2566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2577 void WebRtcVideoChannel2::WebRtcVideoReceiveStream::SetSize(int width, | 2577 void WebRtcVideoChannel2::WebRtcVideoReceiveStream::SetSize(int width, |
2578 int height) { | 2578 int height) { |
2579 rtc::CritScope crit(&renderer_lock_); | 2579 rtc::CritScope crit(&renderer_lock_); |
2580 if (!renderer_->SetSize(width, height, 0)) { | 2580 if (!renderer_->SetSize(width, height, 0)) { |
2581 LOG(LS_ERROR) << "Could not set renderer size."; | 2581 LOG(LS_ERROR) << "Could not set renderer size."; |
2582 } | 2582 } |
2583 last_width_ = width; | 2583 last_width_ = width; |
2584 last_height_ = height; | 2584 last_height_ = height; |
2585 } | 2585 } |
2586 | 2586 |
| 2587 std::string |
| 2588 WebRtcVideoChannel2::WebRtcVideoReceiveStream::GetCodecNameFromPayloadType( |
| 2589 int payload_type) { |
| 2590 for (const webrtc::VideoReceiveStream::Decoder& decoder : config_.decoders) { |
| 2591 if (decoder.payload_type == payload_type) { |
| 2592 return decoder.payload_name; |
| 2593 } |
| 2594 } |
| 2595 return ""; |
| 2596 } |
| 2597 |
2587 VideoReceiverInfo | 2598 VideoReceiverInfo |
2588 WebRtcVideoChannel2::WebRtcVideoReceiveStream::GetVideoReceiverInfo() { | 2599 WebRtcVideoChannel2::WebRtcVideoReceiveStream::GetVideoReceiverInfo() { |
2589 VideoReceiverInfo info; | 2600 VideoReceiverInfo info; |
2590 info.ssrc_groups = ssrc_groups_; | 2601 info.ssrc_groups = ssrc_groups_; |
2591 info.add_ssrc(config_.rtp.remote_ssrc); | 2602 info.add_ssrc(config_.rtp.remote_ssrc); |
2592 webrtc::VideoReceiveStream::Stats stats = stream_->GetStats(); | 2603 webrtc::VideoReceiveStream::Stats stats = stream_->GetStats(); |
2593 info.bytes_rcvd = stats.rtp_stats.transmitted.payload_bytes + | 2604 info.bytes_rcvd = stats.rtp_stats.transmitted.payload_bytes + |
2594 stats.rtp_stats.transmitted.header_bytes + | 2605 stats.rtp_stats.transmitted.header_bytes + |
2595 stats.rtp_stats.transmitted.padding_bytes; | 2606 stats.rtp_stats.transmitted.padding_bytes; |
2596 info.packets_rcvd = stats.rtp_stats.transmitted.packets; | 2607 info.packets_rcvd = stats.rtp_stats.transmitted.packets; |
(...skipping 13 matching lines...) Expand all Loading... |
2610 } | 2621 } |
2611 | 2622 |
2612 info.decode_ms = stats.decode_ms; | 2623 info.decode_ms = stats.decode_ms; |
2613 info.max_decode_ms = stats.max_decode_ms; | 2624 info.max_decode_ms = stats.max_decode_ms; |
2614 info.current_delay_ms = stats.current_delay_ms; | 2625 info.current_delay_ms = stats.current_delay_ms; |
2615 info.target_delay_ms = stats.target_delay_ms; | 2626 info.target_delay_ms = stats.target_delay_ms; |
2616 info.jitter_buffer_ms = stats.jitter_buffer_ms; | 2627 info.jitter_buffer_ms = stats.jitter_buffer_ms; |
2617 info.min_playout_delay_ms = stats.min_playout_delay_ms; | 2628 info.min_playout_delay_ms = stats.min_playout_delay_ms; |
2618 info.render_delay_ms = stats.render_delay_ms; | 2629 info.render_delay_ms = stats.render_delay_ms; |
2619 | 2630 |
| 2631 info.codec_name = GetCodecNameFromPayloadType(stats.current_payload_type); |
| 2632 |
2620 info.firs_sent = stats.rtcp_packet_type_counts.fir_packets; | 2633 info.firs_sent = stats.rtcp_packet_type_counts.fir_packets; |
2621 info.plis_sent = stats.rtcp_packet_type_counts.pli_packets; | 2634 info.plis_sent = stats.rtcp_packet_type_counts.pli_packets; |
2622 info.nacks_sent = stats.rtcp_packet_type_counts.nack_packets; | 2635 info.nacks_sent = stats.rtcp_packet_type_counts.nack_packets; |
2623 | 2636 |
2624 return info; | 2637 return info; |
2625 } | 2638 } |
2626 | 2639 |
2627 WebRtcVideoChannel2::VideoCodecSettings::VideoCodecSettings() | 2640 WebRtcVideoChannel2::VideoCodecSettings::VideoCodecSettings() |
2628 : rtx_payload_type(-1) {} | 2641 : rtx_payload_type(-1) {} |
2629 | 2642 |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2732 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; | 2745 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; |
2733 } | 2746 } |
2734 } | 2747 } |
2735 | 2748 |
2736 return video_codecs; | 2749 return video_codecs; |
2737 } | 2750 } |
2738 | 2751 |
2739 } // namespace cricket | 2752 } // namespace cricket |
2740 | 2753 |
2741 #endif // HAVE_WEBRTC_VIDEO | 2754 #endif // HAVE_WEBRTC_VIDEO |
OLD | NEW |