From 9be69bd990889cc942a53c22f6f8463f146fd8e7 Mon Sep 17 00:00:00 2001 From: Shivaprasad Hongal Date: Fri, 18 Sep 2015 15:17:14 -0700 Subject: stagefright: Remove additional deep-copy of encoder buffers MPEG4Writer makes a copy of encoded buffer to avoid holding on to the read buffer. This is not needed with MediaCodecSource, as the encoded-output buffer is already copied to a heap buffer. This saves a copy and some power. However, cloning the buffer is still needed for upstream sources that cannot afford to keep the buffers with writer up until they are released. So, pass a hint in buffer's metadata to indicate if it is OK to delay the release and not copy the buffer Change-Id: Ib59ac29ebc6ce4afd6fc272688a8260438ab1517 --- media/libavextensions/stagefright/AVExtensions.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'media/libavextensions') diff --git a/media/libavextensions/stagefright/AVExtensions.h b/media/libavextensions/stagefright/AVExtensions.h index 9c712e4..17ea475 100644 --- a/media/libavextensions/stagefright/AVExtensions.h +++ b/media/libavextensions/stagefright/AVExtensions.h @@ -161,6 +161,9 @@ struct AVUtils { virtual bool useQCHWEncoder(const sp &, AString &) { return false; } + virtual bool canDeferRelease(const sp &/*meta*/) { return false; } + virtual void setDeferRelease(sp &/*meta*/) {} + struct HEVCMuxer { virtual bool reassembleHEVCCSD(const AString &mime, sp csd0, sp &meta); -- cgit v1.1