From acfcf645ffb611bbb436aa0249658630c5cb5df2 Mon Sep 17 00:00:00 2001 From: Lajos Molnar Date: Wed, 21 May 2014 15:29:35 -0700 Subject: media.MediaCodec: document and fix-up setNotificationCallback change from interface to abstrace class Bug: 15091403 Change-Id: I5093672e36681670934a5ebaa49484441af5bcdd --- media/java/android/media/MediaCodec.java | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'media') diff --git a/media/java/android/media/MediaCodec.java b/media/java/android/media/MediaCodec.java index c7b3fc9..cb9d4d5 100644 --- a/media/java/android/media/MediaCodec.java +++ b/media/java/android/media/MediaCodec.java @@ -744,12 +744,35 @@ final public class MediaCodec { setParameters(keys, values); } + /** + * Sets the codec listener for actionable MediaCodec events. + *

Call this method with a null listener to stop receiving event notifications. + * + * @param cb The listener that will run. + */ 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. + */ + 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( -- cgit v1.1 From 8c5d0f2120d2006aa2115105b7c6dbf0b86058ae Mon Sep 17 00:00:00 2001 From: Lajos Molnar Date: Wed, 28 May 2014 19:10:48 -0700 Subject: DO NOT MERGE: media.MediaCodec: hide NotificationCallback listener Bug: 15091403 Change-Id: I1fd178b6872997055c2ee0b7edfa0264a7d6718b --- media/java/android/media/MediaCodec.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'media') diff --git a/media/java/android/media/MediaCodec.java b/media/java/android/media/MediaCodec.java index cb9d4d5..f258063 100644 --- a/media/java/android/media/MediaCodec.java +++ b/media/java/android/media/MediaCodec.java @@ -749,6 +749,8 @@ final public class MediaCodec { *

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; @@ -758,6 +760,8 @@ final public class MediaCodec { * 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 { /** @@ -771,6 +775,7 @@ final public class MediaCodec { * 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); } -- cgit v1.1