File tree Expand file tree Collapse file tree 6 files changed +2
-69
lines changed
extractor/src/main/java/org/schabi/newpipe/extractor/streamdata/stream Expand file tree Collapse file tree 6 files changed +2
-69
lines changed Original file line number Diff line number Diff line change 22
33import org .schabi .newpipe .extractor .streamdata .format .AudioMediaFormat ;
44
5- import java .util .Objects ;
6-
7- import javax .annotation .Nullable ;
8-
95/**
106 * Represents a audio (only) stream.
117 */
128public interface AudioStream extends Stream <AudioMediaFormat >, BaseAudioStream {
13-
14- @ Override
15- default boolean equalsStream (@ Nullable final Stream other ) {
16- if (!(other instanceof AudioStream )) {
17- return false ;
18- }
19-
20- final AudioStream otherAudioStream = (AudioStream ) other ;
21- return Objects .equals (mediaFormat (), otherAudioStream .mediaFormat ())
22- && averageBitrate () == otherAudioStream .averageBitrate ();
23- }
9+ // Nothing
2410}
Original file line number Diff line number Diff line change 11package org .schabi .newpipe .extractor .streamdata .stream ;
22
3- import javax .annotation .Nullable ;
4-
53public interface BaseAudioStream {
64 int UNKNOWN_AVG_BITRATE = -1 ;
75
@@ -13,13 +11,4 @@ public interface BaseAudioStream {
1311 default int averageBitrate () {
1412 return UNKNOWN_AVG_BITRATE ;
1513 }
16-
17- default boolean equalsStream (@ Nullable final Stream other ) {
18- if (!(other instanceof BaseAudioStream )) {
19- return false ;
20- }
21-
22- final BaseAudioStream otherAudioStream = (BaseAudioStream ) other ;
23- return averageBitrate () == otherAudioStream .averageBitrate ();
24- }
2514}
Original file line number Diff line number Diff line change 44import org .schabi .newpipe .extractor .streamdata .format .MediaFormat ;
55
66import javax .annotation .Nonnull ;
7- import javax .annotation .Nullable ;
87
98public interface Stream <M extends MediaFormat > {
109
@@ -18,8 +17,4 @@ public interface Stream<M extends MediaFormat> {
1817
1918 @ Nonnull
2019 DeliveryData deliveryData ();
21-
22-
23- // TODO: May also have to check deliverydata
24- boolean equalsStream (@ Nullable Stream other );
2520}
Original file line number Diff line number Diff line change 33import org .schabi .newpipe .extractor .streamdata .format .SubtitleMediaFormat ;
44
55import java .util .Locale ;
6- import java .util .Objects ;
76
87import javax .annotation .Nonnull ;
9- import javax .annotation .Nullable ;
108
119/**
1210 * Represents a subtitle (only) stream.
@@ -42,16 +40,4 @@ default boolean autoGenerated() {
4240 * @return the {@link Locale locale} of the subtitles
4341 */
4442 Locale locale ();
45-
46- @ Override
47- default boolean equalsStream (@ Nullable final Stream other ) {
48- if (!(other instanceof SubtitleStream )) {
49- return false ;
50- }
51-
52- final SubtitleStream otherSubtitleStream = (SubtitleStream ) other ;
53- return Objects .equals (mediaFormat (), otherSubtitleStream .mediaFormat ())
54- && autoGenerated () == otherSubtitleStream .autoGenerated ()
55- && Objects .equals (languageCode (), otherSubtitleStream .languageCode ());
56- }
5743}
Original file line number Diff line number Diff line change 11package org .schabi .newpipe .extractor .streamdata .stream ;
22
3- import javax .annotation .Nullable ;
4-
53/**
64 * Represents a combined video+audio stream.
75 */
86public interface VideoAudioStream extends VideoStream , BaseAudioStream {
9- @ Override
10- default boolean equalsStream (@ Nullable final Stream other ) {
11- if (!(other instanceof VideoAudioStream )) {
12- return false ;
13- }
14-
15- return VideoStream .super .equalsStream (other ) && BaseAudioStream .super .equalsStream (other );
16- }
7+ // Nothing
178}
Original file line number Diff line number Diff line change 33import org .schabi .newpipe .extractor .streamdata .format .VideoAudioMediaFormat ;
44import org .schabi .newpipe .extractor .streamdata .stream .quality .VideoQualityData ;
55
6- import java .util .Objects ;
7-
86import javax .annotation .Nonnull ;
9- import javax .annotation .Nullable ;
107
118/**
129 * Represents a video (only) stream.
1310 */
1411public interface VideoStream extends Stream <VideoAudioMediaFormat > {
1512 @ Nonnull
1613 VideoQualityData videoQualityData ();
17-
18- @ Override
19- default boolean equalsStream (@ Nullable final Stream other ) {
20- if (!(other instanceof VideoStream )) {
21- return false ;
22- }
23-
24- final VideoStream otherVideoStream = (VideoStream ) other ;
25- return Objects .equals (mediaFormat (), otherVideoStream .mediaFormat ())
26- && videoQualityData ().equalsVideoQualityData (otherVideoStream .videoQualityData ());
27- }
2814}
You can’t perform that action at this time.
0 commit comments