Squashed commit of the following:

commit f81bb1dac5ef107bb0d7d5d756fb1ffa532ba2cc
Author: Andreas Huber <andih@google.com>
Date:   Mon Jan 11 14:55:56 2010 -0800

    Support for duration metadata, midi and ogg-vorbis files (in mediascanner)

commit 0b1385a0dc156ce27985a1ff757c4c142fd7ec39
Author: Andreas Huber <andih@google.com>
Date:   Mon Jan 11 14:20:45 2010 -0800

    Refactor meta data logic. Container specific metadata is now also returned by the MediaExtractor.

commit f9818dfac39c96e5fefe8c8295e60580692d5990
Author: Andreas Huber <andih@google.com>
Date:   Fri Jan 8 14:26:09 2010 -0800

    A first pass at supporting metadata through ID3 tags.

commit 476e9e253633336ab790f943e2d6c0cd8991d76a
Author: Andreas Huber <andih@google.com>
Date:   Thu Jan 7 15:48:44 2010 -0800

    Initial checkin of ID3 (V2.2 and V2.3) parser for use in stagefright.

related-to-bug: 2295456
diff --git a/media/libstagefright/MediaExtractor.cpp b/media/libstagefright/MediaExtractor.cpp
index 9d3deb7..e46f00e 100644
--- a/media/libstagefright/MediaExtractor.cpp
+++ b/media/libstagefright/MediaExtractor.cpp
@@ -23,16 +23,18 @@
 #include "include/MPEG4Extractor.h"
 #include "include/WAVExtractor.h"
 
-#include <media/stagefright/CachingDataSource.h>
 #include <media/stagefright/DataSource.h>
-#include <media/stagefright/FileSource.h>
-#include <media/stagefright/HTTPDataSource.h>
 #include <media/stagefright/MediaDefs.h>
 #include <media/stagefright/MediaExtractor.h>
+#include <media/stagefright/MetaData.h>
 #include <utils/String8.h>
 
 namespace android {
 
+sp<MetaData> MediaExtractor::getMetaData() {
+    return new MetaData;
+}
+
 // static
 sp<MediaExtractor> MediaExtractor::Create(
         const sp<DataSource> &source, const char *mime) {
@@ -40,7 +42,7 @@
     if (mime == NULL) {
         float confidence;
         if (!source->sniff(&tmp, &confidence)) {
-            LOGE("FAILED to autodetect media content.");
+            LOGV("FAILED to autodetect media content.");
 
             return NULL;
         }
@@ -68,16 +70,7 @@
 // static
 sp<MediaExtractor> MediaExtractor::CreateFromURI(
         const char *uri, const char *mime) {
-    sp<DataSource> source;
-    if (!strncasecmp("file://", uri, 7)) {
-        source = new FileSource(uri + 7);
-    } else if (!strncasecmp("http://", uri, 7)) {
-        source = new HTTPDataSource(uri);
-        source = new CachingDataSource(source, 64 * 1024, 10);
-    } else {
-        // Assume it's a filename.
-        source = new FileSource(uri);
-    }
+    sp<DataSource> source = DataSource::CreateFromURI(uri);
 
     if (source == NULL || source->initCheck() != OK) {
         return NULL;