diff options
author | Robert Shih <robertshih@google.com> | 2015-04-23 16:39:18 -0700 |
---|---|---|
committer | Robert Shih <robertshih@google.com> | 2015-04-23 18:22:24 -0700 |
commit | f8bd851cc652501239a8e3759b21890dfa2afdea (patch) | |
tree | 895659041fb0a778e00999b056d79395ad617fcf /media | |
parent | 38ad9c7d19a0699065b078a0e8dd7ece3d055bf7 (diff) | |
download | frameworks_av-f8bd851cc652501239a8e3759b21890dfa2afdea.zip frameworks_av-f8bd851cc652501239a8e3759b21890dfa2afdea.tar.gz frameworks_av-f8bd851cc652501239a8e3759b21890dfa2afdea.tar.bz2 |
Copy sei offset/size during ABuffer/MediaBuffer conversion
Bug: 20537676
Change-Id: I0bd11527ccd022c39d94b7877df81de4da1b14a6
Diffstat (limited to 'media')
-rw-r--r-- | media/libmediaplayerservice/nuplayer/GenericSource.cpp | 8 | ||||
-rw-r--r-- | media/libstagefright/mpeg2ts/AnotherPacketSource.cpp | 5 |
2 files changed, 13 insertions, 0 deletions
diff --git a/media/libmediaplayerservice/nuplayer/GenericSource.cpp b/media/libmediaplayerservice/nuplayer/GenericSource.cpp index b7a88e7..7eaa0e0 100644 --- a/media/libmediaplayerservice/nuplayer/GenericSource.cpp +++ b/media/libmediaplayerservice/nuplayer/GenericSource.cpp @@ -1400,6 +1400,14 @@ sp<ABuffer> NuPlayer::GenericSource::mediaBufferToABuffer( meta->setInt32("trackIndex", mSubtitleTrack.mIndex); } + uint32_t dataType; // unused + const void *seiData; + size_t seiLength; + if (mb->meta_data()->findData(kKeySEI, &dataType, &seiData, &seiLength)) { + sp<ABuffer> sei = ABuffer::CreateAsCopy(seiData, seiLength);; + meta->setBuffer("sei", sei); + } + if (actualTimeUs) { *actualTimeUs = timeUs; } diff --git a/media/libstagefright/mpeg2ts/AnotherPacketSource.cpp b/media/libstagefright/mpeg2ts/AnotherPacketSource.cpp index f74b859..0878a1b 100644 --- a/media/libstagefright/mpeg2ts/AnotherPacketSource.cpp +++ b/media/libstagefright/mpeg2ts/AnotherPacketSource.cpp @@ -211,6 +211,11 @@ status_t AnotherPacketSource::read( mediaBuffer->meta_data()->setInt32(kKeyIsSyncFrame, isSync); } + sp<ABuffer> sei; + if (buffer->meta()->findBuffer("sei", &sei) && sei != NULL) { + mediaBuffer->meta_data()->setData(kKeySEI, 0, sei->data(), sei->size()); + } + *out = mediaBuffer; return OK; } |