Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(367)

Side by Side Diff: webrtc/test/fake_encoder.cc

Issue 2558463002: Reland of H.264 packetization mode 0 (try 3) (Closed)
Patch Set: Lengthened timeout Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/modules/video_coding/include/video_codec_interface.h ('k') | webrtc/video/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 if (fragment_counter == fragmentation.fragmentationVectorSize || 193 if (fragment_counter == fragmentation.fragmentationVectorSize ||
194 i != fragmentation.fragmentationOffset[fragment_counter]) { 194 i != fragmentation.fragmentationOffset[fragment_counter]) {
195 encoded_image._buffer[i] = value++; 195 encoded_image._buffer[i] = value++;
196 } else { 196 } else {
197 ++fragment_counter; 197 ++fragment_counter;
198 } 198 }
199 } 199 }
200 CodecSpecificInfo specifics; 200 CodecSpecificInfo specifics;
201 memset(&specifics, 0, sizeof(specifics)); 201 memset(&specifics, 0, sizeof(specifics));
202 specifics.codecType = kVideoCodecH264; 202 specifics.codecType = kVideoCodecH264;
203 specifics.codecSpecific.H264.packetization_mode =
204 H264PacketizationMode::NonInterleaved;
203 return callback_->OnEncodedImage(encoded_image, &specifics, &fragmentation); 205 return callback_->OnEncodedImage(encoded_image, &specifics, &fragmentation);
204 } 206 }
205 207
206 DelayedEncoder::DelayedEncoder(Clock* clock, int delay_ms) 208 DelayedEncoder::DelayedEncoder(Clock* clock, int delay_ms)
207 : test::FakeEncoder(clock), 209 : test::FakeEncoder(clock),
208 delay_ms_(delay_ms) {} 210 delay_ms_(delay_ms) {}
209 211
210 void DelayedEncoder::SetDelay(int delay_ms) { 212 void DelayedEncoder::SetDelay(int delay_ms) {
211 rtc::CritScope lock(&lock_); 213 rtc::CritScope lock(&lock_);
212 delay_ms_ = delay_ms; 214 delay_ms_ = delay_ms;
213 } 215 }
214 216
215 int32_t DelayedEncoder::Encode(const VideoFrame& input_image, 217 int32_t DelayedEncoder::Encode(const VideoFrame& input_image,
216 const CodecSpecificInfo* codec_specific_info, 218 const CodecSpecificInfo* codec_specific_info,
217 const std::vector<FrameType>* frame_types) { 219 const std::vector<FrameType>* frame_types) {
218 int delay_ms = 0; 220 int delay_ms = 0;
219 { 221 {
220 rtc::CritScope lock(&lock_); 222 rtc::CritScope lock(&lock_);
221 delay_ms = delay_ms_; 223 delay_ms = delay_ms_;
222 } 224 }
223 SleepMs(delay_ms); 225 SleepMs(delay_ms);
224 return FakeEncoder::Encode(input_image, codec_specific_info, frame_types); 226 return FakeEncoder::Encode(input_image, codec_specific_info, frame_types);
225 } 227 }
226 } // namespace test 228 } // namespace test
227 } // namespace webrtc 229 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/video_coding/include/video_codec_interface.h ('k') | webrtc/video/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698