summaryrefslogtreecommitdiffstats
path: root/media/libavextensions
diff options
context:
space:
mode:
authorSteve Kondik <steve@cyngn.com>2015-12-12 21:28:57 -0800
committerSteve Kondik <steve@cyngn.com>2015-12-13 13:16:01 -0800
commit0c19cf7478f4dc10f2739bf6eefa1887a79b48cf (patch)
treedb6eef718afc558b8036530512beb5f7cd5d8a27 /media/libavextensions
parent6dde130280d6ead297170211b005cc809e7f7bde (diff)
downloadframeworks_av-0c19cf7478f4dc10f2739bf6eefa1887a79b48cf.zip
frameworks_av-0c19cf7478f4dc10f2739bf6eefa1887a79b48cf.tar.gz
frameworks_av-0c19cf7478f4dc10f2739bf6eefa1887a79b48cf.tar.bz2
stagefright: Add support for FLAC offloading
* New Qualcomm DSPs support FLAC decoding, but the offload code is stubbed out in M. Unstub it from what used to be open source. Change-Id: I03c129c42ebc6909a3392e42a7f96791c8fabd28
Diffstat (limited to 'media/libavextensions')
-rw-r--r--media/libavextensions/Android.mk6
-rw-r--r--media/libavextensions/mediaplayerservice/AVNuUtils.cpp3
-rw-r--r--media/libavextensions/stagefright/AVExtensions.h2
-rw-r--r--media/libavextensions/stagefright/AVUtils.cpp17
4 files changed, 23 insertions, 5 deletions
diff --git a/media/libavextensions/Android.mk b/media/libavextensions/Android.mk
index a39a76e..8099ad4 100644
--- a/media/libavextensions/Android.mk
+++ b/media/libavextensions/Android.mk
@@ -17,9 +17,15 @@ LOCAL_C_INCLUDES:= \
LOCAL_CFLAGS += -Wno-multichar -Werror
+ifeq ($(call is-vendor-board-platform,QCOM),true)
+LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/mm-audio
ifeq ($(TARGET_ENABLE_QC_AV_ENHANCEMENTS),true)
LOCAL_CFLAGS += -DENABLE_AV_ENHANCEMENTS
endif
+ifeq ($(strip $(AUDIO_FEATURE_ENABLED_FLAC_OFFLOAD)),true)
+ LOCAL_CFLAGS += -DFLAC_OFFLOAD_ENABLED
+endif
+endif
LOCAL_MODULE:= libavextensions
LOCAL_CFLAGS += -DLOG_NDEBUG=0
diff --git a/media/libavextensions/mediaplayerservice/AVNuUtils.cpp b/media/libavextensions/mediaplayerservice/AVNuUtils.cpp
index 8a78767..c475fd3 100644
--- a/media/libavextensions/mediaplayerservice/AVNuUtils.cpp
+++ b/media/libavextensions/mediaplayerservice/AVNuUtils.cpp
@@ -228,6 +228,9 @@ void AVNuUtils::setPCMFormat(const sp<AMessage> &format, audio_format_t audioFor
}
void AVNuUtils::setSourcePCMFormat(const sp<MetaData> &audioMeta) {
+ if (!isRAWFormat(audioMeta))
+ return;
+
audio_format_t pcmFormat = getKeyPCMFormat(audioMeta);
ALOGI("setSourcePCMFormat fmt=%x", pcmFormat);
audioMeta->dumpToLog();
diff --git a/media/libavextensions/stagefright/AVExtensions.h b/media/libavextensions/stagefright/AVExtensions.h
index 0b70c08..9474d19 100644
--- a/media/libavextensions/stagefright/AVExtensions.h
+++ b/media/libavextensions/stagefright/AVExtensions.h
@@ -35,10 +35,10 @@
#include <camera/ICamera.h>
#include <media/mediarecorder.h>
#include <media/IOMX.h>
+#include <media/AudioParameter.h>
namespace android {
-class AudioParameter;
class MetaData;
class MediaExtractor;
class MPEG4Writer;
diff --git a/media/libavextensions/stagefright/AVUtils.cpp b/media/libavextensions/stagefright/AVUtils.cpp
index c36e0bb..02648fb 100644
--- a/media/libavextensions/stagefright/AVUtils.cpp
+++ b/media/libavextensions/stagefright/AVUtils.cpp
@@ -42,6 +42,9 @@
#ifdef QCOM_HARDWARE
#include "QCMediaDefs.h"
#include "QCMetaData.h"
+#ifdef FLAC_OFFLOAD_ENABLED
+#include "audio_defs.h"
+#endif
#endif
#include "common/ExtensionsLoader.hpp"
@@ -84,6 +87,12 @@ static const MetaKeyEntry MetaKeyTable[] {
{kKeyUseArbitraryMode , "use-arbitrary-mode" , INT32}, //bool (int32_t)
{kKeySmoothStreaming , "smooth-streaming" , INT32}, //bool (int32_t)
{kKeyHFR , "hfr" , INT32}, // int32_t
+#ifdef FLAC_OFFLOAD_ENABLED
+ {kKeyMinBlkSize , "min-block-size" , INT32},
+ {kKeyMaxBlkSize , "max-block-size" , INT32},
+ {kKeyMinFrmSize , "min-frame-size" , INT32},
+ {kKeyMaxFrmSize , "max-frame-size" , INT32},
+#endif
#endif
@@ -221,16 +230,16 @@ status_t AVUtils::sendMetaDataToHal(
#ifdef FLAC_OFFLOAD_ENABLED
int32_t minBlkSize, maxBlkSize, minFrmSize, maxFrmSize; //FLAC params
if (meta->findInt32(kKeyMinBlkSize, &minBlkSize)) {
- param.addInt(String8(AUDIO_OFFLOAD_CODEC_FLAC_MIN_BLK_SIZE), minBlkSize);
+ param->addInt(String8(AUDIO_OFFLOAD_CODEC_FLAC_MIN_BLK_SIZE), minBlkSize);
}
if (meta->findInt32(kKeyMaxBlkSize, &maxBlkSize)) {
- param.addInt(String8(AUDIO_OFFLOAD_CODEC_FLAC_MAX_BLK_SIZE), maxBlkSize);
+ param->addInt(String8(AUDIO_OFFLOAD_CODEC_FLAC_MAX_BLK_SIZE), maxBlkSize);
}
if (meta->findInt32(kKeyMinFrmSize, &minFrmSize)) {
- param.addInt(String8(AUDIO_OFFLOAD_CODEC_FLAC_MIN_FRAME_SIZE), minFrmSize);
+ param->addInt(String8(AUDIO_OFFLOAD_CODEC_FLAC_MIN_FRAME_SIZE), minFrmSize);
}
if (meta->findInt32(kKeyMaxFrmSize, &maxFrmSize)) {
- param.addInt(String8(AUDIO_OFFLOAD_CODEC_FLAC_MAX_FRAME_SIZE), maxFrmSize);
+ param->addInt(String8(AUDIO_OFFLOAD_CODEC_FLAC_MAX_FRAME_SIZE), maxFrmSize);
}
#else
(void)meta;