Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * libjingle | 2 * libjingle |
| 3 * Copyright 2015 Google Inc. | 3 * Copyright 2015 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 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 788 | 788 |
| 789 // Generate a header describing a single fragment. | 789 // Generate a header describing a single fragment. |
| 790 webrtc::RTPFragmentationHeader header; | 790 webrtc::RTPFragmentationHeader header; |
| 791 memset(&header, 0, sizeof(header)); | 791 memset(&header, 0, sizeof(header)); |
| 792 if (codecType_ == kVideoCodecVP8) { | 792 if (codecType_ == kVideoCodecVP8) { |
| 793 header.VerifyAndAllocateFragmentationHeader(1); | 793 header.VerifyAndAllocateFragmentationHeader(1); |
| 794 header.fragmentationOffset[0] = 0; | 794 header.fragmentationOffset[0] = 0; |
| 795 header.fragmentationLength[0] = image->_length; | 795 header.fragmentationLength[0] = image->_length; |
| 796 header.fragmentationPlType[0] = 0; | 796 header.fragmentationPlType[0] = 0; |
| 797 header.fragmentationTimeDiff[0] = 0; | 797 header.fragmentationTimeDiff[0] = 0; |
| 798 if (scale_) | 798 if (scale_) { |
| 799 quality_scaler_.ReportQP(webrtc::vp8::GetQP(payload)); | 799 int qp; |
| 800 bool found = webrtc::vp8::GetQp(payload, payload_size, &qp); | |
| 801 RTC_DCHECK(found); | |
| 802 if (found) | |
|
magjed_webrtc
2015/10/20 13:17:20
You shouldn't handle DCHECK failures. At least thi
åsapersson
2015/10/20 13:52:36
Ok. Removed check.
| |
| 803 quality_scaler_.ReportQP(qp); | |
| 804 } | |
| 800 } else if (codecType_ == kVideoCodecH264) { | 805 } else if (codecType_ == kVideoCodecH264) { |
| 801 if (scale_) { | 806 if (scale_) { |
| 802 h264_bitstream_parser_.ParseBitstream(payload, payload_size); | 807 h264_bitstream_parser_.ParseBitstream(payload, payload_size); |
| 803 int qp; | 808 int qp; |
| 804 if (h264_bitstream_parser_.GetLastSliceQp(&qp)) | 809 if (h264_bitstream_parser_.GetLastSliceQp(&qp)) |
| 805 quality_scaler_.ReportQP(qp); | 810 quality_scaler_.ReportQP(qp); |
| 806 } | 811 } |
| 807 // For H.264 search for start codes. | 812 // For H.264 search for start codes. |
| 808 int32_t scPositions[MAX_NALUS_PERFRAME + 1] = {}; | 813 int32_t scPositions[MAX_NALUS_PERFRAME + 1] = {}; |
| 809 int32_t scPositionsLength = 0; | 814 int32_t scPositionsLength = 0; |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 952 } | 957 } |
| 953 | 958 |
| 954 void MediaCodecVideoEncoderFactory::DestroyVideoEncoder( | 959 void MediaCodecVideoEncoderFactory::DestroyVideoEncoder( |
| 955 webrtc::VideoEncoder* encoder) { | 960 webrtc::VideoEncoder* encoder) { |
| 956 ALOGD << "Destroy video encoder."; | 961 ALOGD << "Destroy video encoder."; |
| 957 delete encoder; | 962 delete encoder; |
| 958 } | 963 } |
| 959 | 964 |
| 960 } // namespace webrtc_jni | 965 } // namespace webrtc_jni |
| 961 | 966 |
| OLD | NEW |