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 if (webrtc::vp8::GetQp(payload, payload_size, &qp)) |
| 801 quality_scaler_.ReportQP(qp); |
| 802 } |
800 } else if (codecType_ == kVideoCodecH264) { | 803 } else if (codecType_ == kVideoCodecH264) { |
801 if (scale_) { | 804 if (scale_) { |
802 h264_bitstream_parser_.ParseBitstream(payload, payload_size); | 805 h264_bitstream_parser_.ParseBitstream(payload, payload_size); |
803 int qp; | 806 int qp; |
804 if (h264_bitstream_parser_.GetLastSliceQp(&qp)) | 807 if (h264_bitstream_parser_.GetLastSliceQp(&qp)) |
805 quality_scaler_.ReportQP(qp); | 808 quality_scaler_.ReportQP(qp); |
806 } | 809 } |
807 // For H.264 search for start codes. | 810 // For H.264 search for start codes. |
808 int32_t scPositions[MAX_NALUS_PERFRAME + 1] = {}; | 811 int32_t scPositions[MAX_NALUS_PERFRAME + 1] = {}; |
809 int32_t scPositionsLength = 0; | 812 int32_t scPositionsLength = 0; |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
952 } | 955 } |
953 | 956 |
954 void MediaCodecVideoEncoderFactory::DestroyVideoEncoder( | 957 void MediaCodecVideoEncoderFactory::DestroyVideoEncoder( |
955 webrtc::VideoEncoder* encoder) { | 958 webrtc::VideoEncoder* encoder) { |
956 ALOGD << "Destroy video encoder."; | 959 ALOGD << "Destroy video encoder."; |
957 delete encoder; | 960 delete encoder; |
958 } | 961 } |
959 | 962 |
960 } // namespace webrtc_jni | 963 } // namespace webrtc_jni |
961 | 964 |
OLD | NEW |