summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--api/current.txt5
-rw-r--r--media/java/android/media/MediaCodec.java32
2 files changed, 30 insertions, 7 deletions
diff --git a/api/current.txt b/api/current.txt
index 92e8b24..ab287fb 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -14195,7 +14195,6 @@ package android.media {
method public final void release();
method public final void releaseOutputBuffer(int, boolean);
method public final void releaseOutputBuffer(int, long);
- method public void setNotificationCallback(android.media.MediaCodec.NotificationCallback);
method public final void setParameters(android.os.Bundle);
method public final void setVideoScalingMode(int);
method public final void signalEndOfInputStream();
@@ -14245,10 +14244,6 @@ package android.media {
field public int numSubSamples;
}
- public static abstract interface MediaCodec.NotificationCallback {
- method public abstract void onCodecNotify(android.media.MediaCodec);
- }
-
public final class MediaCodecInfo {
method public final android.media.MediaCodecInfo.CodecCapabilities getCapabilitiesForType(java.lang.String);
method public final java.lang.String getName();
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(