Skip to content

Commit

Permalink
Removed unused equalsStream
Browse files Browse the repository at this point in the history
  • Loading branch information
litetex committed Jun 20, 2022
1 parent 665ee1e commit fd52219
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,9 @@

import org.schabi.newpipe.extractor.streamdata.format.AudioMediaFormat;

import java.util.Objects;

import javax.annotation.Nullable;

/**
* Represents a audio (only) stream.
*/
public interface AudioStream extends Stream<AudioMediaFormat>, BaseAudioStream {

@Override
default boolean equalsStream(@Nullable final Stream other) {
if (!(other instanceof AudioStream)) {
return false;
}

final AudioStream otherAudioStream = (AudioStream) other;
return Objects.equals(mediaFormat(), otherAudioStream.mediaFormat())
&& averageBitrate() == otherAudioStream.averageBitrate();
}
// Nothing
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import org.schabi.newpipe.extractor.streamdata.format.MediaFormat;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

public interface Stream<M extends MediaFormat> {

Expand All @@ -18,8 +17,4 @@ public interface Stream<M extends MediaFormat> {

@Nonnull
DeliveryData deliveryData();


// TODO: May also have to check deliverydata
boolean equalsStream(@Nullable Stream other);
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
import org.schabi.newpipe.extractor.streamdata.format.SubtitleMediaFormat;

import java.util.Locale;
import java.util.Objects;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

/**
* Represents a subtitle (only) stream.
Expand Down Expand Up @@ -42,16 +40,4 @@ default boolean autoGenerated() {
* @return the {@link Locale locale} of the subtitles
*/
Locale locale();

@Override
default boolean equalsStream(@Nullable final Stream other) {
if (!(other instanceof SubtitleStream)) {
return false;
}

final SubtitleStream otherSubtitleStream = (SubtitleStream) other;
return Objects.equals(mediaFormat(), otherSubtitleStream.mediaFormat())
&& autoGenerated() == otherSubtitleStream.autoGenerated()
&& Objects.equals(languageCode(), otherSubtitleStream.languageCode());
}
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
package org.schabi.newpipe.extractor.streamdata.stream;

import javax.annotation.Nullable;

/**
* Represents a combined video+audio stream.
*/
public interface VideoAudioStream extends VideoStream, BaseAudioStream {
@Override
default boolean equalsStream(@Nullable final Stream other) {
if (!(other instanceof VideoAudioStream)) {
return false;
}

return VideoStream.super.equalsStream(other) && BaseAudioStream.super.equalsStream(other);
}
// Nothing
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,12 @@
import org.schabi.newpipe.extractor.streamdata.format.VideoAudioMediaFormat;
import org.schabi.newpipe.extractor.streamdata.stream.quality.VideoQualityData;

import java.util.Objects;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

/**
* Represents a video (only) stream.
*/
public interface VideoStream extends Stream<VideoAudioMediaFormat> {
@Nonnull
VideoQualityData videoQualityData();

@Override
default boolean equalsStream(@Nullable final Stream other) {
if (!(other instanceof VideoStream)) {
return false;
}

final VideoStream otherVideoStream = (VideoStream) other;
return Objects.equals(mediaFormat(), otherVideoStream.mediaFormat())
&& videoQualityData().equalsVideoQualityData(otherVideoStream.videoQualityData());
}
}

0 comments on commit fd52219

Please sign in to comment.