| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 WriteDummyTestFrames(kWidth, kHeight, kNumFrames, use_capture_tims_ms)); | 117 WriteDummyTestFrames(kWidth, kHeight, kNumFrames, use_capture_tims_ms)); |
| 118 EXPECT_TRUE(file_writer_->Close()); | 118 EXPECT_TRUE(file_writer_->Close()); |
| 119 | 119 |
| 120 std::unique_ptr<FileWrapper> out_file(FileWrapper::Create()); | 120 std::unique_ptr<FileWrapper> out_file(FileWrapper::Create()); |
| 121 ASSERT_EQ(0, out_file->OpenFile(file_name_.c_str(), true)); | 121 ASSERT_EQ(0, out_file->OpenFile(file_name_.c_str(), true)); |
| 122 VerifyIvfHeader(out_file.get(), fourcc, kWidth, kHeight, kNumFrames, | 122 VerifyIvfHeader(out_file.get(), fourcc, kWidth, kHeight, kNumFrames, |
| 123 use_capture_tims_ms); | 123 use_capture_tims_ms); |
| 124 VerifyDummyTestFrames(out_file.get(), kNumFrames); | 124 VerifyDummyTestFrames(out_file.get(), kNumFrames); |
| 125 | 125 |
| 126 out_file->Flush(); | 126 out_file->Flush(); |
| 127 EXPECT_EQ(0, out_file->CloseFile()); | 127 out_file->CloseFile(); |
| 128 | 128 |
| 129 bool file_removed = false; | 129 bool file_removed = false; |
| 130 for (int i = 0; i < kMaxFileRetries; ++i) { | 130 for (int i = 0; i < kMaxFileRetries; ++i) { |
| 131 file_removed = remove(file_name_.c_str()) == 0; | 131 file_removed = remove(file_name_.c_str()) == 0; |
| 132 if (file_removed) | 132 if (file_removed) |
| 133 break; | 133 break; |
| 134 | 134 |
| 135 // Couldn't remove file for some reason, wait a sec and try again. | 135 // Couldn't remove file for some reason, wait a sec and try again. |
| 136 rtc::Thread::SleepMs(1000); | 136 rtc::Thread::SleepMs(1000); |
| 137 } | 137 } |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 const uint8_t fourcc[4] = {'H', '2', '6', '4'}; | 194 const uint8_t fourcc[4] = {'H', '2', '6', '4'}; |
| 195 RunBasicFileStructureTest(kVideoCodecH264, fourcc, false); | 195 RunBasicFileStructureTest(kVideoCodecH264, fourcc, false); |
| 196 } | 196 } |
| 197 | 197 |
| 198 TEST_F(IvfFileWriterTest, WritesBasicH264FileMsTimestamp) { | 198 TEST_F(IvfFileWriterTest, WritesBasicH264FileMsTimestamp) { |
| 199 const uint8_t fourcc[4] = {'H', '2', '6', '4'}; | 199 const uint8_t fourcc[4] = {'H', '2', '6', '4'}; |
| 200 RunBasicFileStructureTest(kVideoCodecH264, fourcc, true); | 200 RunBasicFileStructureTest(kVideoCodecH264, fourcc, true); |
| 201 } | 201 } |
| 202 | 202 |
| 203 } // namespace webrtc | 203 } // namespace webrtc |
| OLD | NEW |