summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorLajos Molnar <lajos@google.com>2014-05-30 23:14:55 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-05-30 23:14:55 +0000
commita6716aade1d7bf0a60457d80da6aa85bc1006f57 (patch)
tree5b1277d72f70a5a4f6c4ef82b11257fd30ee0a4e /media
parent283c907a6a84c5d9ffe38d3468e76131e6917105 (diff)
parent8c5d0f2120d2006aa2115105b7c6dbf0b86058ae (diff)
downloadframeworks_base-a6716aade1d7bf0a60457d80da6aa85bc1006f57.zip
frameworks_base-a6716aade1d7bf0a60457d80da6aa85bc1006f57.tar.gz
frameworks_base-a6716aade1d7bf0a60457d80da6aa85bc1006f57.tar.bz2
Merge changes I1fd178b6,I5093672e into lmp-preview-dev
* changes: DO NOT MERGE: media.MediaCodec: hide NotificationCallback listener media.MediaCodec: document and fix-up setNotificationCallback
Diffstat (limited to 'media')
-rw-r--r--media/java/android/media/MediaCodec.java32
1 files changed, 30 insertions, 2 deletions
diff --git a/media/java/android/media/MediaCodec.java b/media/java/android/media/MediaCodec.java
index c7b3fc9..f258063 100644
--- a/media/java/android/media/MediaCodec.java
+++ b/media/java/android/media/MediaCodec.java
@@ -744,12 +744,40 @@ final public class MediaCodec {
setParameters(keys, values);
}
+ /**
+ * Sets the codec listener for actionable MediaCodec events.
+ * <p>Call this method with a null listener to stop receiving event notifications.
+ *
+ * @param cb The listener that will run.
+ *
+ * @hide
+ */
public void setNotificationCallback(NotificationCallback cb) {
mNotificationCallback = cb;
}
- public interface NotificationCallback {
- void onCodecNotify(MediaCodec codec);
+ /**
+ * MediaCodec listener interface. Used to notify the user of MediaCodec
+ * when there are available input and/or output buffers, a change in
+ * configuration or when a codec error happened.
+ *
+ * @hide
+ */
+ public static abstract class NotificationCallback {
+ /**
+ * Called on the listener to notify that there is an actionable
+ * MediaCodec event. The application should call {@link #dequeueOutputBuffer}
+ * to receive the configuration change event, codec error or an
+ * available output buffer. It should also call {@link #dequeueInputBuffer}
+ * to receive any available input buffer. For best performance, it
+ * is recommended to exhaust both available input and output buffers in
+ * the handling of a single callback, by calling the dequeue methods
+ * repeatedly with a zero timeout until {@link #INFO_TRY_AGAIN_LATER} is returned.
+ *
+ * @param codec the MediaCodec instance that has an actionable event.
+ *
+ */
+ public abstract void onCodecNotify(MediaCodec codec);
}
private void postEventFromNative(