MCPcopy Create free account
hub / github.com/MusicPlayerDaemon/MPD / FfmpegSendFrame

Function FfmpegSendFrame

src/decoder/plugins/FfmpegDecoderPlugin.cxx:200–221  ·  view source on GitHub ↗

* Invoke DecoderClient::SubmitAudio() with the contents of an * #AVFrame. */

Source from the content-addressed store, hash-verified

198 * #AVFrame.
199 */
200static DecoderCommand
201FfmpegSendFrame(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
223static DecoderCommand
224FfmpegReceiveFrames(DecoderClient &client, InputStream *is,

Callers 1

FfmpegReceiveFramesFunction · 0.85

Calls 2

InterleaveFrameFunction · 0.85
SubmitAudioMethod · 0.45

Tested by

no test coverage detected