OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 if (encode_buffer_.size() == 0 && !encoded_info.send_even_if_empty) { | 164 if (encode_buffer_.size() == 0 && !encoded_info.send_even_if_empty) { |
165 // Not enough data. | 165 // Not enough data. |
166 return 0; | 166 return 0; |
167 } | 167 } |
168 previous_pltype = previous_pltype_; // Read it while we have the critsect. | 168 previous_pltype = previous_pltype_; // Read it while we have the critsect. |
169 | 169 |
170 RTPFragmentationHeader my_fragmentation; | 170 RTPFragmentationHeader my_fragmentation; |
171 ConvertEncodedInfoToFragmentationHeader(encoded_info, &my_fragmentation); | 171 ConvertEncodedInfoToFragmentationHeader(encoded_info, &my_fragmentation); |
172 FrameType frame_type; | 172 FrameType frame_type; |
173 if (encode_buffer_.size() == 0 && encoded_info.send_even_if_empty) { | 173 if (encode_buffer_.size() == 0 && encoded_info.send_even_if_empty) { |
174 frame_type = kFrameEmpty; | 174 frame_type = kEmptyFrame; |
175 encoded_info.payload_type = previous_pltype; | 175 encoded_info.payload_type = previous_pltype; |
176 } else { | 176 } else { |
177 RTC_DCHECK_GT(encode_buffer_.size(), 0u); | 177 RTC_DCHECK_GT(encode_buffer_.size(), 0u); |
178 frame_type = encoded_info.speech ? kAudioFrameSpeech : kAudioFrameCN; | 178 frame_type = encoded_info.speech ? kAudioFrameSpeech : kAudioFrameCN; |
179 } | 179 } |
180 | 180 |
181 { | 181 { |
182 CriticalSectionScoped lock(callback_crit_sect_.get()); | 182 CriticalSectionScoped lock(callback_crit_sect_.get()); |
183 if (packetization_callback_) { | 183 if (packetization_callback_) { |
184 packetization_callback_->SendData( | 184 packetization_callback_->SendData( |
(...skipping 895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1080 *sample_rate_hz = 8000; | 1080 *sample_rate_hz = 8000; |
1081 *channels = 1; | 1081 *channels = 1; |
1082 break; | 1082 break; |
1083 default: | 1083 default: |
1084 FATAL() << "Codec type " << codec_type << " not supported."; | 1084 FATAL() << "Codec type " << codec_type << " not supported."; |
1085 } | 1085 } |
1086 return true; | 1086 return true; |
1087 } | 1087 } |
1088 | 1088 |
1089 } // namespace webrtc | 1089 } // namespace webrtc |
OLD | NEW |