* Invoke DecoderClient::SubmitAudio() with the contents of an * #AVFrame. */
| 198 | * #AVFrame. |
| 199 | */ |
| 200 | static DecoderCommand |
| 201 | FfmpegSendFrame(DecoderClient &client, InputStream *is, |
| 202 | AVCodecContext &codec_context, |
| 203 | const AVFrame &frame, |
| 204 | size_t &skip_bytes, |
| 205 | FfmpegBuffer &buffer) |
| 206 | { |
| 207 | auto output_buffer = Ffmpeg::InterleaveFrame(frame, buffer); |
| 208 | |
| 209 | if (skip_bytes > 0) { |
| 210 | if (skip_bytes >= output_buffer.size()) { |
| 211 | skip_bytes -= output_buffer.size(); |
| 212 | return DecoderCommand::NONE; |
| 213 | } |
| 214 | |
| 215 | output_buffer = output_buffer.subspan(skip_bytes); |
| 216 | skip_bytes = 0; |
| 217 | } |
| 218 | |
| 219 | return client.SubmitAudio(is, output_buffer, |
| 220 | codec_context.bit_rate / 1000); |
| 221 | } |
| 222 | |
| 223 | static DecoderCommand |
| 224 | FfmpegReceiveFrames(DecoderClient &client, InputStream *is, |
no test coverage detected