mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Add AudioProcessor.AudioFormat equals method.
PiperOrigin-RevId: 483983486
(cherry picked from commit c9585d0154)
This commit is contained in:
parent
81b3e4040d
commit
861cd9a00e
1 changed files with 21 additions and 0 deletions
|
|
@ -15,9 +15,11 @@
|
||||||
*/
|
*/
|
||||||
package androidx.media3.common.audio;
|
package androidx.media3.common.audio;
|
||||||
|
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
import com.google.android.exoplayer2.C;
|
import com.google.android.exoplayer2.C;
|
||||||
import com.google.android.exoplayer2.Format;
|
import com.google.android.exoplayer2.Format;
|
||||||
import com.google.android.exoplayer2.util.Util;
|
import com.google.android.exoplayer2.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;
|
||||||
|
|
@ -69,6 +71,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…
Reference in a new issue