static int v4l2_receive_frame(AVCodecContext *avctx, AVFrame *frame)

{

    V4L2m2mContext *s = avctx->priv_data;

    V4L2Context *const capture = &s->capture;

    V4L2Context *const output = &s->output;

    AVPacket avpkt = {0};

    int ret;



    ret = ff_decode_get_packet(avctx, &avpkt);

    if (ret < 0 && ret != AVERROR_EOF)

        return ret;



    if (s->draining)

        goto dequeue;



    ret = ff_v4l2_context_enqueue_packet(output, &avpkt);

    if (ret < 0) {

        if (ret != AVERROR(ENOMEM))

           return ret;

        /* no input buffers available, continue dequeing */

    }



    if (avpkt.size) {

        ret = v4l2_try_start(avctx);

        if (ret)

            return 0;

    }



dequeue:

    return ff_v4l2_context_dequeue_frame(capture, frame);

}

static int v4l2_receive_frame(AVCodecContext *avctx, AVFrame *frame)

{

    V4L2m2mContext *s = avctx->priv_data;

    V4L2Context *const capture = &s->capture;

    V4L2Context *const output = &s->output;

    AVPacket avpkt = {0};

    int ret;



    ret = ff_decode_get_packet(avctx, &avpkt);

    if (ret < 0 && ret != AVERROR_EOF)

        return ret;



    if (s->draining)

        goto dequeue;



    ret = ff_v4l2_context_enqueue_packet(output, &avpkt);

    if (ret < 0) {

        if (ret != AVERROR(ENOMEM))

           return ret;

        

    }



    if (avpkt.size) {

        ret = v4l2_try_start(avctx);

        if (ret)

            return 0;

    }



dequeue:

    return ff_v4l2_context_dequeue_frame(capture, frame);

}

    V4L2m2mContext *s = avctx->priv_data;     V4L2m2mContext *s = avctx->priv_data;     V4L2m2mContext *s = avctx->priv_data;     V4L2m2mContext *s = avctx->priv_data;     V4L2m2mContext *s = avctx->priv_data;     V4L2m2mContext *s = avctx->priv_data;     V4L2m2mContext *s = avctx->priv_data;
static int FUNC_0(AVCodecContext *VAR_0, AVFrame *VAR_1)

{

    V4L2m2mContext *s = VAR_0->priv_data;

    V4L2Context *const capture = &s->capture;

    V4L2Context *const output = &s->output;

    AVPacket avpkt = {0};

    int VAR_2;



    VAR_2 = ff_decode_get_packet(VAR_0, &avpkt);

    if (VAR_2 < 0 && VAR_2 != AVERROR_EOF)

        return VAR_2;



    if (s->draining)

        goto dequeue;



    VAR_2 = ff_v4l2_context_enqueue_packet(output, &avpkt);

    if (VAR_2 < 0) {

        if (VAR_2 != AVERROR(ENOMEM))

           return VAR_2;

        

    }



    if (avpkt.size) {

        VAR_2 = v4l2_try_start(VAR_0);

        if (VAR_2)

            return 0;

    }



dequeue:

    return ff_v4l2_context_dequeue_frame(capture, VAR_1);

}

static int FUNC_0(AVCodecContext *VAR_0, AVFrame *VAR_1)
{ V4L2m2mContext *s = VAR_0->priv_data; V4L2Context *const capture = &s->capture; V4L2Context *const output = &s->output; AVPacket avpkt = {0}; int VAR_2; VAR_2 = ff_decode_get_packet(VAR_0, &avpkt); if (VAR_2 < 0 && VAR_2 != AVERROR_EOF)
return VAR_2; if (s->draining)
goto dequeue; VAR_2 = ff_v4l2_context_enqueue_packet(output, &avpkt); if (VAR_2 < 0) { if (VAR_2 != AVERROR(ENOMEM))
return VAR_2; } if (avpkt.size) { VAR_2 = v4l2_try_start(VAR_0); if (VAR_2)
return 0; } dequeue:
return ff_v4l2_context_dequeue_frame(capture, VAR_1); }