OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 if (renderer_) | 171 if (renderer_) |
172 renderer_->OnFrame(video_frame); | 172 renderer_->OnFrame(video_frame); |
173 | 173 |
174 if (basename_.empty()) | 174 if (basename_.empty()) |
175 return; | 175 return; |
176 | 176 |
177 std::stringstream filename; | 177 std::stringstream filename; |
178 filename << basename_ << count_++ << "_" << video_frame.timestamp() | 178 filename << basename_ << count_++ << "_" << video_frame.timestamp() |
179 << ".jpg"; | 179 << ".jpg"; |
180 | 180 |
181 #if !defined(WEBRTC_IOS) | |
182 test::JpegFrameWriter frame_writer(filename.str()); | 181 test::JpegFrameWriter frame_writer(filename.str()); |
183 RTC_CHECK(frame_writer.WriteFrame(video_frame, 100)); | 182 RTC_CHECK(frame_writer.WriteFrame(video_frame, 100)); |
184 #endif | |
185 } | 183 } |
186 | 184 |
187 const std::string basename_; | 185 const std::string basename_; |
188 rtc::VideoSinkInterface<VideoFrame>* const renderer_; | 186 rtc::VideoSinkInterface<VideoFrame>* const renderer_; |
189 FILE* file_; | 187 FILE* file_; |
190 size_t count_; | 188 size_t count_; |
191 }; | 189 }; |
192 | 190 |
193 class DecoderBitstreamFileWriter : public EncodedFrameObserver { | 191 class DecoderBitstreamFileWriter : public EncodedFrameObserver { |
194 public: | 192 public: |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 } | 328 } |
331 } // namespace webrtc | 329 } // namespace webrtc |
332 | 330 |
333 int main(int argc, char* argv[]) { | 331 int main(int argc, char* argv[]) { |
334 ::testing::InitGoogleTest(&argc, argv); | 332 ::testing::InitGoogleTest(&argc, argv); |
335 google::ParseCommandLineFlags(&argc, &argv, true); | 333 google::ParseCommandLineFlags(&argc, &argv, true); |
336 | 334 |
337 webrtc::test::RunTest(webrtc::RtpReplay); | 335 webrtc::test::RunTest(webrtc::RtpReplay); |
338 return 0; | 336 return 0; |
339 } | 337 } |
OLD | NEW |