From 4595be952e3b1d6776a023e3f447c057797f1505 Mon Sep 17 00:00:00 2001 From: Andreas Huber Date: Tue, 25 May 2010 11:20:29 -0700 Subject: Support for ogg(vorbis) metadata in stagefright including album art. Change-Id: I0c8c0136cebe2d2d97caabb7bc0c65be86329dbb related-to-bug: 2713414 --- media/libstagefright/StagefrightMediaScanner.cpp | 50 ------------------------ 1 file changed, 50 deletions(-) (limited to 'media/libstagefright/StagefrightMediaScanner.cpp') diff --git a/media/libstagefright/StagefrightMediaScanner.cpp b/media/libstagefright/StagefrightMediaScanner.cpp index ab17b04..2829638 100644 --- a/media/libstagefright/StagefrightMediaScanner.cpp +++ b/media/libstagefright/StagefrightMediaScanner.cpp @@ -26,10 +26,6 @@ // Sonivox includes #include -// Ogg Vorbis includes -#include -#include - namespace android { StagefrightMediaScanner::StagefrightMediaScanner() @@ -103,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,10 +130,6 @@ status_t StagefrightMediaScanner::processFile( return HandleMIDI(path, &client); } - if (!strcasecmp(extension, ".ogg")) { - return HandleOGG(path, &client); - } - if (mRetriever->setDataSource(path) == OK && mRetriever->setMode( METADATA_MODE_METADATA_RETRIEVAL_ONLY) == OK) { -- cgit v1.1