Add AudioProcessor.AudioFormat equals method.
PiperOrigin-RevId: 483983486
This commit is contained in:
parent
f1ca4f41b1
commit
e6079c38f2
@ -15,10 +15,12 @@
|
|||||||
*/
|
*/
|
||||||
package androidx.media3.common.audio;
|
package androidx.media3.common.audio;
|
||||||
|
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
import androidx.media3.common.C;
|
import androidx.media3.common.C;
|
||||||
import androidx.media3.common.Format;
|
import androidx.media3.common.Format;
|
||||||
import androidx.media3.common.util.UnstableApi;
|
import androidx.media3.common.util.UnstableApi;
|
||||||
import androidx.media3.common.util.Util;
|
import androidx.media3.common.util.Util;
|
||||||
|
import com.google.common.base.Objects;
|
||||||
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
import com.google.errorprone.annotations.CanIgnoreReturnValue;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
import java.nio.ByteOrder;
|
import java.nio.ByteOrder;
|
||||||
@ -71,6 +73,25 @@ public interface AudioProcessor {
|
|||||||
+ encoding
|
+ encoding
|
||||||
+ ']';
|
+ ']';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(@Nullable Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (!(o instanceof AudioFormat)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
AudioFormat that = (AudioFormat) o;
|
||||||
|
return sampleRate == that.sampleRate
|
||||||
|
&& channelCount == that.channelCount
|
||||||
|
&& encoding == that.encoding;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Objects.hashCode(sampleRate, channelCount, encoding);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Exception thrown when a processor can't be configured for a given input audio format. */
|
/** Exception thrown when a processor can't be configured for a given input audio format. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user