Receives decoded data from the decoder Return value: -1 eof, 0 error, > 0 num samples read
| 328 | // Receives decoded data from the decoder |
| 329 | // Return value: -1 eof, 0 error, > 0 num samples read |
| 330 | int 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_ |
| 352 | void cFFmpegSource::convertAndCopyFrameSamplesToMatrix(int index, int numSamples) |
nothing calls this directly
no test coverage detected