(&mut self, input: EncodeInput, ms: i64)
| 250 | } |
| 251 | |
| 252 | fn encode_to_message(&mut self, input: EncodeInput, ms: i64) -> ResultType<VideoFrame> { |
| 253 | let mut frames = Vec::new(); |
| 254 | for ref frame in self |
| 255 | .encode(ms, input.yuv()?, STRIDE_ALIGN) |
| 256 | .with_context(|| "Failed to encode")? |
| 257 | { |
| 258 | frames.push(Self::create_frame(frame)); |
| 259 | } |
| 260 | if frames.len() > 0 { |
| 261 | Ok(Self::create_video_frame(frames)) |
| 262 | } else { |
| 263 | Err(anyhow!("no valid frame")) |
| 264 | } |
| 265 | } |
| 266 | |
| 267 | fn yuvfmt(&self) -> crate::EncodeYuvFormat { |
| 268 | self.yuvfmt.clone() |