OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 if (fragment_counter == fragmentation.fragmentationVectorSize || | 191 if (fragment_counter == fragmentation.fragmentationVectorSize || |
192 i != fragmentation.fragmentationOffset[fragment_counter]) { | 192 i != fragmentation.fragmentationOffset[fragment_counter]) { |
193 encoded_image._buffer[i] = value++; | 193 encoded_image._buffer[i] = value++; |
194 } else { | 194 } else { |
195 ++fragment_counter; | 195 ++fragment_counter; |
196 } | 196 } |
197 } | 197 } |
198 CodecSpecificInfo specifics; | 198 CodecSpecificInfo specifics; |
199 memset(&specifics, 0, sizeof(specifics)); | 199 memset(&specifics, 0, sizeof(specifics)); |
200 specifics.codecType = kVideoCodecH264; | 200 specifics.codecType = kVideoCodecH264; |
| 201 specifics.codecType = kVideoCodecH264; |
| 202 specifics.codecSpecific.H264.packetization_mode = kH264PacketizationMode1; |
201 return callback_->OnEncodedImage(encoded_image, &specifics, &fragmentation); | 203 return callback_->OnEncodedImage(encoded_image, &specifics, &fragmentation); |
202 } | 204 } |
203 | 205 |
204 DelayedEncoder::DelayedEncoder(Clock* clock, int delay_ms) | 206 DelayedEncoder::DelayedEncoder(Clock* clock, int delay_ms) |
205 : test::FakeEncoder(clock), | 207 : test::FakeEncoder(clock), |
206 delay_ms_(delay_ms) {} | 208 delay_ms_(delay_ms) {} |
207 | 209 |
208 void DelayedEncoder::SetDelay(int delay_ms) { | 210 void DelayedEncoder::SetDelay(int delay_ms) { |
209 rtc::CritScope lock(&lock_); | 211 rtc::CritScope lock(&lock_); |
210 delay_ms_ = delay_ms; | 212 delay_ms_ = delay_ms; |
211 } | 213 } |
212 | 214 |
213 int32_t DelayedEncoder::Encode(const VideoFrame& input_image, | 215 int32_t DelayedEncoder::Encode(const VideoFrame& input_image, |
214 const CodecSpecificInfo* codec_specific_info, | 216 const CodecSpecificInfo* codec_specific_info, |
215 const std::vector<FrameType>* frame_types) { | 217 const std::vector<FrameType>* frame_types) { |
216 int delay_ms = 0; | 218 int delay_ms = 0; |
217 { | 219 { |
218 rtc::CritScope lock(&lock_); | 220 rtc::CritScope lock(&lock_); |
219 delay_ms = delay_ms_; | 221 delay_ms = delay_ms_; |
220 } | 222 } |
221 SleepMs(delay_ms); | 223 SleepMs(delay_ms); |
222 return FakeEncoder::Encode(input_image, codec_specific_info, frame_types); | 224 return FakeEncoder::Encode(input_image, codec_specific_info, frame_types); |
223 } | 225 } |
224 } // namespace test | 226 } // namespace test |
225 } // namespace webrtc | 227 } // namespace webrtc |
OLD | NEW |