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

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

audio: add support for FLAC and AMRWB+ decoding

Add support for QTI FLAC decoding by setting up
the component only if it is enabled and is not an
encoder.

Add audio group in mediacodec.rc so that AMRWB+
and other audio nodes can be accessed by it.

Change-Id: Ia35b0b9218fdf2584348a2a95bf0401c5065dedc
parent d423f9d2
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1818,6 +1818,7 @@ status_t NuPlayer::Renderer::onOpenAudioSink(
            offloadInfo.bit_rate = avgBitRate;
            offloadInfo.has_video = hasVideo;
            offloadInfo.is_streaming = true;
            offloadInfo.bit_width = bitWidth;
            offloadInfo.offload_buffer_size = offloadBufferSize;

            if (memcmp(&mCurrentOffloadInfo, &offloadInfo, sizeof(offloadInfo)) == 0) {
+5 −0
Original line number Diff line number Diff line
@@ -2195,7 +2195,12 @@ status_t ACodec::configureCodec(
            }
            err = setupG711Codec(encoder, sampleRate, numChannels);
        }
#ifdef QTI_FLAC_DECODER
//setup qti flac component only if it is enabled and it is not encoder
    } else if (!strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_FLAC) && encoder) {
#else
    } else if (!strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_FLAC)) {
#endif
        int32_t numChannels = 0, sampleRate = 0, compressionLevel = -1;
        if (encoder &&
                (!msg->findInt32("channel-count", &numChannels)
+6 −0
Original line number Diff line number Diff line
@@ -133,6 +133,12 @@ ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT)))
LOCAL_CFLAGS += -DENABLE_STAGEFRIGHT_EXPERIMENTS
endif

ifeq ($(call is-vendor-board-platform,QCOM),true)
ifeq ($(strip $(AUDIO_FEATURE_ENABLED_EXTN_FLAC_DECODER)),true)
LOCAL_CFLAGS += -DQTI_FLAC_DECODER
endif
endif

LOCAL_CLANG := true
LOCAL_SANITIZE := unsigned-integer-overflow signed-integer-overflow

+6 −0
Original line number Diff line number Diff line
@@ -31,6 +31,12 @@ LOCAL_SHARED_LIBRARIES := \
        libstagefright_foundation       \
        libdl

ifeq ($(call is-vendor-board-platform,QCOM),true)
ifeq ($(strip $(AUDIO_FEATURE_ENABLED_EXTN_FLAC_DECODER)),true)
LOCAL_CFLAGS += -DQTI_FLAC_DECODER
endif
endif

LOCAL_MODULE:= libstagefright_omx
LOCAL_CFLAGS += -Werror -Wall
LOCAL_CLANG := true
+3 −0
Original line number Diff line number Diff line
@@ -59,6 +59,9 @@ static const struct {
    { "OMX.google.raw.decoder", "rawdec", "audio_decoder.raw" },
    { "OMX.google.flac.encoder", "flacenc", "audio_encoder.flac" },
    { "OMX.google.gsm.decoder", "gsmdec", "audio_decoder.gsm" },
#ifdef QTI_FLAC_DECODER
    { "OMX.qti.audio.decoder.flac", "flacdec", "audio_decoder.flac" },
#endif
};

static const size_t kNumComponents =
Loading