|
53 | 53 | *
|
54 | 54 | * @param <T> A concrete class that extends from the AbstractFFmpegStreamBuilder
|
55 | 55 | */
|
| 56 | +@SuppressWarnings({"DeprecatedIsStillUsed"}) |
56 | 57 | public abstract class AbstractFFmpegStreamBuilder<T extends AbstractFFmpegStreamBuilder<T>> {
|
57 | 58 |
|
58 | 59 | private static final String DEVNULL = SystemUtils.IS_OS_WINDOWS ? "NUL" : "/dev/null";
|
59 | 60 |
|
60 |
| - final FFmpegBuilder parent; |
| 61 | + protected final FFmpegBuilder parent; |
61 | 62 |
|
62 |
| - /** Output filename or uri. Only one may be set */ |
| 63 | + /* Output filename or uri. Only one may be set */ |
| 64 | + /** @deprecated Use {@link #getFilename()} instead */ |
| 65 | + @Deprecated |
63 | 66 | public String filename;
|
64 | 67 |
|
| 68 | + /** @deprecated Use {@link #getUri()} instead */ |
| 69 | + @Deprecated |
65 | 70 | public URI uri;
|
66 | 71 |
|
| 72 | + /** @deprecated Use {@link #getFormat()} instead */ |
| 73 | + @Deprecated |
67 | 74 | public String format;
|
68 | 75 |
|
| 76 | + /** @deprecated Use {@link #getStartOffset()} instead */ |
| 77 | + @Deprecated |
69 | 78 | public Long startOffset; // in milliseconds
|
| 79 | + /** @deprecated Use {@link #getDuration()} instead */ |
| 80 | + @Deprecated |
70 | 81 | public Long duration; // in milliseconds
|
71 | 82 |
|
| 83 | + /** @deprecated Use {@link #getMetaTags()} instead */ |
| 84 | + @Deprecated |
72 | 85 | public final List<String> meta_tags = new ArrayList<>();
|
73 | 86 |
|
| 87 | + /** @deprecated Use {@link #isAudioEnabled()} instead */ |
| 88 | + @Deprecated |
74 | 89 | public boolean audio_enabled = true;
|
| 90 | + /** @deprecated Use {@link #getAudioCodec()} instead */ |
| 91 | + @Deprecated |
75 | 92 | public String audio_codec;
|
| 93 | + /** @deprecated Use {@link #getAudioChannels()} instead */ |
| 94 | + @Deprecated |
76 | 95 | public int audio_channels;
|
| 96 | + /** @deprecated Use {@link #getAudioSampleRate()} instead */ |
| 97 | + @Deprecated |
77 | 98 | public int audio_sample_rate;
|
| 99 | + /** @deprecated Use {@link #getAudioPreset()} instead */ |
| 100 | + @Deprecated |
78 | 101 | public String audio_preset;
|
79 | 102 |
|
| 103 | + /** @deprecated Use {@link #isVideoEnabled()} instead */ |
| 104 | + @Deprecated |
80 | 105 | public boolean video_enabled = true;
|
| 106 | + /** @deprecated Use {@link #getVideoCodec()} instead */ |
| 107 | + @Deprecated |
81 | 108 | public String video_codec;
|
| 109 | + /** @deprecated Use {@link #isVideoCopyinkf()} instead */ |
| 110 | + @Deprecated |
82 | 111 | public boolean video_copyinkf;
|
| 112 | + /** @deprecated Use {@link #getVideoFrameRate()} instead */ |
| 113 | + @Deprecated |
83 | 114 | public Fraction video_frame_rate;
|
| 115 | + /** @deprecated Use {@link #getVideoWidth()} instead */ |
| 116 | + @Deprecated |
84 | 117 | public int video_width;
|
| 118 | + /** @deprecated Use {@link #getVideoHeight()} instead */ |
| 119 | + @Deprecated |
85 | 120 | public int video_height;
|
| 121 | + /** @deprecated Use {@link #getVideoSize()} instead */ |
| 122 | + @Deprecated |
86 | 123 | public String video_size;
|
| 124 | + /** @deprecated Use {@link #getVideoMovflags()} instead */ |
| 125 | + @Deprecated |
87 | 126 | public String video_movflags;
|
| 127 | + /** @deprecated Use {@link #getVideoFrames()} instead */ |
| 128 | + @Deprecated |
88 | 129 | public Integer video_frames;
|
| 130 | + /** @deprecated Use {@link #getVideoPixelFormat()} instead */ |
| 131 | + @Deprecated |
89 | 132 | public String video_pixel_format;
|
90 | 133 |
|
| 134 | + /** @deprecated Use {@link #isSubtitleEnabled()} instead */ |
| 135 | + @Deprecated |
91 | 136 | public boolean subtitle_enabled = true;
|
| 137 | + /** @deprecated Use {@link #getSubtitlePreset()} instead */ |
| 138 | + @Deprecated |
92 | 139 | public String subtitle_preset;
|
| 140 | + /** @deprecated Use {@link #getSubtitleCodec()} instead */ |
| 141 | + @Deprecated |
93 | 142 | private String subtitle_codec;
|
94 | 143 |
|
| 144 | + /** @deprecated Use {@link #getPreset()} instead */ |
| 145 | + @Deprecated |
95 | 146 | public String preset;
|
| 147 | + /** @deprecated Use {@link #getPresetFilename()} instead */ |
| 148 | + @Deprecated |
96 | 149 | public String presetFilename;
|
| 150 | + /** @deprecated Use {@link #getExtraArgs()} instead */ |
| 151 | + @Deprecated |
97 | 152 | public final List<String> extra_args = new ArrayList<>();
|
98 | 153 |
|
| 154 | + /** @deprecated Use {@link #getStrict()} instead */ |
| 155 | + @Deprecated |
99 | 156 | public FFmpegBuilder.Strict strict = FFmpegBuilder.Strict.NORMAL;
|
100 | 157 |
|
| 158 | + /** @deprecated Use {@link #getTargetSize()} instead */ |
| 159 | + @Deprecated |
101 | 160 | public long targetSize = 0; // in bytes
|
| 161 | + /** @deprecated Use {@link #getPassPaddingBitrate()} instead */ |
| 162 | + @Deprecated |
102 | 163 | public long pass_padding_bitrate = 1024; // in bits per second
|
103 | 164 |
|
| 165 | + /** @deprecated Use {@link #isThrowWarnings()} instead */ |
| 166 | + @Deprecated |
104 | 167 | public boolean throwWarnings = true; // TODO Either delete this, or apply it consistently
|
105 | 168 |
|
106 | 169 | protected AbstractFFmpegStreamBuilder() {
|
@@ -686,4 +749,120 @@ protected void addVideoFlags(FFmpegBuilder parent, ImmutableList.Builder<String>
|
686 | 749 | args.add("-r", video_frame_rate.toString());
|
687 | 750 | }
|
688 | 751 | }
|
| 752 | + |
| 753 | + public String getFormat() { |
| 754 | + return format; |
| 755 | + } |
| 756 | + |
| 757 | + public Long getStartOffset() { |
| 758 | + return startOffset; |
| 759 | + } |
| 760 | + |
| 761 | + public Long getDuration() { |
| 762 | + return duration; |
| 763 | + } |
| 764 | + |
| 765 | + public List<String> getMetaTags() { |
| 766 | + return ImmutableList.copyOf(meta_tags); |
| 767 | + } |
| 768 | + |
| 769 | + public boolean isAudioEnabled() { |
| 770 | + return audio_enabled; |
| 771 | + } |
| 772 | + |
| 773 | + public String getAudioCodec() { |
| 774 | + return audio_codec; |
| 775 | + } |
| 776 | + |
| 777 | + public int getAudioChannels() { |
| 778 | + return audio_channels; |
| 779 | + } |
| 780 | + |
| 781 | + public int getAudioSampleRate() { |
| 782 | + return audio_sample_rate; |
| 783 | + } |
| 784 | + |
| 785 | + public String getAudioPreset() { |
| 786 | + return audio_preset; |
| 787 | + } |
| 788 | + |
| 789 | + public boolean isVideoEnabled() { |
| 790 | + return video_enabled; |
| 791 | + } |
| 792 | + |
| 793 | + public String getVideoCodec() { |
| 794 | + return video_codec; |
| 795 | + } |
| 796 | + |
| 797 | + public boolean isVideoCopyinkf() { |
| 798 | + return video_copyinkf; |
| 799 | + } |
| 800 | + |
| 801 | + public Fraction getVideoFrameRate() { |
| 802 | + return video_frame_rate; |
| 803 | + } |
| 804 | + |
| 805 | + public int getVideoWidth() { |
| 806 | + return video_width; |
| 807 | + } |
| 808 | + |
| 809 | + public int getVideoHeight() { |
| 810 | + return video_height; |
| 811 | + } |
| 812 | + |
| 813 | + public String getVideoSize() { |
| 814 | + return video_size; |
| 815 | + } |
| 816 | + |
| 817 | + public String getVideoMovflags() { |
| 818 | + return video_movflags; |
| 819 | + } |
| 820 | + |
| 821 | + public Integer getVideoFrames() { |
| 822 | + return video_frames; |
| 823 | + } |
| 824 | + |
| 825 | + public String getVideoPixelFormat() { |
| 826 | + return video_pixel_format; |
| 827 | + } |
| 828 | + |
| 829 | + public boolean isSubtitleEnabled() { |
| 830 | + return subtitle_enabled; |
| 831 | + } |
| 832 | + |
| 833 | + public String getSubtitlePreset() { |
| 834 | + return subtitle_preset; |
| 835 | + } |
| 836 | + |
| 837 | + public String getSubtitleCodec() { |
| 838 | + return subtitle_codec; |
| 839 | + } |
| 840 | + |
| 841 | + public String getPreset() { |
| 842 | + return preset; |
| 843 | + } |
| 844 | + |
| 845 | + public String getPresetFilename() { |
| 846 | + return presetFilename; |
| 847 | + } |
| 848 | + |
| 849 | + public List<String> getExtraArgs() { |
| 850 | + return extra_args; |
| 851 | + } |
| 852 | + |
| 853 | + public FFmpegBuilder.Strict getStrict() { |
| 854 | + return strict; |
| 855 | + } |
| 856 | + |
| 857 | + public long getTargetSize() { |
| 858 | + return targetSize; |
| 859 | + } |
| 860 | + |
| 861 | + public long getPassPaddingBitrate() { |
| 862 | + return pass_padding_bitrate; |
| 863 | + } |
| 864 | + |
| 865 | + public boolean isThrowWarnings() { |
| 866 | + return throwWarnings; |
| 867 | + } |
689 | 868 | }
|
0 commit comments