From: Steve Kondik Date: Mon, 14 Dec 2015 09:03:13 +0000 (-0800) Subject: stagefright-plugins: Parse additional FLAC metadata X-Git-Tag: android-x86-7.1-r1~75 X-Git-Url: http://git.osdn.net/view?p=android-x86%2Fexternal-stagefright-plugins.git;a=commitdiff_plain;h=75f6d25c5d8e79e142424cb08b05704d7e888c87 stagefright-plugins: Parse additional FLAC metadata * Parse the min/max frame and block sizes from the streaminfo and report it in the metadata * This is needed for FLAC offload support on new Qualcomm DSPs. Change-Id: Ib37891a5766066306adf18a6c23af9c9ac7dcdb1 --- diff --git a/utils/codec_utils.cpp b/utils/codec_utils.cpp index 2444673..6be4e4f 100644 --- a/utils/codec_utils.cpp +++ b/utils/codec_utils.cpp @@ -31,6 +31,7 @@ extern "C" { #endif #include +#include #include #include #include @@ -486,6 +487,17 @@ sp setFLACFormat(AVCodecContext *avctx) meta->setCString(kKeyMIMEType, MEDIA_MIMETYPE_AUDIO_FLAC); meta->setData(kKeyRawCodecSpecificData, 0, avctx->extradata, avctx->extradata_size); + ABitReader br(avctx->extradata, avctx->extradata_size); + int32_t minBlockSize = br.getBits(16); + int32_t maxBlockSize = br.getBits(16); + int32_t minFrameSize = br.getBits(24); + int32_t maxFrameSize = br.getBits(24); + + meta->setInt32('mibs', minBlockSize); + meta->setInt32('mabs', maxBlockSize); + meta->setInt32('mifs', minFrameSize); + meta->setInt32('mafs', maxFrameSize); + return meta; }