|
6 | 6 | import javax.annotation.Nonnull; |
7 | 7 | import javax.annotation.Nullable; |
8 | 8 | import java.io.Serializable; |
| 9 | +import java.util.Locale; |
9 | 10 |
|
10 | 11 | import static org.schabi.newpipe.extractor.MediaFormat.M4A; |
11 | 12 | import static org.schabi.newpipe.extractor.MediaFormat.MPEG_4; |
@@ -198,6 +199,10 @@ public ItagItem(@Nonnull final ItagItem itagItem) { |
198 | 199 | this.targetDurationSec = itagItem.targetDurationSec; |
199 | 200 | this.approxDurationMs = itagItem.approxDurationMs; |
200 | 201 | this.contentLength = itagItem.contentLength; |
| 202 | + this.audioTrackId = itagItem.audioTrackId; |
| 203 | + this.audioTrackName = itagItem.audioTrackName; |
| 204 | + this.isDescriptiveAudio = itagItem.isDescriptiveAudio; |
| 205 | + this.audioLocale = itagItem.audioLocale; |
201 | 206 | } |
202 | 207 |
|
203 | 208 | public MediaFormat getMediaFormat() { |
@@ -246,6 +251,9 @@ public MediaFormat getMediaFormat() { |
246 | 251 | private long contentLength = CONTENT_LENGTH_UNKNOWN; |
247 | 252 | private String audioTrackId; |
248 | 253 | private String audioTrackName; |
| 254 | + private boolean isDescriptiveAudio; |
| 255 | + @Nullable |
| 256 | + private Locale audioLocale; |
249 | 257 |
|
250 | 258 | public int getBitrate() { |
251 | 259 | return bitrate; |
@@ -569,19 +577,61 @@ public void setAudioTrackId(@Nullable final String audioTrackId) { |
569 | 577 | /** |
570 | 578 | * Get the {@code audioTrackName} of the stream, if present. |
571 | 579 | * |
572 | | - * @return the {@code audioTrackName} of the stream or null |
| 580 | + * @return the {@code audioTrackName} of the stream or {@code null} |
573 | 581 | */ |
574 | 582 | @Nullable |
575 | 583 | public String getAudioTrackName() { |
576 | 584 | return audioTrackName; |
577 | 585 | } |
578 | 586 |
|
579 | 587 | /** |
580 | | - * Set the {@code audioTrackName} of the stream. |
| 588 | + * Set the {@code audioTrackName} of the stream, if present. |
581 | 589 | * |
582 | | - * @param audioTrackName the {@code audioTrackName} of the stream |
| 590 | + * @param audioTrackName the {@code audioTrackName} of the stream or {@code null} |
583 | 591 | */ |
584 | 592 | public void setAudioTrackName(@Nullable final String audioTrackName) { |
585 | 593 | this.audioTrackName = audioTrackName; |
586 | 594 | } |
| 595 | + |
| 596 | + /** |
| 597 | + * Return whether the stream is a descriptive audio. |
| 598 | + * |
| 599 | + * @return whether the stream is a descriptive audio |
| 600 | + */ |
| 601 | + public boolean isDescriptiveAudio() { |
| 602 | + return isDescriptiveAudio; |
| 603 | + } |
| 604 | + |
| 605 | + /** |
| 606 | + * Set whether the stream is a descriptive audio. |
| 607 | + * |
| 608 | + * @param isDescriptiveAudio whether the stream is a descriptive audio |
| 609 | + */ |
| 610 | + public void setIsDescriptiveAudio(final boolean isDescriptiveAudio) { |
| 611 | + this.isDescriptiveAudio = isDescriptiveAudio; |
| 612 | + } |
| 613 | + |
| 614 | + /** |
| 615 | + * Return the audio {@link Locale} of the stream, if known. |
| 616 | + * |
| 617 | + * @return the audio {@link Locale} of the stream, if known, or {@code null} if that's not the |
| 618 | + * case |
| 619 | + */ |
| 620 | + @Nullable |
| 621 | + public Locale getAudioLocale() { |
| 622 | + return audioLocale; |
| 623 | + } |
| 624 | + |
| 625 | + /** |
| 626 | + * Set the audio {@link Locale} of the stream. |
| 627 | + * |
| 628 | + * <p> |
| 629 | + * If it is unknown, {@code null} could be passed, which is the default value. |
| 630 | + * </p> |
| 631 | + * |
| 632 | + * @param audioLocale the audio {@link Locale} of the stream, which could be {@code null} |
| 633 | + */ |
| 634 | + public void setAudioLocale(@Nullable final Locale audioLocale) { |
| 635 | + this.audioLocale = audioLocale; |
| 636 | + } |
587 | 637 | } |
0 commit comments