From ba6218eae3dbcf3f962b3561b26374a214dbf5e2 Mon Sep 17 00:00:00 2001 From: Andy McFadden Date: Tue, 5 Mar 2013 14:31:02 -0800 Subject: Correct MediaCodec + Surface behavior Assorted tweaks: - Allow signalEndOfInputStream() before ACodec is in Executing state (added message to two more states). - Return an error if signalEndOfInputStream() is called a second time on the same stream. - Require AndroidOpaque color format in createInputSurface(). - Disallow dequeueInputBuffer() after an input surface has been created (boolean flag in MediaCodec tracks it). - Discard input surface when encoder is re-configure()ed (drop OMXNodeInstance's ref when we go back to Loaded). Bug 7991062 Change-Id: Iff30f3036e14eb5a2f6536910dcf11aba33031ee --- include/media/stagefright/ACodec.h | 3 +++ include/media/stagefright/MediaCodec.h | 2 ++ 2 files changed, 5 insertions(+) (limited to 'include/media') diff --git a/include/media/stagefright/ACodec.h b/include/media/stagefright/ACodec.h index 097ec5f..96baf34 100644 --- a/include/media/stagefright/ACodec.h +++ b/include/media/stagefright/ACodec.h @@ -281,6 +281,9 @@ private: status_t requestIDRFrame(); status_t setParameters(const sp ¶ms); + // Send EOS on input stream. + void onSignalEndOfInputStream(); + DISALLOW_EVIL_CONSTRUCTORS(ACodec); }; diff --git a/include/media/stagefright/MediaCodec.h b/include/media/stagefright/MediaCodec.h index ef695a7..35f46dc 100644 --- a/include/media/stagefright/MediaCodec.h +++ b/include/media/stagefright/MediaCodec.h @@ -212,6 +212,8 @@ private: sp mActivityNotify; + bool mHaveInputSurface; + MediaCodec(const sp &looper); static status_t PostAndAwaitResponse( -- cgit v1.1