Lines Matching refs:trackIndex
65 void MediaSampleReaderNDK::advanceTrack_l(int trackIndex) { in advanceTrack_l() argument
70 (void)moveToTrack_l(trackIndex); in advanceTrack_l()
73 SampleCursor& cursor = mTrackCursors[trackIndex]; in advanceTrack_l()
78 if (mEnforceSequentialAccess && trackIndex == mExtractorTrackIndex) { in advanceTrack_l()
82 if (mExtractorTrackIndex != trackIndex) { in advanceTrack_l()
159 media_status_t MediaSampleReaderNDK::moveToSample_l(SamplePosition& pos, int trackIndex) { in moveToSample_l() argument
162 media_status_t status = seekExtractorBackwards_l(pos.timeStampUs, trackIndex, pos.index); in moveToSample_l()
176 media_status_t MediaSampleReaderNDK::moveToTrack_l(int trackIndex) { in moveToTrack_l() argument
177 return moveToSample_l(mTrackCursors[trackIndex].current, trackIndex); in moveToTrack_l()
180 media_status_t MediaSampleReaderNDK::waitForTrack_l(int trackIndex, in waitForTrack_l() argument
182 while (trackIndex != mExtractorTrackIndex && !mEosReached && mEnforceSequentialAccess) { in waitForTrack_l()
183 mTrackSignals[trackIndex].wait(lockHeld); in waitForTrack_l()
191 return moveToTrack_l(trackIndex); in waitForTrack_l()
198 int trackIndex, std::unique_lock<std::mutex>& lockHeld) { in primeExtractorForTrack_l() argument
209 return waitForTrack_l(trackIndex, lockHeld); in primeExtractorForTrack_l()
211 return moveToTrack_l(trackIndex); in primeExtractorForTrack_l()
215 media_status_t MediaSampleReaderNDK::selectTrack(int trackIndex) { in selectTrack() argument
218 if (trackIndex < 0 || trackIndex >= mTrackCount) { in selectTrack()
219 LOG(ERROR) << "Invalid trackIndex " << trackIndex << " for trackCount " << mTrackCount; in selectTrack()
221 } else if (mTrackSignals.find(trackIndex) != mTrackSignals.end()) { in selectTrack()
222 LOG(ERROR) << "TrackIndex " << trackIndex << " already selected"; in selectTrack()
229 media_status_t status = AMediaExtractor_selectTrack(mExtractor, trackIndex); in selectTrack()
235 mTrackSignals.emplace(std::piecewise_construct, std::forward_as_tuple(trackIndex), in selectTrack()
240 media_status_t MediaSampleReaderNDK::unselectTrack(int trackIndex) { in unselectTrack() argument
243 if (trackIndex < 0 || trackIndex >= mTrackCount) { in unselectTrack()
244 LOG(ERROR) << "Invalid trackIndex " << trackIndex << " for trackCount " << mTrackCount; in unselectTrack()
251 auto it = mTrackSignals.find(trackIndex); in unselectTrack()
253 LOG(ERROR) << "TrackIndex " << trackIndex << " is not selected"; in unselectTrack()
258 media_status_t status = AMediaExtractor_unselectTrack(mExtractor, trackIndex); in unselectTrack()
283 int trackIndex = -1; in setEnforceSequentialAccess() member
286 for (int trackIndex = 0; trackIndex < mTrackCount; ++trackIndex) { in setEnforceSequentialAccess() local
287 SamplePosition& lastKnownTrackPosition = mTrackCursors[trackIndex].current.isSet in setEnforceSequentialAccess()
288 ? mTrackCursors[trackIndex].current in setEnforceSequentialAccess()
289 : mTrackCursors[trackIndex].previous; in setEnforceSequentialAccess()
295 earliestSample.trackIndex = trackIndex; in setEnforceSequentialAccess()
305 media_status_t status = moveToSample_l(*earliestSample.pos, earliestSample.trackIndex); in setEnforceSequentialAccess()
320 media_status_t MediaSampleReaderNDK::getEstimatedBitrateForTrack(int trackIndex, int32_t* bitrate) { in getEstimatedBitrateForTrack() argument
324 if (mTrackSignals.find(trackIndex) == mTrackSignals.end()) { in getEstimatedBitrateForTrack()
343 if (AMediaExtractor_getSampleTrackIndex(mExtractor) == trackIndex) { in getEstimatedBitrateForTrack()
368 AMediaFormat* trackFormat = getTrackFormat(trackIndex); in getEstimatedBitrateForTrack()
391 media_status_t MediaSampleReaderNDK::getSampleInfoForTrack(int trackIndex, MediaSampleInfo* info) { in getSampleInfoForTrack() argument
394 if (mTrackSignals.find(trackIndex) == mTrackSignals.end()) { in getSampleInfoForTrack()
402 media_status_t status = primeExtractorForTrack_l(trackIndex, lock); in getSampleInfoForTrack()
411 LOG(DEBUG) << " getSampleInfoForTrack #" << trackIndex << ": End Of Stream"; in getSampleInfoForTrack()
413 LOG(ERROR) << " getSampleInfoForTrack #" << trackIndex << ": Error " << status; in getSampleInfoForTrack()
419 media_status_t MediaSampleReaderNDK::readSampleDataForTrack(int trackIndex, uint8_t* buffer, in readSampleDataForTrack() argument
423 if (mTrackSignals.find(trackIndex) == mTrackSignals.end()) { in readSampleDataForTrack()
431 media_status_t status = primeExtractorForTrack_l(trackIndex, lock); in readSampleDataForTrack()
448 advanceTrack_l(trackIndex); in readSampleDataForTrack()
453 void MediaSampleReaderNDK::advanceTrack(int trackIndex) { in advanceTrack() argument
456 if (mTrackSignals.find(trackIndex) != mTrackSignals.end()) { in advanceTrack()
457 advanceTrack_l(trackIndex); in advanceTrack()
459 LOG(ERROR) << "Trying to advance a track that is not selected (#" << trackIndex << ")"; in advanceTrack()
471 AMediaFormat* MediaSampleReaderNDK::getTrackFormat(int trackIndex) { in getTrackFormat() argument
472 if (trackIndex < 0 || trackIndex >= mTrackCount) { in getTrackFormat()
473 LOG(ERROR) << "Invalid trackIndex " << trackIndex << " for trackCount " << mTrackCount; in getTrackFormat()
477 return AMediaExtractor_getTrackFormat(mExtractor, trackIndex); in getTrackFormat()