summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/matroska
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2011-08-22 13:21:26 -0700
committerAndreas Huber <andih@google.com>2011-08-22 13:21:26 -0700
commit8c32b164d00d3e4d73764d06956331f09693ef43 (patch)
tree9d51b06b8174e7ec7a9f2bf2025b002e1bd07937 /media/libstagefright/matroska
parent2edd41583bb8c2b90c332980e0d1c34ae9ede34e (diff)
downloadframeworks_av-8c32b164d00d3e4d73764d06956331f09693ef43.zip
frameworks_av-8c32b164d00d3e4d73764d06956331f09693ef43.tar.gz
frameworks_av-8c32b164d00d3e4d73764d06956331f09693ef43.tar.bz2
The MatroskaExtractor will now publish a different mime-type "video/webm" if
the doctype of the matroska file indicates that it is a webm file. Change-Id: I467f597690a841043ecd11d2a2cae93351820f1b related-to-bug: 5042137
Diffstat (limited to 'media/libstagefright/matroska')
-rw-r--r--media/libstagefright/matroska/MatroskaExtractor.cpp12
-rw-r--r--media/libstagefright/matroska/MatroskaExtractor.h1
2 files changed, 11 insertions, 2 deletions
diff --git a/media/libstagefright/matroska/MatroskaExtractor.cpp b/media/libstagefright/matroska/MatroskaExtractor.cpp
index e1b9991..3ef7b71 100644
--- a/media/libstagefright/matroska/MatroskaExtractor.cpp
+++ b/media/libstagefright/matroska/MatroskaExtractor.cpp
@@ -493,7 +493,8 @@ MatroskaExtractor::MatroskaExtractor(const sp<DataSource> &source)
: mDataSource(source),
mReader(new DataSourceReader(mDataSource)),
mSegment(NULL),
- mExtractedThumbnails(false) {
+ mExtractedThumbnails(false),
+ mIsWebm(false) {
off64_t size;
mIsLiveStreaming =
(mDataSource->flags()
@@ -507,6 +508,10 @@ MatroskaExtractor::MatroskaExtractor(const sp<DataSource> &source)
return;
}
+ if (ebmlHeader.m_docType && !strcmp("webm", ebmlHeader.m_docType)) {
+ mIsWebm = true;
+ }
+
long long ret =
mkvparser::Segment::CreateInstance(mReader, pos, mSegment);
@@ -757,7 +762,10 @@ void MatroskaExtractor::findThumbnails() {
sp<MetaData> MatroskaExtractor::getMetaData() {
sp<MetaData> meta = new MetaData;
- meta->setCString(kKeyMIMEType, MEDIA_MIMETYPE_CONTAINER_MATROSKA);
+
+ meta->setCString(
+ kKeyMIMEType,
+ mIsWebm ? "video/webm" : MEDIA_MIMETYPE_CONTAINER_MATROSKA);
return meta;
}
diff --git a/media/libstagefright/matroska/MatroskaExtractor.h b/media/libstagefright/matroska/MatroskaExtractor.h
index 38ebd61..1294b4f 100644
--- a/media/libstagefright/matroska/MatroskaExtractor.h
+++ b/media/libstagefright/matroska/MatroskaExtractor.h
@@ -68,6 +68,7 @@ private:
mkvparser::Segment *mSegment;
bool mExtractedThumbnails;
bool mIsLiveStreaming;
+ bool mIsWebm;
void addTracks();
void findThumbnails();