@@ -28,10 +28,6 @@ pub enum FramedFormat {
2828 Hev1 ,
2929 /// AV1 with inline sequence headers
3030 Av01 ,
31- /// VP8 (one frame per buffer; not self-delimiting).
32- Vp8 ,
33- /// VP9 (one frame per buffer; not self-delimiting).
34- Vp9 ,
3531 /// Raw AAC frames (not ADTS).
3632 Aac ,
3733 /// Raw Opus frames (not Ogg).
@@ -40,6 +36,12 @@ pub enum FramedFormat {
4036 Mkv ,
4137 /// MPEG-TS (transport stream) container.
4238 Ts ,
39+ // New variants go at the end: this enum has no repr, so inserting in the
40+ // middle would shift the implicit discriminants of everything after it.
41+ /// VP8 (one frame per buffer; not self-delimiting).
42+ Vp8 ,
43+ /// VP9 (one frame per buffer; not self-delimiting).
44+ Vp9 ,
4345}
4446
4547impl FromStr for FramedFormat {
@@ -52,12 +54,12 @@ impl FromStr for FramedFormat {
5254 "hev1" => Ok ( FramedFormat :: Hev1 ) ,
5355 "fmp4" | "cmaf" => Ok ( FramedFormat :: Fmp4 ) ,
5456 "av01" | "av1" | "av1c" | "av1C" => Ok ( FramedFormat :: Av01 ) ,
55- "vp8" | "vp08" => Ok ( FramedFormat :: Vp8 ) ,
56- "vp9" | "vp09" => Ok ( FramedFormat :: Vp9 ) ,
5757 "aac" => Ok ( FramedFormat :: Aac ) ,
5858 "opus" => Ok ( FramedFormat :: Opus ) ,
5959 "mkv" | "webm" | "matroska" => Ok ( FramedFormat :: Mkv ) ,
6060 "ts" | "mpegts" | "mpeg2ts" | "m2ts" => Ok ( FramedFormat :: Ts ) ,
61+ "vp8" | "vp08" => Ok ( FramedFormat :: Vp8 ) ,
62+ "vp9" | "vp09" => Ok ( FramedFormat :: Vp9 ) ,
6163 _ => Err ( Error :: UnknownFormat ( s. to_string ( ) ) ) ,
6264 }
6365 }
@@ -71,12 +73,12 @@ impl fmt::Display for FramedFormat {
7173 FramedFormat :: Fmp4 => write ! ( f, "fmp4" ) ,
7274 FramedFormat :: Hev1 => write ! ( f, "hev1" ) ,
7375 FramedFormat :: Av01 => write ! ( f, "av01" ) ,
74- FramedFormat :: Vp8 => write ! ( f, "vp8" ) ,
75- FramedFormat :: Vp9 => write ! ( f, "vp9" ) ,
7676 FramedFormat :: Aac => write ! ( f, "aac" ) ,
7777 FramedFormat :: Opus => write ! ( f, "opus" ) ,
7878 FramedFormat :: Mkv => write ! ( f, "mkv" ) ,
7979 FramedFormat :: Ts => write ! ( f, "ts" ) ,
80+ FramedFormat :: Vp8 => write ! ( f, "vp8" ) ,
81+ FramedFormat :: Vp9 => write ! ( f, "vp9" ) ,
8082 }
8183 }
8284}
0 commit comments