From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 14F20424FD for ; Tue, 4 Jan 2022 22:22:31 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6167068A68F; Wed, 5 Jan 2022 00:22:29 +0200 (EET) Received: from mail-qv1-f45.google.com (mail-qv1-f45.google.com [209.85.219.45]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5A0786801D5 for ; Wed, 5 Jan 2022 00:22:23 +0200 (EET) Received: by mail-qv1-f45.google.com with SMTP id o10so35733317qvc.5 for ; Tue, 04 Jan 2022 14:22:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=r70Q57AchJhzLr4jfTfM2oUFaiq3iGk3c5PJtyKlrNE=; b=m+wR3PyXukb4YyQqM5qs9wwJt+6p9EJ2PGKleMgj/PCG8PwW45m+b90dgoBNChpCcq rmwyg9yvOPt1esNIXnhCcZw20vUQOoW/kyxvbzu1NeW9osgk/GBcW32zPpvTlq3NfBMJ hW/zan8t7PF4GpMnYNaQ4TbSww52FERkX2S3MEf0ShVRj/p2rUYTWxTK7HQJHhGi2ZKk 4TloReYMvDOYsqzVQ0hkN9uicemLZcYjaF2U101b49RogN1smY1efD0K12JdGkQGl4Bu aLaYnMuqzt0ZKVfOavL+4NtM+18yaH+rRWjuxfMR4ZXv9aWXQMsCF9+uiHt3AwPsJX7t G91A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=r70Q57AchJhzLr4jfTfM2oUFaiq3iGk3c5PJtyKlrNE=; b=15NNBHv7+0OF+4S14W8crHPqADMgLpP9+zqnwR6AP5WYWyt9B5lxnS1WJQPbaQ0R/P PdqU1VjmSiyUOwBw52pb+Pnghh/1zJR04qjZWdMaX/g86ga4zPBmsw8zuCANwjEaVmtv NyvASSK7UfAuArSaBQ1hDtLi7f97rT00RsZWkdHta2PEYaeEsEgVsrD47e56UiOJ6f3w x3ulCnS1nOqtvaK7418Um2im9dQOzEwFDL6hXHnDQUE/72+2tJnuMF+M2BaQCNDlLweP Wk04ZLrVSEaZF/ZOPXsTcUORzvyB8D8/5Z+TwBAxnS16m+jX8ZGE/09UbxOsHZZ06v9L WmyA== X-Gm-Message-State: AOAM530KkjdGW3+78JRhF6fCe88mlSyKV0nhlmoqxNq8gVsYAnEIsB9i EHq5yXWmOzctIzDhFHmNopZKvQB4NrI= X-Google-Smtp-Source: ABdhPJzMt0oubIIrPcDV8+wBn1iyGvry9ujlfzEPzez3H4Khd4Bgmgo6WPN0CMudXgaobnNK5FHtiA== X-Received: by 2002:ad4:4dca:: with SMTP id cw10mr47562273qvb.21.1641334941748; Tue, 04 Jan 2022 14:22:21 -0800 (PST) Received: from jackie (pool-108-20-185-127.bstnma.fios.verizon.net. [108.20.185.127]) by smtp.gmail.com with ESMTPSA id c8sm32929585qkp.8.2022.01.04.14.22.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jan 2022 14:22:21 -0800 (PST) Date: Tue, 4 Jan 2022 17:22:19 -0500 From: Andriy Gelman To: FFmpeg development discussions and patches Message-ID: <20220104222219.yl35omgchbfyl4jc@jackie> References: <20220104090836.31660-1-ming.qian@nxp.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220104090836.31660-1-ming.qian@nxp.com> Subject: Re: [FFmpeg-devel] [PATCH v5 1/7] avcodec/v4l2_context: don't reinit output queue when dynamic resolution change X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Tue, 04. Jan 17:08, Ming Qian wrote: > in the v4l2 stateful video document, we can see the following > description: > During the resolution change sequence, the OUTPUT queue must remain > streaming. Calling VIDIOC_STREAMOFF() on the OUTPUT queue would > abort the sequence and initiate a seek. > > In principle, the OUTPUT queue operates separately from the CAPTURE > queue and this remains true for the duration of the entire > resolution change sequence as well. > > so don't reinit the output queue when handling the resolution change > event > > Signed-off-by: Ming Qian > --- > libavcodec/v4l2_context.c | 27 ++------------------------- > 1 file changed, 2 insertions(+), 25 deletions(-) > > diff --git a/libavcodec/v4l2_context.c b/libavcodec/v4l2_context.c > index ff1ea8e57b08..dda5157698c3 100644 > --- a/libavcodec/v4l2_context.c > +++ b/libavcodec/v4l2_context.c > @@ -162,9 +162,8 @@ static int v4l2_handle_event(V4L2Context *ctx) > { > V4L2m2mContext *s = ctx_to_m2mctx(ctx); > struct v4l2_format cap_fmt = s->capture.format; > - struct v4l2_format out_fmt = s->output.format; > struct v4l2_event evt = { 0 }; > - int full_reinit, reinit, ret; > + int reinit, ret; > > ret = ioctl(s->fd, VIDIOC_DQEVENT, &evt); > if (ret < 0) { > @@ -180,25 +179,12 @@ static int v4l2_handle_event(V4L2Context *ctx) > if (evt.type != V4L2_EVENT_SOURCE_CHANGE) > return 0; > > - ret = ioctl(s->fd, VIDIOC_G_FMT, &out_fmt); > - if (ret) { > - av_log(logger(ctx), AV_LOG_ERROR, "%s VIDIOC_G_FMT\n", s->output.name); > - return 0; > - } > - > ret = ioctl(s->fd, VIDIOC_G_FMT, &cap_fmt); > if (ret) { > av_log(logger(ctx), AV_LOG_ERROR, "%s VIDIOC_G_FMT\n", s->capture.name); > return 0; > } > > - full_reinit = v4l2_resolution_changed(&s->output, &out_fmt); > - if (full_reinit) { > - s->output.height = v4l2_get_height(&out_fmt); > - s->output.width = v4l2_get_width(&out_fmt); > - s->output.sample_aspect_ratio = v4l2_get_sar(&s->output); > - } > - > reinit = v4l2_resolution_changed(&s->capture, &cap_fmt); > if (reinit) { > s->capture.height = v4l2_get_height(&cap_fmt); > @@ -206,18 +192,9 @@ static int v4l2_handle_event(V4L2Context *ctx) > s->capture.sample_aspect_ratio = v4l2_get_sar(&s->capture); > } > > - if (full_reinit || reinit) > + if (reinit) > s->reinit = 1; > > - if (full_reinit) { > - ret = ff_v4l2_m2m_codec_full_reinit(s); > - if (ret) { > - av_log(logger(ctx), AV_LOG_ERROR, "v4l2_m2m_codec_full_reinit\n"); > - return AVERROR(EINVAL); > - } > - goto reinit_run; > - } > - > if (reinit) { > if (s->avctx) > ret = ff_set_dimensions(s->avctx, s->capture.width, s->capture.height); > -- > 2.33.0 lgtm Thanks, -- Andriy _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".