Lines Matching refs:trackIndex

93         for (int trackIndex = 0; trackIndex < mTrackCount; trackIndex++) {  in SampleAccessTester()  local
94 EXPECT_EQ(mSampleReader->selectTrack(trackIndex), AMEDIA_OK); in SampleAccessTester()
101 void getSampleInfo(int trackIndex) { in getSampleInfo() argument
103 media_status_t status = mSampleReader->getSampleInfoForTrack(trackIndex, &info); in getSampleInfo()
107 void readSamplesAsync(int trackIndex, int sampleCount) { in readSamplesAsync() argument
108 mTrackThreads[trackIndex] = std::thread{[this, trackIndex, sampleCount] { in readSamplesAsync()
112 media_status_t status = mSampleReader->getSampleInfoForTrack(trackIndex, &info); in readSamplesAsync()
121 status = mSampleReader->readSampleDataForTrack(trackIndex, buffer.get(), info.size); in readSamplesAsync()
126 mSamples[trackIndex].emplace_back(info.flags, info.presentationTimeUs, info.size, in readSamplesAsync()
135 for (int trackIndex = 0; trackIndex < mTrackCount; trackIndex++) { in readSamplesAsync() local
136 readSamplesAsync(trackIndex, sampleCount); in readSamplesAsync()
140 void waitForTrack(int trackIndex) { in waitForTrack() argument
141 ASSERT_TRUE(mTrackThreads[trackIndex].joinable()); in waitForTrack()
142 mTrackThreads[trackIndex].join(); in waitForTrack()
146 for (int trackIndex = 0; trackIndex < mTrackCount; trackIndex++) { in waitForTracks() local
147 waitForTrack(trackIndex); in waitForTracks()
193 for (size_t trackIndex = 0; trackIndex < mTrackCount; trackIndex++) { in SetUp() local
194 AMediaExtractor_selectTrack(mExtractor, trackIndex); in SetUp()
204 const int trackIndex = AMediaExtractor_getSampleTrackIndex(mExtractor); in initExtractorSamples() local
205 mExtractorSamples[trackIndex].emplace_back(mExtractor); in initExtractorSamples()
216 const int trackIndex = AMediaExtractor_getSampleTrackIndex(mExtractor); in getTrackBitrates() local
217 totalSize[trackIndex] += AMediaExtractor_getSampleSize(mExtractor); in getTrackBitrates()
223 for (int trackIndex = 0; trackIndex < mTrackCount; trackIndex++) { in getTrackBitrates() local
225 AMediaFormat* trackFormat = AMediaExtractor_getTrackFormat(mExtractor, trackIndex); in getTrackBitrates()
228 bitrates.push_back(roundf((float)totalSize[trackIndex] * 8 * 1000000 / durationUs)); in getTrackBitrates()
238 for (int trackIndex = 0; trackIndex < mTrackCount; trackIndex++) { in compareSamples() local
239 LOG(DEBUG) << "Track " << trackIndex << ", comparing " in compareSamples()
240 << readerSamples[trackIndex].size() << " samples."; in compareSamples()
241 EXPECT_EQ(readerSamples[trackIndex].size(), mExtractorSamples[trackIndex].size()); in compareSamples()
242 for (size_t sampleIndex = 0; sampleIndex < readerSamples[trackIndex].size(); in compareSamples()
244 EXPECT_EQ(readerSamples[trackIndex][sampleIndex], in compareSamples()
245 mExtractorSamples[trackIndex][sampleIndex]); in compareSamples()
282 for (int trackIndex = 0; trackIndex < mTrackCount; ++trackIndex) { in TEST_F() local
283 tester.readSamplesAsync(trackIndex, mExtractorSamples[trackIndex].size() - 1); in TEST_F()
286 for (int trackIndex = 0; trackIndex < mTrackCount; ++trackIndex) { in TEST_F() local
287 tester.readSamplesAsync(trackIndex, SAMPLE_COUNT_ALL); in TEST_F()
288 tester.waitForTrack(trackIndex); in TEST_F()
295 for (int trackIndex = mTrackCount - 1; trackIndex >= 0; --trackIndex) { in TEST_F() local
296 tester.readSamplesAsync(trackIndex, mExtractorSamples[trackIndex].size() - 1); in TEST_F()
299 for (int trackIndex = mTrackCount - 1; trackIndex >= 0; --trackIndex) { in TEST_F() local
300 tester.readSamplesAsync(trackIndex, SAMPLE_COUNT_ALL); in TEST_F()
301 tester.waitForTrack(trackIndex); in TEST_F()
339 for (int trackIndex = 0; trackIndex < mTrackCount; ++trackIndex) { in TEST_F() local
340 if (trackIndex == trackIndToEOS) continue; in TEST_F()
342 tester.readSamplesAsync(trackIndex, SAMPLE_COUNT_ALL); in TEST_F()
343 tester.waitForTrack(trackIndex); in TEST_F()
364 for (int trackIndex = 0; trackIndex < mTrackCount; ++trackIndex) { in TEST_F() local
365 if (trackIndex == trackIndToTest) { in TEST_F()
366 tester.readSamplesAsync(trackIndex, sampleCount); in TEST_F()
368 tester.readSamplesAsync(trackIndex, mExtractorSamples[trackIndex].size() / 2); in TEST_F()
392 for (int trackIndex = 0; trackIndex < mTrackCount; ++trackIndex) { in TEST_F() local
393 EXPECT_EQ(sampleReader->selectTrack(trackIndex), AMEDIA_OK); in TEST_F()
396 EXPECT_EQ(sampleReader->getEstimatedBitrateForTrack(trackIndex, &bitrate), AMEDIA_OK); in TEST_F()
403 EXPECT_EQ(bitrate, actualTrackBitrates[trackIndex]); in TEST_F()