summaryrefslogtreecommitdiffstats
path: root/include/ndk/NdkMediaCodec.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/ndk/NdkMediaCodec.h')
-rw-r--r--include/ndk/NdkMediaCodec.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/include/ndk/NdkMediaCodec.h b/include/ndk/NdkMediaCodec.h
index 2af88d0..c35c6b3 100644
--- a/include/ndk/NdkMediaCodec.h
+++ b/include/ndk/NdkMediaCodec.h
@@ -55,7 +55,6 @@ enum {
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 @@ int AMediaCodec_releaseOutputBuffer(AMediaCodec*, size_t idx, bool render);
+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