From 8c32b164d00d3e4d73764d06956331f09693ef43 Mon Sep 17 00:00:00 2001 From: Andreas Huber Date: Mon, 22 Aug 2011 13:21:26 -0700 Subject: 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 --- media/libstagefright/matroska/MatroskaExtractor.cpp | 12 ++++++++++-- media/libstagefright/matroska/MatroskaExtractor.h | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'media') 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 &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 &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 MatroskaExtractor::getMetaData() { sp 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(); -- cgit v1.1