static int output_packet(struct lsInput *input,const AVPacket *pkt) { AVPacket avpkt; int got_output = 0; int ret = 0; if (pkt == NULL) { av_init_packet(&avpkt); avpkt.data = NULL; avpkt.size = 0; } else { avpkt = *pkt; } if (input->dec_ctx) { ret = avcodec_decode_video2(input->dec_ctx,input->InFrame, &got_output,&avpkt); if (!got_output || ret < 0) { av_buffersrc_add_ref(input->in_filter, NULL, 0); } if(ret < 0) av_log(NULL,AV_LOG_ERROR,"unable to decode video\n"); } else { /* Write to Muxer */ } return ret; }
int BufferSrcFilterContext::addBufferRef(FilterBufferRef &ref, int flags) { assert(isValid()); assert(ref.isValid()); return av_buffersrc_add_ref(getAVFilterContext(), ref.getAVFilterBufferRef(), flags); }
int av_asrc_buffer_add_audio_buffer_ref(AVFilterContext *ctx, AVFilterBufferRef *samplesref, int av_unused flags) { return av_buffersrc_add_ref(ctx, samplesref, AV_BUFFERSRC_FLAG_NO_COPY); }
int av_vsrc_buffer_add_video_buffer_ref(AVFilterContext *buffer_filter, AVFilterBufferRef *picref, int flags) { return av_buffersrc_add_ref(buffer_filter, picref, 0); }