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 471B942501 for ; Tue, 4 Jan 2022 22:37:56 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 12FAA68019F; Wed, 5 Jan 2022 00:37:54 +0200 (EET) Received: from mail-qt1-f180.google.com (mail-qt1-f180.google.com [209.85.160.180]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9471868019F for ; Wed, 5 Jan 2022 00:37:47 +0200 (EET) Received: by mail-qt1-f180.google.com with SMTP id v22so35609952qtx.8 for ; Tue, 04 Jan 2022 14:37:47 -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=hLpt6pxtX86/TWpw5Anw7KmzZWT/T4kMplx9eJpdPDU=; b=dmz5JKxndtz269QcGB29h6e0cHjmHW+aHjIHB6JSxGQRWqo2LANo2AxINbSPZn2YR/ Kgo0RSVkBQe29TeDsIp6OP15EBDstYHPbEiQXfC2ux1CA+cVZtXidl+ugRQWl4zFb7WW /wxyXhu5f/EDVJ9Ps9SeMG9xm+6QQs/3/j150SBx+m0zDOUjdIMxalR3k1HRDjuWWbqb IaU+vFa2xKzU4+zpOuexorC634321YpZWHqanb05Ko22DfrFOp0hb68V7tptjkYGO+xm BDLOifr5au4gZ2/BnounM+QFGIe40oW1sFA99DP47cpj4NtLAE4PygEEOcV+xVbsv36/ ZsGA== 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=hLpt6pxtX86/TWpw5Anw7KmzZWT/T4kMplx9eJpdPDU=; b=5QLqW9OaF+17BhilEsdnHVqNJf3Lu5onmXR5YQT++TASstGMmc67G/fSlLiASl5o3J Y+rl8/3jajhXSjg6V4lGlf3OJd6VFJW92qXc7IGixHKQYR9lx2wWOmPwxsdUpz4Xpn5K O/iIGzjMNNwHg0yOWIuDmsRLd+Rw5V2lgkEB/Wbf5wvnc8s903/oU4MOVDaYlCeu0MGj cBC07gSFXOD87pMhlKkZq+CSDa4+vKiojfzCjQZeJaIYcpmPluDeI02rexWCY3EpoDod XCM0sxI9Pob/S5qEfzg32m9SCu3gfYaOkbNfsR/cyXfRW4TJFh4/XqKQ+ksOMOqQuJ8Q Rv/g== X-Gm-Message-State: AOAM533Zp/Cw9pqf/vhwgb4Ay9gnPkHYpKcVA6QrtzhtPJ/fipf8XZuI wu9PgXZeiLKRg/6VMH0PmtoSpQsuFgk= X-Google-Smtp-Source: ABdhPJwdRRo8qg5mxE8JL+kJIHkxeBRsIte2z61w1OZ+lllRwDs151MGGrK0+JnpDYUOrSH7wPv4cQ== X-Received: by 2002:ac8:5dd4:: with SMTP id e20mr47437595qtx.200.1641335865808; Tue, 04 Jan 2022 14:37:45 -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 u17sm31315029qko.133.2022.01.04.14.37.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jan 2022 14:37:45 -0800 (PST) Date: Tue, 4 Jan 2022 17:37:44 -0500 From: Andriy Gelman To: FFmpeg development discussions and patches Message-ID: <20220104223744.dd453vzueuzxtu7f@jackie> References: <20220104090836.31660-1-ming.qian@nxp.com> <20220104090836.31660-3-ming.qian@nxp.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220104090836.31660-3-ming.qian@nxp.com> Subject: Re: [FFmpeg-devel] [PATCH v5 3/7] avcodec/v4l2_context: add v4l2_start_decode 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: > on dynamic resolution change, > The decoding process must be resumed with either a pair of calls to > VIDIOC_STREAMOFF() and VIDIOC_STREAMON() on the CAPTURE queue, or a call > to VIDIOC_DECODER_CMD() with the V4L2_DEC_CMD_START command. > For the patch title, I think something like the following would be better: avcodec/v4l2_context: send start decode command after dynamic resolution change event I'll add that this fixes decoding of https://streams.videolan.org/ffmpeg/incoming/720p60.mp4 on RPi4. > Signed-off-by: Ming Qian > --- > libavcodec/v4l2_context.c | 18 ++++++++++++++++++ > 1 file changed, 18 insertions(+) > > diff --git a/libavcodec/v4l2_context.c b/libavcodec/v4l2_context.c > index dda5157698c3..a181f884d2a6 100644 > --- a/libavcodec/v4l2_context.c > +++ b/libavcodec/v4l2_context.c > @@ -153,6 +153,21 @@ static inline void v4l2_save_to_context(V4L2Context* ctx, struct v4l2_format_upd > } > } > > +static int v4l2_start_decode(V4L2Context *ctx) > +{ > + struct v4l2_decoder_cmd cmd = { > + .cmd = V4L2_DEC_CMD_START, > + .flags = 0, > + }; > + int ret; > + > + ret = ioctl(ctx_to_m2mctx(ctx)->fd, VIDIOC_DECODER_CMD, &cmd); > + if (ret) > + return AVERROR(errno); > + > + return 0; > +} > + > /** > * handle resolution change event and end of stream event > * returns 1 if reinit was successful, negative if it failed > @@ -190,6 +205,9 @@ static int v4l2_handle_event(V4L2Context *ctx) > s->capture.height = v4l2_get_height(&cap_fmt); > s->capture.width = v4l2_get_width(&cap_fmt); > s->capture.sample_aspect_ratio = v4l2_get_sar(&s->capture); > + } else { > + v4l2_start_decode(ctx); > + return 0; > } > > if (reinit) lgtm otherwise. 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".