summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/media/stagefright/MediaExtractor.h2
-rw-r--r--media/libmediaplayerservice/nuplayer/GenericSource.cpp8
-rw-r--r--media/libstagefright/MediaExtractor.cpp5
3 files changed, 9 insertions, 6 deletions
diff --git a/include/media/stagefright/MediaExtractor.h b/include/media/stagefright/MediaExtractor.h
index 2f2057f..e83defa 100644
--- a/include/media/stagefright/MediaExtractor.h
+++ b/include/media/stagefright/MediaExtractor.h
@@ -42,7 +42,7 @@ public:
static sp<MediaExtractor> Create(
const sp<DataSource> &source, const char *mime = NULL,
- const uint32_t flags = 0);
+ const uint32_t flags = 0, const sp<AMessage> *meta = NULL);
virtual size_t countTracks() = 0;
virtual sp<MediaSource> getTrack(size_t index) = 0;
diff --git a/media/libmediaplayerservice/nuplayer/GenericSource.cpp b/media/libmediaplayerservice/nuplayer/GenericSource.cpp
index e380f0a..beda8bd 100644
--- a/media/libmediaplayerservice/nuplayer/GenericSource.cpp
+++ b/media/libmediaplayerservice/nuplayer/GenericSource.cpp
@@ -141,14 +141,14 @@ status_t NuPlayer::GenericSource::initFromDataSource() {
sp<MediaExtractor> extractor;
String8 mimeType;
float confidence;
- sp<AMessage> dummy;
+ sp<AMessage> meta;
bool isWidevineStreaming = false;
CHECK(mDataSource != NULL);
if (mIsWidevine) {
isWidevineStreaming = SniffWVM(
- mDataSource, &mimeType, &confidence, &dummy);
+ mDataSource, &mimeType, &confidence, &meta);
if (!isWidevineStreaming ||
strcasecmp(
mimeType.string(), MEDIA_MIMETYPE_CONTAINER_WVM)) {
@@ -161,7 +161,7 @@ status_t NuPlayer::GenericSource::initFromDataSource() {
Mutex::Autolock _l(mSourceLock);
dataSource = mDataSource;
}
- if (!dataSource->sniff(&mimeType, &confidence, &dummy)) {
+ if (!dataSource->sniff(&mimeType, &confidence, &meta)) {
return UNKNOWN_ERROR;
}
isWidevineStreaming = !strcasecmp(
@@ -186,7 +186,7 @@ status_t NuPlayer::GenericSource::initFromDataSource() {
#endif
extractor = MediaExtractor::Create(mDataSource,
mimeType.isEmpty() ? NULL : mimeType.string(),
- mIsStreaming ? 0 : flags);
+ mIsStreaming ? 0 : flags, &meta);
}
if (extractor == NULL) {
diff --git a/media/libstagefright/MediaExtractor.cpp b/media/libstagefright/MediaExtractor.cpp
index ef0524a..ac6decdb6 100644
--- a/media/libstagefright/MediaExtractor.cpp
+++ b/media/libstagefright/MediaExtractor.cpp
@@ -57,7 +57,8 @@ uint32_t MediaExtractor::flags() const {
// static
sp<MediaExtractor> MediaExtractor::Create(
const sp<DataSource> &source, const char *mime,
- const uint32_t flags) {
+ const uint32_t flags, const sp<AMessage> *prevMeta) {
+
sp<AMessage> meta;
String8 tmp;
@@ -72,6 +73,8 @@ sp<MediaExtractor> MediaExtractor::Create(
mime = tmp.string();
ALOGV("Autodetected media content as '%s' with confidence %.2f",
mime, confidence);
+ } else if (prevMeta != NULL) {
+ meta = *prevMeta;
}
bool isDrm = false;