diff options
author | Wonsik Kim <wonsik@google.com> | 2021-04-13 04:54:57 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-04-13 04:54:57 +0000 |
commit | 369a920b5826b7ef94e6a0231b0dfd34f274c9cb (patch) | |
tree | 9335c1c215fe6f00b0d268a855d42d25a2667573 /media/java/android/media/MediaCodec.java | |
parent | ea3d717053dff00b73caef26b6a8fb4d31633900 (diff) | |
parent | 50f0fc71e3f1b078239b96f6e390d67782b07bba (diff) |
Merge "MediaCodec: minor revision of APIs for vendor parameters" am: 5d41bf1b65 am: 69814e45a1 am: 50f0fc71e3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1673760
Change-Id: I7050200724896046e042c310f6e5f3e6431759bb
Diffstat (limited to 'media/java/android/media/MediaCodec.java')
-rw-r--r-- | media/java/android/media/MediaCodec.java | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/media/java/android/media/MediaCodec.java b/media/java/android/media/MediaCodec.java index 4968bd1e0ce7..cc05ecd3f18e 100644 --- a/media/java/android/media/MediaCodec.java +++ b/media/java/android/media/MediaCodec.java @@ -4742,6 +4742,25 @@ final public class MediaCodec { return mType; } + @Override + public boolean equals(Object o) { + if (o == null) { + return false; + } + if (!(o instanceof ParameterDescriptor)) { + return false; + } + ParameterDescriptor other = (ParameterDescriptor) o; + return this.mName.equals(other.mName) && this.mType == other.mType; + } + + @Override + public int hashCode() { + return Arrays.asList( + (Object) mName, + (Object) Integer.valueOf(mType)).hashCode(); + } + private String mName; private @MediaFormat.Type int mType; } @@ -4766,7 +4785,8 @@ final public class MediaCodec { private native ParameterDescriptor native_getParameterDescriptor(@NonNull String name); /** - * Subscribe to vendor parameters, so that changes to these parameters generate + * Subscribe to vendor parameters, so that these parameters will be present in + * {@link #getOutputFormat} and changes to these parameters generate * output format change event. * <p> * Unrecognized parameter names or standard (non-vendor) parameter names will be ignored. @@ -4795,8 +4815,9 @@ final public class MediaCodec { private native void native_subscribeToVendorParameters(@NonNull List<String> names); /** - * Unsubscribe from vendor parameters, so that changes to these parameters - * no longer generate output format change event. + * Unsubscribe from vendor parameters, so that these parameters will not be present in + * {@link #getOutputFormat} and changes to these parameters no longer generate + * output format change event. * <p> * Unrecognized parameter names, standard (non-vendor) parameter names will be ignored. * {@link #reset} also resets the list of subscribed parameters. @@ -4804,7 +4825,8 @@ final public class MediaCodec { * <p> * This method can be called in any codec state except for released state. When called in * running state with newly unsubscribed parameters, it takes effect no later than the - * processing of the subsequently queued buffer. + * processing of the subsequently queued buffer. For the removed parameters, the codec will + * generate output format change event. * <p> * Note that any vendor parameters set in a {@link #configure} or * {@link #setParameters} call are automatically subscribed, and with this method |