Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fae09bea authored by Sharad Sangle's avatar Sharad Sangle Committed by Linux Build Service Account
Browse files

audio: add support for AMRWB+

add support for AMRWB+ audio decoding

Conflicts:
	media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp

Change-Id: I6eedebe93c482150234b4ca1d0472b189c450dc6
parent 2d846a14
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ namespace android {

struct ACodec;
class MediaExtractor;
struct MediaCodec;

/*
 * Factory to create objects of base-classes in libstagefright
@@ -58,6 +59,8 @@ struct AVUtils {
            const sp<MetaData> &meta, sp<AMessage> *format);
    virtual DataSource::SnifferFunc getExtendedSniffer();

    virtual sp<MediaCodec> createCustomComponentByName(const sp<ALooper> &looper,
                const char* mime, bool encoder);
    // ----- NO TRESSPASSING BEYOND THIS LINE ------
    DECLARE_LOADABLE_SINGLETON(AVUtils);
};
+6 −0
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@
#include <media/stagefright/MediaCodecList.h>
#include <media/stagefright/MetaData.h>
#include <media/stagefright/ACodec.h>
#include <media/stagefright/MediaCodec.h>

#include "common/ExtensionsLoader.hpp"
#include "stagefright/AVExtensions.h"
@@ -58,6 +59,11 @@ DataSource::SnifferFunc AVUtils::getExtendedSniffer() {
    return dumbSniffer;
}

sp<MediaCodec> AVUtils::createCustomComponentByName(
        const sp<ALooper> &, const char* , bool ) {
    return NULL;
}

// ----- NO TRESSPASSING BEYOND THIS LINE ------
AVUtils::AVUtils() {
}
+5 −2
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@
#include <media/stagefright/MediaDefs.h>
#include <media/stagefright/MediaErrors.h>

#include <stagefright/AVExtensions.h>
#include <gui/Surface.h>

#include "avc_utils.h"
@@ -251,8 +252,10 @@ void NuPlayer::Decoder::onConfigure(const sp<AMessage> &format) {
    mComponentName.append(" decoder");
    ALOGV("[%s] onConfigure (surface=%p)", mComponentName.c_str(), mSurface.get());

    mCodec = MediaCodec::CreateByType(
            mCodecLooper, mime.c_str(), false /* encoder */, NULL /* err */, mPid);
    mCodec = AVUtils::get()->createCustomComponentByName(mCodecLooper, mime.c_str(), false /* encoder */);
    if (mCodec == NULL) {
        mCodec = MediaCodec::CreateByType(mCodecLooper, mime.c_str(), false /* encoder */);
    }
    int32_t secure = 0;
    if (format->findInt32("secure", &secure) && secure != 0) {
        if (mCodec != NULL) {