NACodecTypeInfo::Video(vinfo) => {
let pix_fmt = if vinfo.format == GRAY_FORMAT { GRAY_FORMAT } else { YUV420_FORMAT };
let outinfo = NAVideoInfo::new((vinfo.width + 3) & !3, (vinfo.height + 3) & !3, true, pix_fmt);
- let mut ofmt = EncodeParameters::default();
+ let mut ofmt = *encinfo;
ofmt.format = NACodecTypeInfo::Video(outinfo);
Ok(ofmt)
}
if (outinfo.channels == 1) && ((outinfo.block_len & 1) == 1) {
outinfo.block_len += 1;
}
- let mut ofmt = EncodeParameters::default();
+ let mut ofmt = *encinfo;
ofmt.format = NACodecTypeInfo::Audio(outinfo);
return Ok(ofmt);
}
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)
}