|
| 1 | +package packlit |
| 2 | + |
| 3 | +import ( |
| 4 | + "fmt" |
| 5 | + "strings" |
| 6 | +) |
| 7 | + |
| 8 | +var ( |
| 9 | + _ ShakaParser = (*OutputMediaInfoFlag)(nil) |
| 10 | + _ ShakaParser = (*MpdOutputFlag)(nil) |
| 11 | + _ ShakaParser = (*BaseUrlsFlag)(nil) |
| 12 | + _ ShakaParser = (*MinBufferTimeFlag)(nil) |
| 13 | + _ ShakaParser = (*MinimumUpdatePeriodFlag)(nil) |
| 14 | + _ ShakaParser = (*SuggestedPresentationDelayFlag)(nil) |
| 15 | + _ ShakaParser = (*UtCTimingsFlag)(nil) |
| 16 | + _ ShakaParser = (*GenerateDashIfIopCompliantMpdFlag)(nil) |
| 17 | + _ ShakaParser = (*AllowApproximateSegmentTimelineFlag)(nil) |
| 18 | + _ ShakaParser = (*AllowCodecSwitchingFlag)(nil) |
| 19 | + _ ShakaParser = (*IncludeMsprProForPlayReadyFlag)(nil) |
| 20 | + _ ShakaParser = (*DashForceSegmentListFlag)(nil) |
| 21 | + _ ShakaParser = (*LowLatencyDashModeFlag)(nil) |
| 22 | +) |
| 23 | + |
| 24 | +// OutputMediaInfoFlag represents the flag to output media information. |
| 25 | +type OutputMediaInfoFlag struct{} |
| 26 | + |
| 27 | +// Parse returns the string representation of OutputMediaInfo for use in the command line flags. |
| 28 | +func (o OutputMediaInfoFlag) Parse() string { |
| 29 | + return "--output_media_info" |
| 30 | +} |
| 31 | + |
| 32 | +// Validate checks if the OutputMediaInfoFlag value is valid. |
| 33 | +func (o OutputMediaInfoFlag) Validate() error { |
| 34 | + // No specific validation logic for this boolean flag. |
| 35 | + return nil |
| 36 | +} |
| 37 | + |
| 38 | +// BaseUrlsFlag represents the comma-separated BaseURLs for the MPD. |
| 39 | +type BaseUrlsFlag []string |
| 40 | + |
| 41 | +// Parse returns the string representation of BaseUrls for use in the command line flags. |
| 42 | +func (b BaseUrlsFlag) Parse() string { |
| 43 | + return fmt.Sprintf("--base_urls=%s", strings.Join(b, ",")) |
| 44 | +} |
| 45 | + |
| 46 | +// Validate checks if the BaseUrls value is valid. |
| 47 | +func (b BaseUrlsFlag) Validate() error { |
| 48 | + return nil |
| 49 | +} |
| 50 | + |
| 51 | +// MinBufferTimeFlag represents the minimum buffer time for MPD. |
| 52 | +type MinBufferTimeFlag float32 |
| 53 | + |
| 54 | +// Parse returns the string representation of MinBufferTime for use in the command line flags. |
| 55 | +func (m MinBufferTimeFlag) Parse() string { |
| 56 | + return fmt.Sprintf("--min_buffer_time=%v", m) |
| 57 | +} |
| 58 | + |
| 59 | +// Validate checks if the MinBufferTime value is valid. |
| 60 | +func (m MinBufferTimeFlag) Validate() error { |
| 61 | + return nil |
| 62 | +} |
| 63 | + |
| 64 | +// MinimumUpdatePeriodFlag represents the minimum update period for the MPD. |
| 65 | +type MinimumUpdatePeriodFlag float32 |
| 66 | + |
| 67 | +// Parse returns the string representation of MinimumUpdatePeriod for use in the command line flags. |
| 68 | +func (m MinimumUpdatePeriodFlag) Parse() string { |
| 69 | + return fmt.Sprintf("--minimum_update_period=%v", m) |
| 70 | +} |
| 71 | + |
| 72 | +// Validate checks if the MinimumUpdatePeriod value is valid. |
| 73 | +func (m MinimumUpdatePeriodFlag) Validate() error { |
| 74 | + return nil |
| 75 | +} |
| 76 | + |
| 77 | +// SuggestedPresentationDelayFlag represents the suggested presentation delay for the MPD. |
| 78 | +type SuggestedPresentationDelayFlag float32 |
| 79 | + |
| 80 | +// Parse returns the string representation of SuggestedPresentationDelay for use in the command line flags. |
| 81 | +func (s SuggestedPresentationDelayFlag) Parse() string { |
| 82 | + return fmt.Sprintf("--suggested_presentation_delay=%v", s) |
| 83 | +} |
| 84 | + |
| 85 | +// Validate checks if the SuggestedPresentationDelay value is valid. |
| 86 | +func (s SuggestedPresentationDelayFlag) Validate() error { |
| 87 | + // Placeholder validation logic. It could be any required check. |
| 88 | + return nil |
| 89 | +} |
| 90 | + |
| 91 | +// UtCTimingsFlag represents the UTC Timing for the MPD. |
| 92 | +type UtCTimingsFlag []string |
| 93 | + |
| 94 | +// Parse returns the string representation of UtCTimings for use in the command line flags. |
| 95 | +func (u UtCTimingsFlag) Parse() string { |
| 96 | + return fmt.Sprintf("--utc_timings=%s", strings.Join(u, ",")) |
| 97 | +} |
| 98 | + |
| 99 | +// Validate checks if the UtCTimings value is valid. |
| 100 | +func (u UtCTimingsFlag) Validate() error { |
| 101 | + // You can add specific validation for the UTC Timing here. |
| 102 | + return nil |
| 103 | +} |
| 104 | + |
| 105 | +// GenerateDashIfIopCompliantMpdFlag represents the flag to generate DASH-IF IOP compliant MPD. |
| 106 | +type GenerateDashIfIopCompliantMpdFlag struct{} |
| 107 | + |
| 108 | +// Parse returns the string representation of GenerateDashIfIopCompliantMpd for use in the command line flags. |
| 109 | +func (g GenerateDashIfIopCompliantMpdFlag) Parse() string { |
| 110 | + return "--generate_dash_if_iop_compliant_mpd" |
| 111 | +} |
| 112 | + |
| 113 | +// Validate checks if the GenerateDashIfIopCompliantMpdFlag value is valid. |
| 114 | +func (g GenerateDashIfIopCompliantMpdFlag) Validate() error { |
| 115 | + // No specific validation logic for this boolean flag. |
| 116 | + return nil |
| 117 | +} |
| 118 | + |
| 119 | +// AllowApproximateSegmentTimelineFlag represents the flag to allow approximate segment timeline for live profiles. |
| 120 | +type AllowApproximateSegmentTimelineFlag struct{} |
| 121 | + |
| 122 | +// Parse returns the string representation of AllowApproximateSegmentTimeline for use in the command line flags. |
| 123 | +func (a AllowApproximateSegmentTimelineFlag) Parse() string { |
| 124 | + return "--allow_approximate_segment_timeline" |
| 125 | +} |
| 126 | + |
| 127 | +// Validate checks if the AllowApproximateSegmentTimelineFlag value is valid. |
| 128 | +func (a AllowApproximateSegmentTimelineFlag) Validate() error { |
| 129 | + // No specific validation logic for this boolean flag. |
| 130 | + return nil |
| 131 | +} |
| 132 | + |
| 133 | +// AllowCodecSwitchingFlag represents the flag to allow adaptive switching between different codecs. |
| 134 | +type AllowCodecSwitchingFlag struct{} |
| 135 | + |
| 136 | +// Parse returns the string representation of AllowCodecSwitching for use in the command line flags. |
| 137 | +func (a AllowCodecSwitchingFlag) Parse() string { |
| 138 | + return "--allow_codec_switching" |
| 139 | +} |
| 140 | + |
| 141 | +// Validate checks if the AllowCodecSwitchingFlag value is valid. |
| 142 | +func (a AllowCodecSwitchingFlag) Validate() error { |
| 143 | + // No specific validation logic for this boolean flag. |
| 144 | + return nil |
| 145 | +} |
| 146 | + |
| 147 | +// IncludeMsprProForPlayReadyFlag represents the flag to include mspr:pro for PlayReady content protection. |
| 148 | +type IncludeMsprProForPlayReadyFlag struct{} |
| 149 | + |
| 150 | +// Parse returns the string representation of IncludeMsprProForPlayReady for use in the command line flags. |
| 151 | +func (i IncludeMsprProForPlayReadyFlag) Parse() string { |
| 152 | + return "--include_mspr_pro_for_playready" |
| 153 | +} |
| 154 | + |
| 155 | +// Validate checks if the IncludeMsprProForPlayReadyFlag value is valid. |
| 156 | +func (i IncludeMsprProForPlayReadyFlag) Validate() error { |
| 157 | + // No specific validation logic for this boolean flag. |
| 158 | + return nil |
| 159 | +} |
| 160 | + |
| 161 | +// DashForceSegmentListFlag represents the flag to force SegmentList in DASH MPD. |
| 162 | +type DashForceSegmentListFlag struct{} |
| 163 | + |
| 164 | +// Parse returns the string representation of DashForceSegmentList for use in the command line flags. |
| 165 | +func (d DashForceSegmentListFlag) Parse() string { |
| 166 | + return "--dash_force_segment_list" |
| 167 | +} |
| 168 | + |
| 169 | +// Validate checks if the DashForceSegmentListFlag value is valid. |
| 170 | +func (d DashForceSegmentListFlag) Validate() error { |
| 171 | + // No specific validation logic for this boolean flag. |
| 172 | + return nil |
| 173 | +} |
| 174 | + |
| 175 | +// LowLatencyDashModeFlag represents the flag to enable low latency DASH mode. |
| 176 | +type LowLatencyDashModeFlag bool |
| 177 | + |
| 178 | +// Parse returns the string representation of LowLatencyDashMode for use in the command line flags. |
| 179 | +func (l LowLatencyDashModeFlag) Parse() string { |
| 180 | + return fmt.Sprintf("--low_latency_dash_mode=%v", l) |
| 181 | +} |
| 182 | + |
| 183 | +// Validate checks if the LowLatencyDashModeFlag value is valid. |
| 184 | +func (l LowLatencyDashModeFlag) Validate() error { |
| 185 | + // No specific validation logic for this boolean flag. |
| 186 | + return nil |
| 187 | +} |
0 commit comments