summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Shih <robertshih@google.com>2015-04-23 16:39:18 -0700
committerRobert Shih <robertshih@google.com>2015-04-23 18:22:24 -0700
commitf8bd851cc652501239a8e3759b21890dfa2afdea (patch)
tree895659041fb0a778e00999b056d79395ad617fcf
parent38ad9c7d19a0699065b078a0e8dd7ece3d055bf7 (diff)
downloadframeworks_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
-rw-r--r--include/media/stagefright/MetaData.h3
-rw-r--r--media/libmediaplayerservice/nuplayer/GenericSource.cpp8
-rw-r--r--media/libstagefright/mpeg2ts/AnotherPacketSource.cpp5
3 files changed, 16 insertions, 0 deletions
diff --git a/include/media/stagefright/MetaData.h b/include/media/stagefright/MetaData.h
index 8bdebf6..ca80123 100644
--- a/include/media/stagefright/MetaData.h
+++ b/include/media/stagefright/MetaData.h
@@ -176,6 +176,9 @@ enum {
kKeyTrackIsDefault = 'dflt', // bool (int32_t)
// Similar to MediaFormat.KEY_IS_FORCED_SUBTITLE but pertains to av tracks as well.
kKeyTrackIsForced = 'frcd', // bool (int32_t)
+
+ // H264 supplemental enhancement information offsets/sizes
+ kKeySEI = 'sei ', // raw data
};
enum {
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;
}