Loading media/libstagefright/httplive/PlaylistFetcher.cpp +5 −4 Original line number Diff line number Diff line Loading @@ -861,11 +861,12 @@ status_t PlaylistFetcher::extractAndQueueAccessUnits( && source->dequeueAccessUnit(&accessUnit) == OK) { // Note that we do NOT dequeue any discontinuities. packetSource->queueAccessUnit(accessUnit); // for simplicity, store a reference to the format in each unit sp<MetaData> format = source->getFormat(); if (format != NULL) { accessUnit->meta()->setObject("format", format); } if (packetSource->getFormat() == NULL) { packetSource->setFormat(source->getFormat()); packetSource->queueAccessUnit(accessUnit); } } Loading media/libstagefright/mpeg2ts/AnotherPacketSource.cpp +39 −9 Original line number Diff line number Diff line Loading @@ -70,9 +70,29 @@ status_t AnotherPacketSource::stop() { } sp<MetaData> AnotherPacketSource::getFormat() { Mutex::Autolock autoLock(mLock); if (mFormat != NULL) { return mFormat; } List<sp<ABuffer> >::iterator it = mBuffers.begin(); while (it != mBuffers.end()) { sp<ABuffer> buffer = *it; int32_t discontinuity; if (buffer->meta()->findInt32("discontinuity", &discontinuity)) { break; } sp<RefBase> object; if (buffer->meta()->findObject("format", &object)) { return static_cast<MetaData*>(object.get()); } ++it; } return NULL; } status_t AnotherPacketSource::dequeueAccessUnit(sp<ABuffer> *buffer) { buffer->clear(); Loading @@ -94,6 +114,11 @@ status_t AnotherPacketSource::dequeueAccessUnit(sp<ABuffer> *buffer) { return INFO_DISCONTINUITY; } sp<RefBase> object; if ((*buffer)->meta()->findObject("format", &object)) { mFormat = static_cast<MetaData*>(object.get()); } return OK; } Loading @@ -120,7 +145,13 @@ status_t AnotherPacketSource::read( } return INFO_DISCONTINUITY; } else { } sp<RefBase> object; if (buffer->meta()->findObject("format", &object)) { mFormat = static_cast<MetaData*>(object.get()); } int64_t timeUs; CHECK(buffer->meta()->findInt64("timeUs", &timeUs)); Loading @@ -131,7 +162,6 @@ status_t AnotherPacketSource::read( *out = mediaBuffer; return OK; } } return mEOSResult; } Loading Loading
media/libstagefright/httplive/PlaylistFetcher.cpp +5 −4 Original line number Diff line number Diff line Loading @@ -861,11 +861,12 @@ status_t PlaylistFetcher::extractAndQueueAccessUnits( && source->dequeueAccessUnit(&accessUnit) == OK) { // Note that we do NOT dequeue any discontinuities. packetSource->queueAccessUnit(accessUnit); // for simplicity, store a reference to the format in each unit sp<MetaData> format = source->getFormat(); if (format != NULL) { accessUnit->meta()->setObject("format", format); } if (packetSource->getFormat() == NULL) { packetSource->setFormat(source->getFormat()); packetSource->queueAccessUnit(accessUnit); } } Loading
media/libstagefright/mpeg2ts/AnotherPacketSource.cpp +39 −9 Original line number Diff line number Diff line Loading @@ -70,9 +70,29 @@ status_t AnotherPacketSource::stop() { } sp<MetaData> AnotherPacketSource::getFormat() { Mutex::Autolock autoLock(mLock); if (mFormat != NULL) { return mFormat; } List<sp<ABuffer> >::iterator it = mBuffers.begin(); while (it != mBuffers.end()) { sp<ABuffer> buffer = *it; int32_t discontinuity; if (buffer->meta()->findInt32("discontinuity", &discontinuity)) { break; } sp<RefBase> object; if (buffer->meta()->findObject("format", &object)) { return static_cast<MetaData*>(object.get()); } ++it; } return NULL; } status_t AnotherPacketSource::dequeueAccessUnit(sp<ABuffer> *buffer) { buffer->clear(); Loading @@ -94,6 +114,11 @@ status_t AnotherPacketSource::dequeueAccessUnit(sp<ABuffer> *buffer) { return INFO_DISCONTINUITY; } sp<RefBase> object; if ((*buffer)->meta()->findObject("format", &object)) { mFormat = static_cast<MetaData*>(object.get()); } return OK; } Loading @@ -120,7 +145,13 @@ status_t AnotherPacketSource::read( } return INFO_DISCONTINUITY; } else { } sp<RefBase> object; if (buffer->meta()->findObject("format", &object)) { mFormat = static_cast<MetaData*>(object.get()); } int64_t timeUs; CHECK(buffer->meta()->findInt64("timeUs", &timeUs)); Loading @@ -131,7 +162,6 @@ status_t AnotherPacketSource::read( *out = mediaBuffer; return OK; } } return mEOSResult; } Loading