From 6507d14c6d10f93d390de62b9eed267f9b544985 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 --- media/libstagefright/omx/GraphicBufferSource.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'media/libstagefright/omx/GraphicBufferSource.h') diff --git a/media/libstagefright/omx/GraphicBufferSource.h b/media/libstagefright/omx/GraphicBufferSource.h index 6d49f96..6a34bc5 100644 --- a/media/libstagefright/omx/GraphicBufferSource.h +++ b/media/libstagefright/omx/GraphicBufferSource.h @@ -67,10 +67,9 @@ public: // sitting in the BufferQueue, this will send them to the codec. void omxExecuting(); - // This is called when OMX transitions to OMX_StateIdle. If we were - // previously executing, this means we're about to be shut down. (We - // also enter Idle on the way up.) - void omxIdling(); + // This is called when OMX transitions to OMX_StateLoaded, indicating that + // we are shutting down. + void omxLoaded(); // A "codec buffer", i.e. a buffer that can be used to pass data into // the encoder, has been allocated. (This call does not call back into @@ -84,7 +83,7 @@ public: // This is called after the last input frame has been submitted. We // need to submit an empty buffer with the EOS flag set. If we don't // have a codec buffer ready, we just set the mEndOfStream flag. - void signalEndOfInputStream(); + status_t signalEndOfInputStream(); protected: // BufferQueue::ConsumerListener interface, called when a new frame of -- cgit v1.1