Add AMediaCodec callback
Change-Id: I33b7ff3bcdcff6d3a5e1db385b900ae18b7e0f03
diff --git a/include/ndk/NdkMediaCodec.h b/include/ndk/NdkMediaCodec.h
index 2af88d0b..c35c6b3 100644
--- a/include/ndk/NdkMediaCodec.h
+++ b/include/ndk/NdkMediaCodec.h
@@ -55,7 +55,6 @@
AMEDIACODEC_INFO_TRY_AGAIN_LATER = -1
};
-
/**
* Create codec by name. Use this if you know the exact codec you want to use.
* When configuring, you will need to specify whether to use the codec as an
@@ -140,6 +139,17 @@
+typedef void (*OnCodecEvent)(AMediaCodec *codec, void *userdata);
+
+/**
+ * Set a callback to be called when a new buffer is available, or there was a format
+ * or buffer change.
+ * Note that you cannot perform any operations on the mediacodec from within the callback.
+ * If you need to perform mediacodec operations, you must do so on a different thread.
+ */
+int AMediaCodec_setNotificationCallback(AMediaCodec*, OnCodecEvent callback, void *userdata);
+
+
#ifdef __cplusplus
} // extern "C"
#endif