Optionally repeat the previously submitted frame to the encoder

if no new frame has been delivered by surface flinger within the timeout
interval.

Change-Id: I282f1b726dfe5646b178d7858d6f5d4f5a264fde
diff --git a/include/media/IOMX.h b/include/media/IOMX.h
index 6d116f0..db9093a 100644
--- a/include/media/IOMX.h
+++ b/include/media/IOMX.h
@@ -137,6 +137,7 @@
 
     enum InternalOptionType {
         INTERNAL_OPTION_SUSPEND,  // data is a bool
+        INTERNAL_OPTION_REPEAT_PREVIOUS_FRAME_DELAY,  // data is an int64_t
     };
     virtual status_t setInternalOption(
             node_id node,
diff --git a/include/media/stagefright/ACodec.h b/include/media/stagefright/ACodec.h
index 6bf83dd..41542ec 100644
--- a/include/media/stagefright/ACodec.h
+++ b/include/media/stagefright/ACodec.h
@@ -199,6 +199,8 @@
     bool mStoreMetaDataInOutputBuffers;
     int32_t mMetaDataBuffersToSubmit;
 
+    int64_t mRepeatFrameDelayUs;
+
     status_t setCyclicIntraMacroblockRefresh(const sp<AMessage> &msg, int32_t mode);
     status_t allocateBuffersOnPort(OMX_U32 portIndex);
     status_t freeBuffersOnPort(OMX_U32 portIndex);