MCPcopy Create free account
hub / github.com/audeering/opensmile / receiveFrame

Method receiveFrame

src/ffmpeg/ffmpegSource.cpp:330–349  ·  view source on GitHub ↗

Receives decoded data from the decoder Return value: -1 eof, 0 error, > 0 num samples read

Source from the content-addressed store, hash-verified

328// Receives decoded data from the decoder
329// Return value: -1 eof, 0 error, > 0 num samples read
330int cFFmpegSource::receiveFrame()
331{
332 int ret = avcodec_receive_frame(avCodecContext, avFrame);
333 if (ret == AVERROR(EAGAIN)) {
334 // decoder did not produce any output and needs more input
335 receivingFrames = false;
336 return 0;
337 } else if (ret == AVERROR_EOF) {
338 // decoder reached end-of-file and won't produce any more output
339 receivingFrames = false;
340 return -1;
341 } else if (ret < 0) {
342 // an error occurred during decoding
343 COMP_ERR("Error during decoding. %s",avGetErrorString(ret));
344 } else {
345 // decoding succeeded
346 receivingFrames = true;
347 return 1;
348 }
349}
350
351// converts a part of the samples in avFrame to float format, optionally mixing them down to Mono, and copies them to mat_
352void cFFmpegSource::convertAndCopyFrameSamplesToMatrix(int index, int numSamples)

Callers

nothing calls this directly

Calls 1

avGetErrorStringFunction · 0.85

Tested by

no test coverage detected