From 455a7456a95cc6bab8630def18537b9b275ed211 Mon Sep 17 00:00:00 2001 From: Steve Kondik Date: Mon, 14 Dec 2015 20:57:31 -0600 Subject: nuplayer: Improve offload format conversions * Annotate source buffers with the audio format * Add support for 32-bit signed PCM offload (zero copy) Change-Id: Id758830784740c0a038452d383c8ec8e3e4593bb --- media/libmediaplayerservice/nuplayer/NuPlayerDecoder.h | 9 +++++++-- .../libmediaplayerservice/nuplayer/NuPlayerDecoderPassThrough.h | 4 +++- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'media/libmediaplayerservice') diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.h b/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.h index 5f84a06..23c87ae 100644 --- a/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.h +++ b/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.h @@ -17,9 +17,13 @@ #ifndef NUPLAYER_DECODER_H_ #define NUPLAYER_DECODER_H_ -#include "NuPlayer.h" +#include +#include "NuPlayer.h" #include "NuPlayerDecoderBase.h" +#include "NuPlayerSource.h" + +#include "mediaplayerservice/AVNuExtensions.h" namespace android { @@ -49,7 +53,8 @@ protected: virtual void onFlush(); virtual void onShutdown(bool notifyComplete); virtual bool doRequestBuffers(); - virtual void setPcmFormat(const sp & /*format*/) {} + virtual void setPcmFormat(const sp &format) { format->setInt32("pcm-format", + AVNuUtils::get()->getKeyPCMFormat(mSource->getFormatMeta(true))); } enum { kWhatCodecNotify = 'cdcN', diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerDecoderPassThrough.h b/media/libmediaplayerservice/nuplayer/NuPlayerDecoderPassThrough.h index fbc4087..cfd61da 100644 --- a/media/libmediaplayerservice/nuplayer/NuPlayerDecoderPassThrough.h +++ b/media/libmediaplayerservice/nuplayer/NuPlayerDecoderPassThrough.h @@ -18,6 +18,8 @@ #define NUPLAYER_DECODER_PASS_THROUGH_H_ +#include + #include "NuPlayer.h" #include "NuPlayerDecoderBase.h" @@ -43,7 +45,7 @@ protected: virtual void onFlush(); virtual void onShutdown(bool notifyComplete); virtual bool doRequestBuffers(); - virtual void setPcmFormat(const sp & /*format*/) {} + virtual void setPcmFormat(const sp &format) { format->setInt32("pcm-format", mPCMFormat); } virtual sp aggregateBuffer(const sp &accessUnit); enum { -- cgit v1.1