| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "media/base/android/access_unit_queue.h" | 5 #include "media/base/android/access_unit_queue.h" |
| 6 #include "testing/gtest/include/gtest/gtest.h" | 6 #include "testing/gtest/include/gtest/gtest.h" |
| 7 | 7 |
| 8 #define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) | 8 #define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) |
| 9 | 9 |
| 10 namespace media { | 10 namespace media { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 } | 41 } |
| 42 | 42 |
| 43 au.status = DemuxerStream::kOk; | 43 au.status = DemuxerStream::kOk; |
| 44 | 44 |
| 45 if (descr[i].unit_type == kEOS) { | 45 if (descr[i].unit_type == kEOS) { |
| 46 au.is_end_of_stream = true; | 46 au.is_end_of_stream = true; |
| 47 // ignore data | 47 // ignore data |
| 48 continue; | 48 continue; |
| 49 } | 49 } |
| 50 | 50 |
| 51 au.data = std::vector<uint8>(descr[i].data.begin(), descr[i].data.end()); | 51 au.data = std::vector<uint8_t>(descr[i].data.begin(), descr[i].data.end()); |
| 52 | 52 |
| 53 if (descr[i].unit_type == kKeyFrame) | 53 if (descr[i].unit_type == kKeyFrame) |
| 54 au.is_key_frame = true; | 54 au.is_key_frame = true; |
| 55 } | 55 } |
| 56 return result; | 56 return result; |
| 57 } | 57 } |
| 58 | 58 |
| 59 #define VERIFY_FIRST_BYTE(expected, info) \ | 59 #define VERIFY_FIRST_BYTE(expected, info) \ |
| 60 do { \ | 60 do { \ |
| 61 EXPECT_NE(nullptr, info.front_unit); \ | 61 EXPECT_NE(nullptr, info.front_unit); \ |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 info = au_queue.GetInfo(); | 354 info = au_queue.GetInfo(); |
| 355 VERIFY_FIRST_BYTE('e', info); | 355 VERIFY_FIRST_BYTE('e', info); |
| 356 | 356 |
| 357 // Rewind should find the same unit 'e. | 357 // Rewind should find the same unit 'e. |
| 358 EXPECT_TRUE(au_queue.RewindToLastKeyFrame()); | 358 EXPECT_TRUE(au_queue.RewindToLastKeyFrame()); |
| 359 info = au_queue.GetInfo(); | 359 info = au_queue.GetInfo(); |
| 360 VERIFY_FIRST_BYTE('e', info); | 360 VERIFY_FIRST_BYTE('e', info); |
| 361 } | 361 } |
| 362 | 362 |
| 363 } // namespace media | 363 } // namespace media |
| OLD | NEW |