if (ret == AVERROR(EAGAIN)) { av_packet_unref(pkt_in); continue; } av_log(NULL, AV_LOG_ERROR, "Error while sending a packet to the decoder\n"); break; } while (ret >= 0) { ret = avcodec_receive_frame(stream->decCtx, stream->decFrame); ... //代码省略 } ... //代码省...
* AVERROR(EAGAIN): output is not available in this state - user must try * to send new input * AVERROR_EOF: the decoder has been fully flushed, and there will be * no more output frames * AVERROR(EINVAL): codec not opened, or it is an encoder * AVERROR_INPUT_CHANGED: current d...
intavcodec_receive_frame(AVCodecContext*avctx,AVFrame*frame); 其中,参数avctx是指向AVCodecContext结构体的指针,表示要使用的编解码器上下文;参数frame是指向AVFrame结构体的指针,表示要存储获取到的解码帧或编码数据。 该函数返回值为0表示成功,否则返回一个负数错误代码。如果返回值为AVERROR(EAGAIN),则表示需要发送...
* av_frame_unref(frame) before doing anything else. * * @return * 0: success, a frame was returned * AVERROR(EAGAIN): output is not available right now - user must try * to send new input * AVERROR_EOF: the decoder has been fully flushed, and there will be * no more output f...
@参数 avctx 编码上下文 @参数 frame 这将会指向从解码器分配的一个引用计数的视频或者音频帧(取决于解码类型) @注意该函数在处理其他事情之前会调用av_frame_unref(frame) @返回值 0:成功,返回一帧数据 AVERROR(EAGAIN):当前输出无效,用户必须输入更新的视频包数据 ...
ret= decode_receive_frame_internal(avctx, avci->buffer_frame);if(ret <0&& ret != AVERROR(EAGAIN) && ret !=AVERROR_EOF)returnret; }return0; } avcodec_receive_frame函数 intattribute_align_arg avcodec_receive_frame(AVCodecContext *avctx, AVFrame *frame) ...
* @return 0 on success, otherwise negative error code: * AVERROR(EAGAIN): input is not accepted right now - the packet must be * resent after trying to read output * AVERROR_EOF: the decoder has been flushed, and no new packets can ...
@参数 avctx 编码上下文 @参数 frame 这将会指向从解码器分配的一个引用计数的视频或者音频帧(取决于解码类型) @注意该函数在处理其他事情之前会调用av_frame_unref(frame) @返回值 0:成功,返回一帧数据 AVERROR(EAGAIN):当前输出无效,用户必须发送新的输入 ...
* unnecessary and will return AVERROR_EOF. If the decoder * still has frames buffered, it will return them after sending * a flush packet. * * @return 0 on success, otherwise negative error code: * AVERROR(EAGAIN): input is not accepted right now - the packet must be ...
av_init_packet(&packet); packet.data=(uint8_t*)input_data; packet.size=input_size; intret=avcodec_send_packet(codec_ctx,&packet); while(ret>=0){ ret=avcodec_receive_frame(codec_ctx,frame); if(ret==AVERROR(EAGAIN)||ret==AVERROR_EOF){ ...