println!("video option for audio stream");
}
},
-//todo formaton
+ "pixfmt" => {
+ if ostr.enc_params.format == NACodecTypeInfo::None {
+ ostr.enc_params.format = NACodecTypeInfo::Video(NAVideoInfo::new(0, 0, false, YUV420_FORMAT));
+ }
+ if let NACodecTypeInfo::Video(ref mut vinfo) = ostr.enc_params.format {
+ let ret = oval[1].parse::<NAPixelFormaton>();
+ if let Ok(val) = ret {
+ vinfo.format = val;
+ } else {
+ println!("invalid pixel format");
+ }
+ } else {
+ println!("video option for audio stream");
+ }
+ },
"srate" => {
if ostr.enc_params.format == NACodecTypeInfo::None {
ostr.enc_params.format = NACodecTypeInfo::Audio(NAAudioInfo::new(0, 0, SND_S16_FORMAT, 0));
println!("audio option for video stream");
}
},
-//todo soniton, channel map
+ "sfmt" => {
+ if ostr.enc_params.format == NACodecTypeInfo::None {
+ ostr.enc_params.format = NACodecTypeInfo::Audio(NAAudioInfo::new(0, 0, SND_S16_FORMAT, 0));
+ }
+ if let NACodecTypeInfo::Audio(ref mut ainfo) = ostr.enc_params.format {
+ let ret = oval[1].parse::<NASoniton>();
+ if let Ok(val) = ret {
+ ainfo.format = val;
+ } else {
+ println!("invalid audio format");
+ }
+ } else {
+ println!("audio option for video stream");
+ }
+ },
+// todo channel map negotiation
+ /*"chmap" => {
+ if ostr.enc_params.format == NACodecTypeInfo::None {
+ ostr.enc_params.format = NACodecTypeInfo::Audio(NAAudioInfo::new(0, 0, SND_S16_FORMAT, 0));
+ }
+ if let NACodecTypeInfo::Audio(ref mut ainfo) = ostr.enc_params.format {
+ let ret = oval[1].parse::<NAChannelMap>();
+ if let Ok(val) = ret {
+ ainfo.chmap = val;
+ } else {
+ println!("invalid channel map");
+ }
+ } else {
+ println!("audio option for video stream");
+ }
+ },*/
"bitrate" => {
let ret = oval[1].parse::<u32>();
if let Ok(val) = ret {