summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/StagefrightMediaScanner.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'media/libstagefright/StagefrightMediaScanner.cpp')
-rw-r--r--media/libstagefright/StagefrightMediaScanner.cpp54
1 files changed, 2 insertions, 52 deletions
diff --git a/media/libstagefright/StagefrightMediaScanner.cpp b/media/libstagefright/StagefrightMediaScanner.cpp
index 2318844..8426ee7 100644
--- a/media/libstagefright/StagefrightMediaScanner.cpp
+++ b/media/libstagefright/StagefrightMediaScanner.cpp
@@ -26,10 +26,6 @@
// Sonivox includes
#include <libsonivox/eas.h>
-// Ogg Vorbis includes
-#include <Tremolo/ivorbiscodec.h>
-#include <Tremolo/ivorbisfile.h>
-
namespace android {
StagefrightMediaScanner::StagefrightMediaScanner()
@@ -42,7 +38,8 @@ static bool FileHasAcceptableExtension(const char *extension) {
static const char *kValidExtensions[] = {
".mp3", ".mp4", ".m4a", ".3gp", ".3gpp", ".3g2", ".3gpp2",
".mpeg", ".ogg", ".mid", ".smf", ".imy", ".wma", ".aac",
- ".wav", ".amr", ".midi", ".xmf", ".rtttl", ".rtx", ".ota"
+ ".wav", ".amr", ".midi", ".xmf", ".rtttl", ".rtx", ".ota",
+ ".mkv", ".mka", ".webm", ".ts"
};
static const size_t kNumValidExtensions =
sizeof(kValidExtensions) / sizeof(kValidExtensions[0]);
@@ -102,48 +99,6 @@ static status_t HandleMIDI(
return OK;
}
-static status_t HandleOGG(
- const char *filename, MediaScannerClient *client) {
- int duration;
-
- FILE *file = fopen(filename,"r");
- if (!file)
- return UNKNOWN_ERROR;
-
- OggVorbis_File vf;
- if (ov_open(file, &vf, NULL, 0) < 0) {
- return UNKNOWN_ERROR;
- }
-
- char **ptr=ov_comment(&vf,-1)->user_comments;
- while(*ptr){
- char *val = strstr(*ptr, "=");
- if (val) {
- int keylen = val++ - *ptr;
- char key[keylen + 1];
- strncpy(key, *ptr, keylen);
- key[keylen] = 0;
- if (!client->addStringTag(key, val)) goto failure;
- }
- ++ptr;
- }
-
- // Duration
- duration = ov_time_total(&vf, -1);
- if (duration > 0) {
- char buffer[20];
- sprintf(buffer, "%d", duration);
- if (!client->addStringTag("duration", buffer)) goto failure;
- }
-
- ov_clear(&vf); // this also closes the FILE
- return OK;
-
-failure:
- ov_clear(&vf); // this also closes the FILE
- return UNKNOWN_ERROR;
-}
-
status_t StagefrightMediaScanner::processFile(
const char *path, const char *mimeType,
MediaScannerClient &client) {
@@ -176,11 +131,6 @@ status_t StagefrightMediaScanner::processFile(
if (status != OK) {
return status;
}
- } else if (!strcasecmp(extension, ".ogg")) {
- status_t status = HandleOGG(path, &client);
- if (status != OK) {
- return status;
- }
} else if (mRetriever->setDataSource(path) == OK
&& mRetriever->setMode(
METADATA_MODE_METADATA_RETRIEVAL_ONLY) == OK) {