Lines Matching refs:extractor
38 static bool isExtractorOKonEOS(AMediaExtractor* extractor) { in isExtractorOKonEOS() argument
39 return AMediaExtractor_getSampleTrackIndex(extractor) < 0 && in isExtractorOKonEOS()
40 AMediaExtractor_getSampleSize(extractor) < 0 && in isExtractorOKonEOS()
41 (int)AMediaExtractor_getSampleFlags(extractor) < 0 && in isExtractorOKonEOS()
42 AMediaExtractor_getSampleTime(extractor) < 0; in isExtractorOKonEOS()
58 static void inline setSampleInfo(AMediaExtractor* extractor, AMediaCodecBufferInfo* info) { in setSampleInfo() argument
59 info->flags = AMediaExtractor_getSampleFlags(extractor); in setSampleInfo()
61 info->size = AMediaExtractor_getSampleSize(extractor); in setSampleInfo()
62 info->presentationTimeUs = AMediaExtractor_getSampleTime(extractor); in setSampleInfo()
180 static bool validateCachedDuration(AMediaExtractor* extractor, bool isNetworkSource) { in validateCachedDuration() argument
182 AMediaExtractor_selectTrack(extractor, 0); in validateCachedDuration()
185 if (AMediaExtractor_getCachedDuration(extractor) < 0) { in validateCachedDuration()
190 if (!AMediaExtractor_advance(extractor)) break; in validateCachedDuration()
192 AMediaExtractor_unselectTrack(extractor, 0); in validateCachedDuration()
194 if (AMediaExtractor_getCachedDuration(extractor) != -1) { in validateCachedDuration()
203 AMediaExtractor* extractor = nullptr; in createExtractorFromFD() local
206 extractor = AMediaExtractor_new(); in createExtractorFromFD()
207 media_status_t res = AMediaExtractor_setDataSourceFd(extractor, fileno(fp), 0, buf.st_size); in createExtractorFromFD()
209 AMediaExtractor_delete(extractor); in createExtractorFromFD()
210 extractor = nullptr; in createExtractorFromFD()
213 return extractor; in createExtractorFromFD()
267 AMediaExtractor* extractor = createExtractorFromFD(srcFp); in getSeekablePoints() local
268 if (!extractor) { in getSeekablePoints()
274 for (size_t trackID = 0; trackID < AMediaExtractor_getTrackCount(extractor); trackID++) { in getSeekablePoints()
275 AMediaFormat* format = AMediaExtractor_getTrackFormat(extractor, trackID); in getSeekablePoints()
282 AMediaExtractor_selectTrack(extractor, trackID); in getSeekablePoints()
284 uint32_t sampleFlags = AMediaExtractor_getSampleFlags(extractor); in getSeekablePoints()
287 setSampleInfo(extractor, sampleInfo); in getSeekablePoints()
290 } while (AMediaExtractor_advance(extractor)); in getSeekablePoints()
291 AMediaExtractor_unselectTrack(extractor, trackID); in getSeekablePoints()
295 AMediaExtractor_delete(extractor); in getSeekablePoints()
314 AMediaExtractor* extractor = createExtractorFromFD(srcFp); in generateSeekTestArgs() local
315 if (!extractor) { in generateSeekTestArgs()
322 for (size_t trackID = 0; trackID < AMediaExtractor_getTrackCount(extractor); trackID++) { in generateSeekTestArgs()
323 AMediaFormat* format = AMediaExtractor_getTrackFormat(extractor, trackID); in generateSeekTestArgs()
330 AMediaExtractor_selectTrack(extractor, trackID); in generateSeekTestArgs()
337 AMediaExtractor_seekTo(extractor, pts, (SeekMode)mode); in generateSeekTestArgs()
339 setSampleInfo(extractor, &currInfo); in generateSeekTestArgs()
343 AMediaExtractor_unselectTrack(extractor, trackID); in generateSeekTestArgs()
347 AMediaExtractor_delete(extractor); in generateSeekTestArgs()
413 AMediaExtractor* extractor = createExtractorFromFD(srcFp); in checkSeekPoints() local
414 if (!extractor) { in checkSeekPoints()
419 for (size_t trackID = 0; trackID < AMediaExtractor_getTrackCount(extractor); trackID++) { in checkSeekPoints()
420 AMediaFormat* format = AMediaExtractor_getTrackFormat(extractor, trackID); in checkSeekPoints()
427 AMediaExtractor_selectTrack(extractor, trackID); in checkSeekPoints()
430 AMediaExtractor_seekTo(extractor, arg->mTimeStamp, arg->mMode); in checkSeekPoints()
431 setSampleInfo(extractor, &received); in checkSeekPoints()
440 AMediaExtractor_unselectTrack(extractor, trackID); in checkSeekPoints()
444 AMediaExtractor_delete(extractor); in checkSeekPoints()
518 AMediaExtractor* extractor = nullptr; in nativeReadAllData() local
523 isPass = createExtractorFromUrl(env, jkeys, jvalues, &extractor, &dataSource, csrcPath); in nativeReadAllData()
526 extractor = createExtractorFromFD(srcFp); in nativeReadAllData()
527 if (extractor == nullptr) { in nativeReadAllData()
537 if (extractor) AMediaExtractor_delete(extractor); in nativeReadAllData()
543 for (size_t trackID = 0; trackID < AMediaExtractor_getTrackCount(extractor) && isPass; in nativeReadAllData()
545 AMediaFormat* format = AMediaExtractor_getTrackFormat(extractor, trackID); in nativeReadAllData()
552 AMediaExtractor_selectTrack(extractor, trackID); in nativeReadAllData()
601 setSampleInfo(extractor, &sampleInfo); in nativeReadAllData()
602 ssize_t refSz = AMediaExtractor_readSampleData(extractor, buffer, maxSampleSize); in nativeReadAllData()
623 if (!AMediaExtractor_advance(extractor)) { in nativeReadAllData()
624 if (!isExtractorOKonEOS(extractor)) { in nativeReadAllData()
632 if (extractor) AMediaExtractor_delete(extractor); in nativeReadAllData()
728 AMediaExtractor* extractor = createExtractorFromFD(srcFp); in nativeTestSeekToZero() local
729 if (extractor) { in nativeTestSeekToZero()
733 for (size_t trackID = 0; trackID < AMediaExtractor_getTrackCount(extractor); trackID++) { in nativeTestSeekToZero()
734 AMediaFormat* format = AMediaExtractor_getTrackFormat(extractor, trackID); in nativeTestSeekToZero()
742 AMediaExtractor_selectTrack(extractor, trackID); in nativeTestSeekToZero()
743 setSampleInfo(extractor, &sampleInfoAtZero); in nativeTestSeekToZero()
744 AMediaExtractor_seekTo(extractor, randomPts, AMEDIAEXTRACTOR_SEEK_NEXT_SYNC); in nativeTestSeekToZero()
745 AMediaExtractor_seekTo(extractor, 0, AMEDIAEXTRACTOR_SEEK_CLOSEST_SYNC); in nativeTestSeekToZero()
746 setSampleInfo(extractor, &currInfo); in nativeTestSeekToZero()
757 AMediaExtractor_seekTo(extractor, -1L, AMEDIAEXTRACTOR_SEEK_CLOSEST_SYNC); in nativeTestSeekToZero()
758 setSampleInfo(extractor, &currInfo); in nativeTestSeekToZero()
769 AMediaExtractor_unselectTrack(extractor, trackID); in nativeTestSeekToZero()
773 AMediaExtractor_delete(extractor); in nativeTestSeekToZero()
785 AMediaExtractor* extractor = createExtractorFromFD(srcFp); in nativeTestFileFormat() local
786 if (extractor) { in nativeTestFileFormat()
787 AMediaFormat* format = AMediaExtractor_getFileFormat(extractor); in nativeTestFileFormat()
795 AMediaExtractor_delete(extractor); in nativeTestFileFormat()