copy encoding parameters from the reference when negotiating the format
[nihav.git] / nihav-ms / src / codecs / msvideo1enc.rs
index f9b06cf848134627c1209245747bae0f97b75f9e..f842297d2affedec3405031b90e7b4ac29bc8611 100644 (file)
@@ -410,7 +410,7 @@ impl NAEncoder for MSVideo1Encoder {
             NACodecTypeInfo::Audio(_) => return Err(EncoderError::FormatError),
             NACodecTypeInfo::Video(vinfo) => {
                 let outinfo = NAVideoInfo::new((vinfo.width + 3) & !3, (vinfo.height + 3) & !3, true, RGB555_FORMAT);
-                let mut ofmt = EncodeParameters::default();
+                let mut ofmt = *encinfo;
                 ofmt.format = NACodecTypeInfo::Video(outinfo);
                 Ok(ofmt)
             }
@@ -479,6 +479,12 @@ impl NAEncoder for MSVideo1Encoder {
     }
 }
 
+impl NAOptionHandler for MSVideo1Encoder {
+    fn get_supported_options(&self) -> &[NAOptionDefinition] { &[] }
+    fn set_options(&mut self, _options: &[NAOption]) { }
+    fn query_option_value(&self, _name: &str) -> Option<NAValue> { None }
+}
+
 pub fn get_encoder() -> Box<dyn NAEncoder + Send> {
     Box::new(MSVideo1Encoder::new())
 }