}
/// Tests an encoder by decoding a stream from input file, feeding it to the encoder and muxing the result into output file.
-pub fn test_encoding_to_file(dec_config: &DecoderTestParams, enc_config: &EncoderTestParams, mut enc_params: EncodeParameters) {
+pub fn test_encoding_to_file(dec_config: &DecoderTestParams, enc_config: &EncoderTestParams, mut enc_params: EncodeParameters, enc_options: &[NAOption]) {
let dmx_f = dec_config.dmx_reg.find_demuxer(dec_config.demuxer).unwrap();
let mut file = File::open(dec_config.in_name).unwrap();
let mut fr = FileReader::new_read(&mut file);
let encfunc = enc_config.enc_reg.find_encoder(enc_config.enc_name).unwrap();
let mut encoder = (encfunc)();
+ encoder.set_options(enc_options);
let out_str = encoder.init(0, enc_params).unwrap();
out_sm.add_stream(NAStream::clone(&out_str));
}
/// Tests an encoder by decoding a stream from input file, feeding it to the encoder and calculating the hash of codec information and packet data.
-pub fn test_encoding_md5(dec_config: &DecoderTestParams, enc_config: &EncoderTestParams, mut enc_params: EncodeParameters, ref_hash: &[u32; 4]) {
+pub fn test_encoding_md5(dec_config: &DecoderTestParams, enc_config: &EncoderTestParams, mut enc_params: EncodeParameters, enc_options: &[NAOption], ref_hash: &[u32; 4]) {
let dmx_f = dec_config.dmx_reg.find_demuxer(dec_config.demuxer).unwrap();
let mut file = File::open(dec_config.in_name).unwrap();
let mut fr = FileReader::new_read(&mut file);
let encfunc = enc_config.enc_reg.find_encoder(enc_config.enc_name).unwrap();
let mut encoder = (encfunc)();
+ encoder.set_options(enc_options);
let out_str = encoder.init(0, enc_params).unwrap();
let mut md5 = MD5::new();
tb_den: 0,
flags: 0,
};
- //test_encoding_to_file(&dec_config, &enc_config, enc_params);
- test_encoding_md5(&dec_config, &enc_config, enc_params,
+ //test_encoding_to_file(&dec_config, &enc_config, enc_params, &[]);
+ test_encoding_md5(&dec_config, &enc_config, enc_params, &[],
&[0xd73cb3c7, 0x30d59f90, 0x1d6e0e28, 0x5b72cc0c]);
}
}
tb_den: 0,
flags: 0,
};
- //test_encoding_to_file(&dec_config, &enc_config, enc_params);
- test_encoding_md5(&dec_config, &enc_config, enc_params,
+ let enc_options = &[];
+ //test_encoding_to_file(&dec_config, &enc_config, enc_params, enc_options);
+ test_encoding_md5(&dec_config, &enc_config, enc_params, enc_options,
&[0x50df10e2, 0x606f3268, 0xdd4bc2ff, 0x844e7d87]);
}
tb_den: 0,
flags: 0,
};
- //test_encoding_to_file(&dec_config, &enc_config, enc_params);
- test_encoding_md5(&dec_config, &enc_config, enc_params,
+ let enc_options = &[];
+ //test_encoding_to_file(&dec_config, &enc_config, enc_params, enc_options);
+ test_encoding_md5(&dec_config, &enc_config, enc_params, enc_options,
&[0x0b4cb528, 0x66c91f6c, 0x1c2187a5, 0x2723a08d]);
}
tb_den: 0,
flags: 0,
};
- //test_encoding_to_file(&dec_config, &enc_config, enc_params);
- test_encoding_md5(&dec_config, &enc_config, enc_params,
+ let enc_options = &[];
+ //test_encoding_to_file(&dec_config, &enc_config, enc_params, enc_options);
+ test_encoding_md5(&dec_config, &enc_config, enc_params, enc_options,
&[0x1a522743, 0x6c320a6e, 0xd08539e1, 0x03fc17ea]);
}
tb_den: 0,
flags: 0,
};
- //test_encoding_to_file(&dec_config, &enc_config, enc_params);
- test_encoding_md5(&dec_config, &enc_config, enc_params,
+ let enc_options = &[];
+ //test_encoding_to_file(&dec_config, &enc_config, enc_params, enc_options);
+ test_encoding_md5(&dec_config, &enc_config, enc_params, enc_options,
&[0x3880e045, 0xe6c88dc7, 0x21066058, 0xc789f1e9]);
}
}
tb_den: 0,
flags: 0,
};
- test_encoding_md5(&dec_config, &enc_config, enc_params,
+ test_encoding_md5(&dec_config, &enc_config, enc_params, &[],
&[0xe1591a1e, 0x816d0239, 0x4cc42291, 0x4e6b69cb]);
}
}
tb_den: 0,
flags: 0,
};
- //test_encoding_to_file(&dec_config, &enc_config, enc_params);
- test_encoding_md5(&dec_config, &enc_config, enc_params,
+ //test_encoding_to_file(&dec_config, &enc_config, enc_params, &[]);
+ test_encoding_md5(&dec_config, &enc_config, enc_params, &[],
&[0x4339421d, 0x6393f1b6, 0x653d6cd2, 0x3a184382]);
}
}