Loading media/extractors/mpeg2/MPEG2PSExtractor.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -734,6 +734,9 @@ media_status_t MPEG2PSExtractor::Track::read( if (inMeta.findData(kKeySEI, &bufType, &bufData, &bufSize)) { AMediaFormat_setBuffer(outMeta, AMEDIAFORMAT_KEY_SEI, bufData, bufSize); } if (inMeta.findData(kKeyAudioPresentationInfo, &bufType, &bufData, &bufSize)) { AMediaFormat_setBuffer(outMeta, AMEDIAFORMAT_KEY_AUDIO_PRESENTATION_INFO, bufData, bufSize); } mbuf->release(); return AMEDIA_OK; } Loading media/extractors/mpeg2/MPEG2TSExtractor.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -224,6 +224,9 @@ media_status_t MPEG2TSSource::read( if (inMeta.findData(kKeySEI, &bufType, &bufData, &bufSize)) { AMediaFormat_setBuffer(outMeta, AMEDIAFORMAT_KEY_SEI, bufData, bufSize); } if (inMeta.findData(kKeyAudioPresentationInfo, &bufType, &bufData, &bufSize)) { AMediaFormat_setBuffer(outMeta, AMEDIAFORMAT_KEY_AUDIO_PRESENTATION_INFO, bufData, bufSize); } mbuf->release(); return AMEDIA_OK; } Loading media/libstagefright/MediaTrack.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -172,6 +172,10 @@ status_t MediaTrackCUnwrapper::read(MediaBufferBase **buffer, const ReadOptions meta.setData(kKeySEI, MetaDataBase::Type::TYPE_NONE, valbuf->data(), valbuf->size()); } if (format->mFormat->findBuffer("audio-presentation-info", &valbuf)) { meta.setData(kKeyAudioPresentationInfo, MetaDataBase::Type::TYPE_NONE, valbuf->data(), valbuf->size()); } } else { *buffer = nullptr; } Loading media/libstagefright/NuMediaExtractor.cpp +20 −16 Original line number Diff line number Diff line Loading @@ -795,21 +795,21 @@ bool NuMediaExtractor::getCachedDuration( } // Return OK if we have received an audio presentation info. // Return ERROR_END_OF_STREAM if no tracks are available. // Return ERROR_UNSUPPORTED if the track has no audio presentation. // Return INVALID_OPERATION if audio presentation metadata version does not match. status_t NuMediaExtractor::getAudioPresentations( size_t trackIndex, AudioPresentationCollection *presentations) const { size_t trackIndex, AudioPresentationCollection *presentations) { Mutex::Autolock autoLock(mLock); if (mImpl == NULL) { return -EINVAL; } if (trackIndex >= mImpl->countTracks()) { return -ERANGE; ssize_t minIndex = fetchAllTrackSamples(); if (minIndex < 0) { return ERROR_END_OF_STREAM; } for (size_t i = 0; i < mSelectedTracks.size(); ++i) { TrackInfo *info = &mSelectedTracks.editItemAt(i); sp<MetaData> meta = mImpl->getTrackMetaData(trackIndex); if (info->mTrackIndex == trackIndex) { sp<MetaData> meta = new MetaData(info->mSamples.begin()->mBuffer->meta_data()); uint32_t type; const void *data; Loading @@ -818,7 +818,11 @@ status_t NuMediaExtractor::getAudioPresentations( std::istringstream inStream(std::string(static_cast<const char*>(data), size)); return deserializeAudioPresentations(&inStream, presentations); } ALOGE("Source does not contain any audio presentation"); ALOGV("Track %zu does not contain any audio presentation", trackIndex); return ERROR_UNSUPPORTED; } } ALOGV("Source does not contain any audio presentation"); return ERROR_UNSUPPORTED; } Loading media/libstagefright/include/media/stagefright/NuMediaExtractor.h +1 −2 Original line number Diff line number Diff line Loading @@ -96,8 +96,7 @@ struct NuMediaExtractor : public RefBase { bool getCachedDuration(int64_t *durationUs, bool *eos) const; status_t getAudioPresentations(size_t trackIdx, AudioPresentationCollection *presentations) const; status_t getAudioPresentations(size_t trackIdx, AudioPresentationCollection *presentations); protected: virtual ~NuMediaExtractor(); Loading Loading
media/extractors/mpeg2/MPEG2PSExtractor.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -734,6 +734,9 @@ media_status_t MPEG2PSExtractor::Track::read( if (inMeta.findData(kKeySEI, &bufType, &bufData, &bufSize)) { AMediaFormat_setBuffer(outMeta, AMEDIAFORMAT_KEY_SEI, bufData, bufSize); } if (inMeta.findData(kKeyAudioPresentationInfo, &bufType, &bufData, &bufSize)) { AMediaFormat_setBuffer(outMeta, AMEDIAFORMAT_KEY_AUDIO_PRESENTATION_INFO, bufData, bufSize); } mbuf->release(); return AMEDIA_OK; } Loading
media/extractors/mpeg2/MPEG2TSExtractor.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -224,6 +224,9 @@ media_status_t MPEG2TSSource::read( if (inMeta.findData(kKeySEI, &bufType, &bufData, &bufSize)) { AMediaFormat_setBuffer(outMeta, AMEDIAFORMAT_KEY_SEI, bufData, bufSize); } if (inMeta.findData(kKeyAudioPresentationInfo, &bufType, &bufData, &bufSize)) { AMediaFormat_setBuffer(outMeta, AMEDIAFORMAT_KEY_AUDIO_PRESENTATION_INFO, bufData, bufSize); } mbuf->release(); return AMEDIA_OK; } Loading
media/libstagefright/MediaTrack.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -172,6 +172,10 @@ status_t MediaTrackCUnwrapper::read(MediaBufferBase **buffer, const ReadOptions meta.setData(kKeySEI, MetaDataBase::Type::TYPE_NONE, valbuf->data(), valbuf->size()); } if (format->mFormat->findBuffer("audio-presentation-info", &valbuf)) { meta.setData(kKeyAudioPresentationInfo, MetaDataBase::Type::TYPE_NONE, valbuf->data(), valbuf->size()); } } else { *buffer = nullptr; } Loading
media/libstagefright/NuMediaExtractor.cpp +20 −16 Original line number Diff line number Diff line Loading @@ -795,21 +795,21 @@ bool NuMediaExtractor::getCachedDuration( } // Return OK if we have received an audio presentation info. // Return ERROR_END_OF_STREAM if no tracks are available. // Return ERROR_UNSUPPORTED if the track has no audio presentation. // Return INVALID_OPERATION if audio presentation metadata version does not match. status_t NuMediaExtractor::getAudioPresentations( size_t trackIndex, AudioPresentationCollection *presentations) const { size_t trackIndex, AudioPresentationCollection *presentations) { Mutex::Autolock autoLock(mLock); if (mImpl == NULL) { return -EINVAL; } if (trackIndex >= mImpl->countTracks()) { return -ERANGE; ssize_t minIndex = fetchAllTrackSamples(); if (minIndex < 0) { return ERROR_END_OF_STREAM; } for (size_t i = 0; i < mSelectedTracks.size(); ++i) { TrackInfo *info = &mSelectedTracks.editItemAt(i); sp<MetaData> meta = mImpl->getTrackMetaData(trackIndex); if (info->mTrackIndex == trackIndex) { sp<MetaData> meta = new MetaData(info->mSamples.begin()->mBuffer->meta_data()); uint32_t type; const void *data; Loading @@ -818,7 +818,11 @@ status_t NuMediaExtractor::getAudioPresentations( std::istringstream inStream(std::string(static_cast<const char*>(data), size)); return deserializeAudioPresentations(&inStream, presentations); } ALOGE("Source does not contain any audio presentation"); ALOGV("Track %zu does not contain any audio presentation", trackIndex); return ERROR_UNSUPPORTED; } } ALOGV("Source does not contain any audio presentation"); return ERROR_UNSUPPORTED; } Loading
media/libstagefright/include/media/stagefright/NuMediaExtractor.h +1 −2 Original line number Diff line number Diff line Loading @@ -96,8 +96,7 @@ struct NuMediaExtractor : public RefBase { bool getCachedDuration(int64_t *durationUs, bool *eos) const; status_t getAudioPresentations(size_t trackIdx, AudioPresentationCollection *presentations) const; status_t getAudioPresentations(size_t trackIdx, AudioPresentationCollection *presentations); protected: virtual ~NuMediaExtractor(); Loading