introduce a way for encoder to manifest its capabilities
[nihav.git] / nihav-duck / src / codecs / vp7enc / mod.rs
index 67d4bedf4295f6fa5208f20e5a33f212297ba0ce..a73a5713976ee8d1f8480e1e80cf62d94b2b0261 100644 (file)
@@ -267,9 +267,9 @@ impl NAEncoder for VP7Encoder {
     fn negotiate_format(&self, encinfo: &EncodeParameters) -> EncoderResult<EncodeParameters> {
         match encinfo.format {
             NACodecTypeInfo::None => {
-                let mut ofmt = EncodeParameters::default();
-                ofmt.format = NACodecTypeInfo::Video(NAVideoInfo::new(0, 0, false, YUV420_FORMAT));
-                Ok(ofmt)
+                Ok(EncodeParameters {
+                    format: NACodecTypeInfo::Video(NAVideoInfo::new(0, 0, false, YUV420_FORMAT)),
+                    ..Default::default() })
             },
             NACodecTypeInfo::Audio(_) => Err(EncoderError::FormatError),
             NACodecTypeInfo::Video(vinfo) => {
@@ -280,6 +280,7 @@ impl NAEncoder for VP7Encoder {
             }
         }
     }
+    fn get_capabilities(&self) -> u64 { 0 }
     fn init(&mut self, stream_id: u32, encinfo: EncodeParameters) -> EncoderResult<NAStreamRef> {
         match encinfo.format {
             NACodecTypeInfo::None => Err(EncoderError::FormatError),