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

Commit e92a4877 authored by Mingming Yin's avatar Mingming Yin Committed by Linux Build Service Account
Browse files

NuPlayer: Add support for QTI FLAC solution

Use the OMX component of default RAW decoder for FLAC codec and
setup generic source to extract PCM samples from FLACDecoder.

Change-Id: I8735c8c6e6bd0dc2a6d67902e9e7ad33d8705609
parent 98890fab
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -22,6 +22,15 @@ LOCAL_C_INCLUDES := \
	$(TOP)/frameworks/av/media/libmediaplayerservice              \
	$(TOP)/frameworks/native/include/media/openmax

#QTI FLAC Decoder
ifeq ($(call is-vendor-board-platform,QCOM),true)
ifeq ($(strip $(AUDIO_FEATURE_ENABLED_EXTN_FLAC_DECODER)),true)
LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/mm-audio/audio-flac
LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/mm-audio
LOCAL_CFLAGS := -DQTI_FLAC_DECODER
endif
endif

LOCAL_MODULE:= libstagefright_nuplayer

LOCAL_MODULE_TAGS := eng
+8 −0
Original line number Diff line number Diff line
@@ -37,6 +37,9 @@
#include "../../libstagefright/include/NuCachedSource2.h"
#include "../../libstagefright/include/WVMExtractor.h"
#include "../../libstagefright/include/HTTPBase.h"
#ifdef QTI_FLAC_DECODER
#include "../../libstagefright/include/FLACDecoder.h"
#endif

namespace android {

@@ -185,6 +188,11 @@ status_t NuPlayer::GenericSource::initFromDataSource() {
                mAudioTrack.mPackets =
                    new AnotherPacketSource(mAudioTrack.mSource->getFormat());

#ifdef QTI_FLAC_DECODER
                if (!strncasecmp(mime, MEDIA_MIMETYPE_AUDIO_FLAC, 10)) {
                     mAudioTrack.mSource = new FLACDecoder(track);
                }
#endif
                if (!strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_VORBIS)) {
                    mAudioIsVorbis = true;
                } else {