Example #1
0
static sp<MediaMetadataRetrieverBase> createRetriever(player_type playerType)
{
    sp<MediaMetadataRetrieverBase> p;
    switch (playerType) {
#if BUILD_WITH_FULL_STAGEFRIGHT
        case STAGEFRIGHT_PLAYER:
        {
            char value[PROPERTY_VALUE_MAX];
            if (property_get("media.stagefright.enable-meta", value, NULL)
                && (!strcmp(value, "1") || !strcasecmp(value, "true"))) {
                LOGV("create StagefrightMetadataRetriever");
                p = new StagefrightMetadataRetriever;
                break;
            }

            // fall through
        }
#endif
#ifndef NO_OPENCORE
        case PV_PLAYER:
            LOGV("create pv metadata retriever");
            p = new PVMetadataRetriever();
            break;
#endif
        case VORBIS_PLAYER:
            LOGV("create vorbis metadata retriever");
            p = new VorbisMetadataRetriever();
            break;
        case SONIVOX_PLAYER:
            LOGV("create midi metadata retriever");
            p = new MidiMetadataRetriever();
            break;
#ifdef USE_BOARD_MEDIAPLUGIN
        case BOARD_HW_PLAYER:
            LOGV("create BoardHW metadata retriever");
            p = createMetadataRetrieverHardware();
            break;
#endif
        default:
            // TODO:
            // support for TEST_PLAYER
            LOGE("player type %d is not supported",  playerType);
            break;
    }
    if (p == NULL) {
        LOGE("failed to create a retriever object");
    }
    return p;
}
static sp<MediaMetadataRetrieverBase> createRetriever(player_type playerType)
{
    sp<MediaMetadataRetrieverBase> p;
    switch (playerType) {
        case STAGEFRIGHT_PLAYER:
        case FLAC_PLAYER:
        {
            p = new StagefrightMetadataRetriever;
            break;
        }
#ifndef NO_OPENCORE
        case PV_PLAYER:
            LOGV("create pv metadata retriever");
            p = new PVMetadataRetriever();
            break;
#endif
        case SONIVOX_PLAYER:
            LOGV("create midi metadata retriever");
            p = new MidiMetadataRetriever();
            break;
#ifdef USE_BOARD_MEDIAPLUGIN
        case BOARD_HW_PLAYER:
            LOGV("create BoardHW metadata retriever");
            p = createMetadataRetrieverHardware();
            break;
#endif
        default:
            // TODO:
            // support for TEST_PLAYER
            LOGE("player type %d is not supported",  playerType);
            break;
    }
    if (p == NULL) {
        LOGE("failed to create a retriever object");
    }
    return p;
}