@@ -30,7 +30,7 @@ public class AudioStream extends Stream {
3030 public static final int UNKNOWN_BITRATE = -1 ;
3131
3232 private final int averageBitrate ;
33- // Fields for Dash
33+ // Fields for DASH
3434 private int itag ;
3535 private int bitrate ;
3636 private int initStart ;
@@ -41,10 +41,14 @@ public class AudioStream extends Stream {
4141 private String codec ;
4242
4343 /**
44- * Create a new audio stream
45- * @param url the url
46- * @param format the format
47- * @param averageBitrate the average bitrate
44+ * Create a new audio stream.
45+ *
46+ * @param id the ID which uniquely identifies the stream, e.g. for YouTube this
47+ * would be the itag
48+ * @param url the URL of the stream
49+ * @param format the {@link MediaFormat} used by the stream
50+ * @param averageBitrate the average bitrate of the stream (which can be unknown, see
51+ * {@link #UNKNOWN_BITRATE})
4852 */
4953 public AudioStream (final String id ,
5054 final String url ,
@@ -54,13 +58,18 @@ public AudioStream(final String id,
5458 }
5559
5660 /**
57- * Create a new audio stream
58- * @param id the ID which uniquely identifies the file, e.g. for YouTube this would be the itag
59- * @param content the content or URL, depending on whether isUrl is true
60- * @param isUrl whether content is the URL or the actual content of e.g. a DASH manifest
61- * @param format the format
62- * @param deliveryMethod the delivery method
63- * @param averageBitrate the average bitrate
61+ * Create a new audio stream.
62+ *
63+ * @param id the ID which uniquely identifies the stream, e.g. for YouTube this
64+ * would be the itag
65+ * @param content the content or the URL of the stream, depending on whether isUrl is
66+ * true
67+ * @param isUrl whether content is the URL or the actual content of e.g. a DASH
68+ * manifest
69+ * @param format the {@link MediaFormat} used by the stream
70+ * @param deliveryMethod the {@link DeliveryMethod} of the stream
71+ * @param averageBitrate the average bitrate of the stream (which can be unknown, see
72+ * {@link #UNKNOWN_BITRATE})
6473 */
6574 public AudioStream (final String id ,
6675 final String content ,
@@ -72,6 +81,23 @@ public AudioStream(final String id,
7281 this .averageBitrate = averageBitrate ;
7382 }
7483
84+ /**
85+ * Create a new audio stream.
86+ *
87+ * @param id the ID which uniquely identifies the stream, e.g. for YouTube this
88+ * would be the itag
89+ * @param content the content or the URL of the stream, depending on whether isUrl is
90+ * true
91+ * @param isUrl whether content is the URL or the actual content of e.g. a DASH
92+ * manifest
93+ * @param format the {@link MediaFormat} used by the stream
94+ * @param deliveryMethod the {@link DeliveryMethod} of the stream
95+ * @param averageBitrate the average bitrate of the stream (which can be unknown, see
96+ * {@link #UNKNOWN_BITRATE})
97+ * @param itag the {@link ItagItem} corresponding to the stream, which cannot be null
98+ * @param baseUrl the base URL of the stream (see {@link Stream#getBaseUrl()} for more
99+ * information)
100+ */
75101 public AudioStream (final String id ,
76102 final String content ,
77103 final boolean isUrl ,
@@ -92,7 +118,20 @@ public AudioStream(final String id,
92118 this .averageBitrate = averageBitrate ;
93119 }
94120
95- public AudioStream (final String id , final String url , @ Nonnull final ItagItem itag ) {
121+ /**
122+ * Create a new audio stream.
123+ * <p>
124+ * The average bitrate will be set by using {@link ItagItem#avgBitrate}.
125+ * </p>
126+ *
127+ * @param id the ID which uniquely identifies the stream, e.g. for YouTube this
128+ * would be the itag
129+ * @param url the URL of the stream
130+ * @param itag the {@link ItagItem} corresponding to the stream, which cannot be null
131+ */
132+ public AudioStream (final String id ,
133+ final String url ,
134+ @ Nonnull final ItagItem itag ) {
96135 this (id , url , itag .getMediaFormat (), itag .avgBitrate );
97136 this .itag = itag .id ;
98137 this .quality = itag .getQuality ();
@@ -104,48 +143,98 @@ public AudioStream(final String id, final String url, @Nonnull final ItagItem it
104143 this .codec = itag .getCodec ();
105144 }
106145
146+ /**
147+ * {@inheritDoc}
148+ */
107149 @ Override
108150 public boolean equalStats (final Stream cmp ) {
109151 return super .equalStats (cmp ) && cmp instanceof AudioStream
110152 && averageBitrate == ((AudioStream ) cmp ).averageBitrate ;
111153 }
112154
113155 /**
114- * Get the average bitrate.
156+ * Get the average bitrate of the stream.
157+ *
115158 * @return the average bitrate or {@link #UNKNOWN_BITRATE} if it is unknown
116159 */
117160 public int getAverageBitrate () {
118161 return averageBitrate ;
119162 }
120163
164+ /**
165+ * Get the itag of the stream.
166+ *
167+ * @return the number of the {@link ItagItem} passed in the constructor of the stream.
168+ */
121169 public int getItag () {
122170 return itag ;
123171 }
124172
173+ /**
174+ * Get the bitrate of the stream.
175+ *
176+ * @return the bitrate set from the {@link ItagItem} passed in the constructor of the stream.
177+ */
125178 public int getBitrate () {
126179 return bitrate ;
127180 }
128181
182+ /**
183+ * Get the initialization start of the stream.
184+ *
185+ * @return the initialization start value set from the {@link ItagItem} passed in the
186+ * constructor of the
187+ * stream.
188+ */
129189 public int getInitStart () {
130190 return initStart ;
131191 }
132192
193+ /**
194+ * Get the initialization end of the stream.
195+ *
196+ * @return the initialization end value set from the {@link ItagItem} passed in the constructor
197+ * of the stream.
198+ */
133199 public int getInitEnd () {
134200 return initEnd ;
135201 }
136202
203+ /**
204+ * Get the index start of the stream.
205+ *
206+ * @return the index start value set from the {@link ItagItem} passed in the constructor of the
207+ * stream.
208+ */
137209 public int getIndexStart () {
138210 return indexStart ;
139211 }
140212
213+ /**
214+ * Get the index end of the stream.
215+ *
216+ * @return the index end value set from the {@link ItagItem} passed in the constructor of the
217+ * stream.
218+ */
141219 public int getIndexEnd () {
142220 return indexEnd ;
143221 }
144222
223+ /**
224+ * Get the quality of the stream.
225+ *
226+ * @return the quality label set from the {@link ItagItem} passed in the constructor of the
227+ * stream.
228+ */
145229 public String getQuality () {
146230 return quality ;
147231 }
148232
233+ /**
234+ * Get the codec of the stream.
235+ *
236+ * @return the codec set from the {@link ItagItem} passed in the constructor of the stream.
237+ */
149238 public String getCodec () {
150239 return codec ;
151240 }
0 commit comments