|
1 | 1 | package org.schabi.newpipe.extractor.stream; |
2 | 2 |
|
| 3 | +/** |
| 4 | + * An enum representing the stream types of stream contents returned by the extractor. |
| 5 | + */ |
3 | 6 | public enum StreamType { |
4 | | - NONE, // placeholder to check if stream type was checked or not |
| 7 | + |
| 8 | + /** |
| 9 | + * Placeholder to check if the stream type of stream content was checked or not. |
| 10 | + * |
| 11 | + * <p> |
| 12 | + * It doesn't make sense to use this enum constant outside of the extractor as it will never be |
| 13 | + * returned by an {@link org.schabi.newpipe.extractor.Extractor extractor} and is only used |
| 14 | + * internally. |
| 15 | + * </p> |
| 16 | + */ |
| 17 | + NONE, |
| 18 | + |
| 19 | + /** |
| 20 | + * Enum constant to indicate that the stream type of stream content is a video. |
| 21 | + * |
| 22 | + * <p> |
| 23 | + * Note that contents <strong>can contain audio streams</strong> even if they also contain |
| 24 | + * video streams (video-only or video with audio, depending of the stream/the content/the |
| 25 | + * service). |
| 26 | + * </p> |
| 27 | + */ |
5 | 28 | VIDEO_STREAM, |
| 29 | + |
| 30 | + /** |
| 31 | + * Enum constant to indicate that the stream type of stream content is an audio. |
| 32 | + * |
| 33 | + * <p> |
| 34 | + * Note that contents returned as audio streams should not return video streams. |
| 35 | + * </p> |
| 36 | + * |
| 37 | + * <p> |
| 38 | + * So, in order to prevent unexpected behaviors, stream extractors which are returning this |
| 39 | + * stream type for a content should ensure that no video stream is returned for this content. |
| 40 | + * </p> |
| 41 | + */ |
6 | 42 | AUDIO_STREAM, |
| 43 | + |
| 44 | + /** |
| 45 | + * Enum constant to indicate that the stream type of stream content is a video. |
| 46 | + * |
| 47 | + * <p> |
| 48 | + * Note that contents <strong>can contain audio live streams</strong> even if they also contain |
| 49 | + * live video streams (video-only or video with audio, depending of the stream/the content/the |
| 50 | + * service). |
| 51 | + * </p> |
| 52 | + */ |
7 | 53 | LIVE_STREAM, |
| 54 | + |
| 55 | + /** |
| 56 | + * Enum constant to indicate that the stream type of stream content is a live audio content. |
| 57 | + * |
| 58 | + * <p> |
| 59 | + * Note that contents returned as live audio streams should not return live video streams. |
| 60 | + * </p> |
| 61 | + * |
| 62 | + * <p> |
| 63 | + * So, in order to prevent unexpected behaviors, stream extractors which are returning this |
| 64 | + * stream type for a content should ensure that no live video stream is returned for this |
| 65 | + * content. |
| 66 | + * </p> |
| 67 | + */ |
8 | 68 | AUDIO_LIVE_STREAM, |
| 69 | + |
| 70 | + /** |
| 71 | + * Enum constant to indicate that the stream type of stream content is a video content of an |
| 72 | + * ended live video stream. |
| 73 | + * |
| 74 | + * <p> |
| 75 | + * Note that most of ended live video (or audio) contents may be extracted as |
| 76 | + * {@link #VIDEO_STREAM regular video contents} (or |
| 77 | + * {@link #AUDIO_STREAM regular audio contents}) later, because the service may encode them |
| 78 | + * again later as normal video/audio streams. That's the case for example on YouTube. |
| 79 | + * </p> |
| 80 | + * |
| 81 | + * <p> |
| 82 | + * Note that contents <strong>can contain post-live audio streams</strong> even if they also |
| 83 | + * contain post-live video streams (video-only or video with audio, depending of the stream/the |
| 84 | + * content/the service). |
| 85 | + * </p> |
| 86 | + */ |
| 87 | + POST_LIVE_STREAM, |
| 88 | + |
| 89 | + /** |
| 90 | + * Enum constant to indicate that the stream type of stream content is an audio content of an |
| 91 | + * ended live audio stream. |
| 92 | + * |
| 93 | + * <p> |
| 94 | + * Note that most of ended live audio streams extracted with this value are processed as |
| 95 | + * {@link #AUDIO_STREAM regular audio streams} later, because the service may encode them |
| 96 | + * again later. |
| 97 | + * </p> |
| 98 | + * |
| 99 | + * <p> |
| 100 | + * Contents returned as post-live audio streams should not return post-live video streams. |
| 101 | + * </p> |
| 102 | + * |
| 103 | + * <p> |
| 104 | + * So, in order to prevent unexpected behaviors, stream extractors which are returning this |
| 105 | + * stream type for a content should ensure that no post-live video stream is returned for this |
| 106 | + * content. |
| 107 | + * </p> |
| 108 | + */ |
| 109 | + POST_LIVE_AUDIO_STREAM, |
| 110 | + |
| 111 | + /** |
| 112 | + * Enum constant to indicate that the stream type of stream content is a file. |
| 113 | + */ |
9 | 114 | FILE |
10 | 115 | } |
0 commit comments