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 2176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2187 &last_captured_frame_format); | 2187 &last_captured_frame_format); |
2188 info.input_frame_width = last_captured_frame_format.width; | 2188 info.input_frame_width = last_captured_frame_format.width; |
2189 info.input_frame_height = last_captured_frame_format.height; | 2189 info.input_frame_height = last_captured_frame_format.height; |
2190 } | 2190 } |
2191 if (capturer_->video_adapter() != nullptr) { | 2191 if (capturer_->video_adapter() != nullptr) { |
2192 info.adapt_changes += capturer_->video_adapter()->adaptation_changes(); | 2192 info.adapt_changes += capturer_->video_adapter()->adaptation_changes(); |
2193 info.adapt_reason = capturer_->video_adapter()->adapt_reason(); | 2193 info.adapt_reason = capturer_->video_adapter()->adapt_reason(); |
2194 } | 2194 } |
2195 } | 2195 } |
2196 } | 2196 } |
| 2197 |
| 2198 // Get bandwidth limitation info from stream_->GetStats(). |
| 2199 // Input resolution (output from video_adapter) can be further scaled down or |
| 2200 // higher video layer(s) can be dropped due to bitrate constraints. |
| 2201 // Note, adapt_changes only include changes from the video_adapter. |
| 2202 if (stats.bw_limited_resolution) |
| 2203 info.adapt_reason |= CoordinatedVideoAdapter::ADAPTREASON_BANDWIDTH; |
| 2204 |
2197 info.ssrc_groups = ssrc_groups_; | 2205 info.ssrc_groups = ssrc_groups_; |
2198 info.framerate_input = stats.input_frame_rate; | 2206 info.framerate_input = stats.input_frame_rate; |
2199 info.framerate_sent = stats.encode_frame_rate; | 2207 info.framerate_sent = stats.encode_frame_rate; |
2200 info.avg_encode_ms = stats.avg_encode_time_ms; | 2208 info.avg_encode_ms = stats.avg_encode_time_ms; |
2201 info.encode_usage_percent = stats.encode_usage_percent; | 2209 info.encode_usage_percent = stats.encode_usage_percent; |
2202 | 2210 |
2203 info.nominal_bitrate = stats.media_bitrate_bps; | 2211 info.nominal_bitrate = stats.media_bitrate_bps; |
2204 | 2212 |
2205 info.send_frame_width = 0; | 2213 info.send_frame_width = 0; |
2206 info.send_frame_height = 0; | 2214 info.send_frame_height = 0; |
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2730 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; | 2738 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; |
2731 } | 2739 } |
2732 } | 2740 } |
2733 | 2741 |
2734 return video_codecs; | 2742 return video_codecs; |
2735 } | 2743 } |
2736 | 2744 |
2737 } // namespace cricket | 2745 } // namespace cricket |
2738 | 2746 |
2739 #endif // HAVE_WEBRTC_VIDEO | 2747 #endif // HAVE_WEBRTC_VIDEO |
OLD | NEW |