OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <string.h> | 5 #include <string.h> |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/strings/string_split.h" | 8 #include "base/strings/string_split.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "media/base/decrypt_config.h" | 10 #include "media/base/decrypt_config.h" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 std::vector<std::string> subsample_specs = base::SplitString( | 138 std::vector<std::string> subsample_specs = base::SplitString( |
139 str, " ", base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY); | 139 str, " ", base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY); |
140 EXPECT_GT(subsample_specs.size(), 0u); | 140 EXPECT_GT(subsample_specs.size(), 0u); |
141 | 141 |
142 buffer->clear(); | 142 buffer->clear(); |
143 for (size_t i = 0; i < subsample_specs.size(); ++i) { | 143 for (size_t i = 0; i < subsample_specs.size(); ++i) { |
144 SubsampleEntry entry; | 144 SubsampleEntry entry; |
145 size_t start = buffer->size(); | 145 size_t start = buffer->size(); |
146 | 146 |
147 std::vector<std::string> subsample_nalus = base::SplitString( | 147 std::vector<std::string> subsample_nalus = base::SplitString( |
148 subsample_specs[i], ",", base::KEEP_WHITESPACE, | 148 subsample_specs[i], ",", base::KEEP_WHITESPACE, |
149 base::SPLIT_WANT_NONEMPTY); | 149 base::SPLIT_WANT_NONEMPTY); |
150 EXPECT_GT(subsample_nalus.size(), 0u); | 150 EXPECT_GT(subsample_nalus.size(), 0u); |
151 for (size_t j = 0; j < subsample_nalus.size(); ++j) { | 151 for (size_t j = 0; j < subsample_nalus.size(); ++j) { |
152 WriteStartCodeAndNALUType(buffer, subsample_nalus[j]); | 152 WriteStartCodeAndNALUType(buffer, subsample_nalus[j]); |
153 | 153 |
154 // Write junk for the payload since the current code doesn't | 154 // Write junk for the payload since the current code doesn't |
155 // actually look at it. | 155 // actually look at it. |
156 buffer->push_back(0x32); | 156 buffer->push_back(0x32); |
157 buffer->push_back(0x12); | 157 buffer->push_back(0x12); |
158 buffer->push_back(0x67); | 158 buffer->push_back(0x67); |
159 } | 159 } |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 << "'" << test_cases[i].input << "' insert failed."; | 410 << "'" << test_cases[i].input << "' insert failed."; |
411 EXPECT_TRUE(AVC::IsValidAnnexB(buf, subsamples)) | 411 EXPECT_TRUE(AVC::IsValidAnnexB(buf, subsamples)) |
412 << "'" << test_cases[i].input << "' created invalid AnnexB."; | 412 << "'" << test_cases[i].input << "' created invalid AnnexB."; |
413 EXPECT_EQ(test_cases[i].expected, AnnexBToString(buf, subsamples)) | 413 EXPECT_EQ(test_cases[i].expected, AnnexBToString(buf, subsamples)) |
414 << "'" << test_cases[i].input << "' generated unexpected output."; | 414 << "'" << test_cases[i].input << "' generated unexpected output."; |
415 } | 415 } |
416 } | 416 } |
417 | 417 |
418 } // namespace mp4 | 418 } // namespace mp4 |
419 } // namespace media | 419 } // namespace media |
OLD | NEW |