[FFmpeg-devel] [PATCH v5 2/7] avcodec/v4l2_m2m: remove ff_v4l2_m2m_codec_full_reinit

Ming Qian ming.qian at nxp.com
Tue Jan 4 11:08:31 EET 2022


ff_v4l2_m2m_codec_full_reinit is not used any more,
so remove it.

Signed-off-by: Ming Qian <ming.qian at nxp.com>
---
 libavcodec/v4l2_m2m.c | 76 -------------------------------------------
 libavcodec/v4l2_m2m.h | 10 ------
 2 files changed, 86 deletions(-)

diff --git a/libavcodec/v4l2_m2m.c b/libavcodec/v4l2_m2m.c
index cdfd579810f2..a0ee5a201360 100644
--- a/libavcodec/v4l2_m2m.c
+++ b/libavcodec/v4l2_m2m.c
@@ -245,82 +245,6 @@ int ff_v4l2_m2m_codec_reinit(V4L2m2mContext *s)
     return 0;
 }
 
-int ff_v4l2_m2m_codec_full_reinit(V4L2m2mContext *s)
-{
-    void *log_ctx = s->avctx;
-    int ret;
-
-    av_log(log_ctx, AV_LOG_DEBUG, "%s full reinit\n", s->devname);
-
-    /* wait for pending buffer references */
-    if (atomic_load(&s->refcount))
-        while(sem_wait(&s->refsync) == -1 && errno == EINTR);
-
-    ret = ff_v4l2_context_set_status(&s->output, VIDIOC_STREAMOFF);
-    if (ret) {
-        av_log(log_ctx, AV_LOG_ERROR, "output VIDIOC_STREAMOFF\n");
-        goto error;
-    }
-
-    ret = ff_v4l2_context_set_status(&s->capture, VIDIOC_STREAMOFF);
-    if (ret) {
-        av_log(log_ctx, AV_LOG_ERROR, "capture VIDIOC_STREAMOFF\n");
-        goto error;
-    }
-
-    /* release and unmmap the buffers */
-    ff_v4l2_context_release(&s->output);
-    ff_v4l2_context_release(&s->capture);
-
-    /* start again now that we know the stream dimensions */
-    s->draining = 0;
-    s->reinit = 0;
-
-    ret = ff_v4l2_context_get_format(&s->output, 0);
-    if (ret) {
-        av_log(log_ctx, AV_LOG_DEBUG, "v4l2 output format not supported\n");
-        goto error;
-    }
-
-    ret = ff_v4l2_context_get_format(&s->capture, 0);
-    if (ret) {
-        av_log(log_ctx, AV_LOG_DEBUG, "v4l2 capture format not supported\n");
-        goto error;
-    }
-
-    ret = ff_v4l2_context_set_format(&s->output);
-    if (ret) {
-        av_log(log_ctx, AV_LOG_ERROR, "can't set v4l2 output format\n");
-        goto error;
-    }
-
-    ret = ff_v4l2_context_set_format(&s->capture);
-    if (ret) {
-        av_log(log_ctx, AV_LOG_ERROR, "can't to set v4l2 capture format\n");
-        goto error;
-    }
-
-    ret = ff_v4l2_context_init(&s->output);
-    if (ret) {
-        av_log(log_ctx, AV_LOG_ERROR, "no v4l2 output context's buffers\n");
-        goto error;
-    }
-
-    /* decoder's buffers need to be updated at a later stage */
-    if (s->avctx && !av_codec_is_decoder(s->avctx->codec)) {
-        ret = ff_v4l2_context_init(&s->capture);
-        if (ret) {
-            av_log(log_ctx, AV_LOG_ERROR, "no v4l2 capture context's buffers\n");
-            goto error;
-        }
-    }
-
-    return 0;
-
-error:
-    return ret;
-}
-
 static void v4l2_m2m_destroy_context(void *opaque, uint8_t *context)
 {
     V4L2m2mContext *s = (V4L2m2mContext*)context;
diff --git a/libavcodec/v4l2_m2m.h b/libavcodec/v4l2_m2m.h
index b67b21633109..16e0a6d6b90f 100644
--- a/libavcodec/v4l2_m2m.h
+++ b/libavcodec/v4l2_m2m.h
@@ -119,14 +119,4 @@ int ff_v4l2_m2m_codec_end(V4L2m2mPriv *priv);
  */
 int ff_v4l2_m2m_codec_reinit(V4L2m2mContext *ctx);
 
-/**
- * Reinitializes the V4L2m2mContext when the driver cannot continue processing
- * with the  any of the current V4L2Contexts (ie, changes in output and capture).
- *
- * @param[in] ctx The V4L2m2mContext instantiated by the encoder/decoder.
- *
- * @returns 0 in case of success, negative number otherwise
- */
-int ff_v4l2_m2m_codec_full_reinit(V4L2m2mContext *ctx);
-
 #endif /* AVCODEC_V4L2_M2M_H */
-- 
2.33.0



More information about the ffmpeg-devel mailing list