From patchwork Sat Mar 18 03:56:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?WXVuZmVpIERvbmcgKOiRo+S6kemjnik=?= X-Patchwork-Id: 71550 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp117980wrt; Fri, 17 Mar 2023 21:04:38 -0700 (PDT) X-Google-Smtp-Source: AK7set/yY01A3hfKbZNlCGEcTg/QZlsbCga5OtxFNMEz8R1Jc4uAvB6krgwo2ITqYdT7KWsHYbDQ X-Received: by 2002:a05:6a20:3d89:b0:cc:fced:f740 with SMTP id s9-20020a056a203d8900b000ccfcedf740mr11858822pzi.0.1679112278467; Fri, 17 Mar 2023 21:04:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679112278; cv=none; d=google.com; s=arc-20160816; b=Q6K+cPitAOfKWCk7l4JLYX3ZiMQ6oUGzJgqAHZNmjtdqHAywIjGP98lcRgY7FhqyiX qwFPAqQibyN+/pgQIxgLOB+afLO6/wpUQiXcd45lj3wPdMQTHEkmnBp3GQ7hJl1vv9b4 Px9Y5KDYXjavNPxgRGMCf1vFgt5cMOosz+2MBYIZsBc9JfoQnEU+ckcaILvGSyohqPgN G6/XT1oVCcK4psaho3tSDf3+rxD81GHyHEz3CSjvdrdFDN8zOgrJXGEoW6MdR9X4CNx/ ZhObouJcAuHIl7euQSIiN3D5Jd2fpOQpOWhk+vQ/fI4aLEJr27k1SWujp+Q37g44ppts EwRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=w7qxzHJ9OUqVOD3dN5cCe1joMzyhA01hfu1aWr/0RaU=; b=E+llmJsJCmkJwt21UqY/OrtASik5dcqAymd+UkdU1e4fkmkM/dzNhhFAE4j5APfTLw MMagKToxejlp63P2eY8Di0B9Gd5uI3ziOsW6PqWILyiAcWRtxiT7XaKO0cL68LYtgPos 4wymuJSeaJyBOWs1JqNwJhwhVIQR32E9rA5Q08F9iiaIOr2Uo4UOrOOff3wjdD/9GdC3 tqIla+HDl2SglX2Tbiy+0pmxbw329waxWtPI9ts7DexInnazq2L9pI1qXkJaeCQAn0Ku Y7rSw7XjROrKqAwVO46rbOjpwJx2OTVSGKr85LcsoZbrHKZkqdeP+sUj9HV1hMlKVNfX 4NfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=rXMaKEqB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z3-20020aa79f83000000b005a8a56ac57esi4022437pfr.246.2023.03.17.21.04.26; Fri, 17 Mar 2023 21:04:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=rXMaKEqB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229943AbjCRD5J (ORCPT + 99 others); Fri, 17 Mar 2023 23:57:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229602AbjCRD5G (ORCPT ); Fri, 17 Mar 2023 23:57:06 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95CAD8ABFF; Fri, 17 Mar 2023 20:57:04 -0700 (PDT) X-UUID: eccf5aeec54011edbd2e61cc88cc8f98-20230318 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=w7qxzHJ9OUqVOD3dN5cCe1joMzyhA01hfu1aWr/0RaU=; b=rXMaKEqBmJKsDZANeYJEHu4SiT1TqZjm4BGfZiTh1lsSkhioqRQiQtcmPTR5pAsAuQzHSnH0dX+flL1/3oiNGiH4NiKAuK/HKoUEuaxWUSP0WMpKE3RXSKy7nCJN0DNmbZIYguf+enWaH8JQ2+I3xHn2U5lnFcXPKm0C+1G3OxI=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.21,REQID:81598128-9a66-467a-bdc4-73c1944b7de8,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:83295aa,CLOUDID:f35d9cb3-beed-4dfc-bd9c-e1b22fa6ccc4,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-UUID: eccf5aeec54011edbd2e61cc88cc8f98-20230318 Received: from mtkmbs11n2.mediatek.inc [(172.21.101.187)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 2130231030; Sat, 18 Mar 2023 11:56:55 +0800 Received: from mtkmbs13n2.mediatek.inc (172.21.101.108) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.25; Sat, 18 Mar 2023 11:56:54 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs13n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.25 via Frontend Transport; Sat, 18 Mar 2023 11:56:53 +0800 From: Yunfei Dong To: Yunfei Dong , Chen-Yu Tsai , Nicolas Dufresne , Hans Verkuil , AngeloGioacchino Del Regno , Benjamin Gaignard , =?utf-8?q?N=C3=ADcolas?= =?utf-8?q?_F_=2E_R_=2E_A_=2E_Prado?= CC: Matthias Brugger , Hsin-Yi Wang , Fritz Koenig , Daniel Vetter , Steve Cho , , , , , , Subject: [PATCH v5,1/2] media: mediatek: vcodec: Make MM21 the default capture format Date: Sat, 18 Mar 2023 11:56:50 +0800 Message-ID: <20230318035651.27454-1-yunfei.dong@mediatek.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760676836278120771?= X-GMAIL-MSGID: =?utf-8?q?1760676836278120771?= Given that only the MM21 capture format is supported by userspace tools (like gstreamer and libyuv), make it the default capture format. This allows us to force the MM21 format even when a MM21 and MT21C capable firmware is available (which is needed while dynamic format switching isn't implemented in the driver), without causing the following regressions on v4l2-compliance: fail: v4l2-test-formats.cpp(478): pixelformat 3132544d (MT21) for buftype 9 not reported by ENUM_FMT test VIDIOC_G_FMT: FAIL fail: v4l2-test-formats.cpp(478): pixelformat 3132544d (MT21) for buftype 9 not reported by ENUM_FMT test VIDIOC_TRY_FMT: FAIL fail: v4l2-test-formats.cpp(478): pixelformat 3132544d (MT21) for buftype 9 not reported by ENUM_FMT test VIDIOC_S_FMT: FAIL Fixes: 7501edef6b1f ("media: mediatek: vcodec: Different codec using different capture format") Signed-off-by: Yunfei Dong Reviewed-by: Nicolas F. R. A. Prado Tested-by: Nicolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno --- changed with v4: - change the patch order. - re-write the title and commit message for patch 1. --- .../platform/mediatek/vcodec/mtk_vcodec_dec_stateless.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_stateless.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_stateless.c index 04beb3f08eea..3000db975e5f 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_stateless.c +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_stateless.c @@ -392,14 +392,14 @@ static void mtk_vcodec_get_supported_formats(struct mtk_vcodec_ctx *ctx) if (num_formats) return; - if (ctx->dev->dec_capability & MTK_VDEC_FORMAT_MM21) { - mtk_vcodec_add_formats(V4L2_PIX_FMT_MM21, ctx); - cap_format_count++; - } if (ctx->dev->dec_capability & MTK_VDEC_FORMAT_MT21C) { mtk_vcodec_add_formats(V4L2_PIX_FMT_MT21C, ctx); cap_format_count++; } + if (ctx->dev->dec_capability & MTK_VDEC_FORMAT_MM21) { + mtk_vcodec_add_formats(V4L2_PIX_FMT_MM21, ctx); + cap_format_count++; + } if (ctx->dev->dec_capability & MTK_VDEC_FORMAT_H264_SLICE) { mtk_vcodec_add_formats(V4L2_PIX_FMT_H264_SLICE, ctx); out_format_count++; From patchwork Sat Mar 18 03:56:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?WXVuZmVpIERvbmcgKOiRo+S6kemjnik=?= X-Patchwork-Id: 71551 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp126108wrt; Fri, 17 Mar 2023 21:38:12 -0700 (PDT) X-Google-Smtp-Source: AK7set9CEx28gggQXk+Tzd/hnMjmDJVETfyE56jviUTGoJrt/kC/vtIrPJePCvqUoa6ESW0xnKIh X-Received: by 2002:a05:6a20:6997:b0:d7:19b3:a9c5 with SMTP id t23-20020a056a20699700b000d719b3a9c5mr8319784pzk.6.1679114291878; Fri, 17 Mar 2023 21:38:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679114291; cv=none; d=google.com; s=arc-20160816; b=pzdfkTAWim+4zNaRAX/o2K7ubFo8QawZgC9Ei/3PYQD6HpZzz7yTyRP7+XZH7JrgvO DC9wiUwrGoAh3NEXxEhIuLKYghoz8Vj4ifOUKfzsP1PS7HnyRCAjzSRfjaSt8YE9eKRw +r+MAg6dukt0R+1elCeYyqymP4c9wjNftEJa8twrOsskxhjN2Ueecbq8ejbZrTv3k2t6 0uF4o44TmkwNiV/MeXp1osis/v9kdXCXS7g2HHJvL2XjrxYQkNfKXFvHo+YH8RdXKQL/ uetR/RAWWtZaFn8lYb2VRyGw46r/ixmOR+SzdVePBhdR55KXzApBEZed7VE7wlVY8UVr gYbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=nmAJCU4vEFZ4NeWXnt6p2mWQtYOq1ViTVxlUuDegioA=; b=P5DeP6STwfCL/lJA9WsfAJlBfRfiqfUqUb0DwGYMcx72YgNhhboCYXND7vZJnjoihE xTQH4WdodJstOGg5XD6kSJw08xE0XeJQvBspfmqLPxFG5e60+0bE0MYU/nvGARBva35N Eu/8DhQNiJfUn9OexN033kYeWjzOBpSqURh//pUBd1M/W3Sh119L1+l3Bm95JQu7cc5M 3ZC5JoK3pr1TJgH3JKHPbdbrEl/3xsc+sni+CkMfZh3S8OBfYMZ9EwVyijHS+aJ41ZGj GCT8vhyMxPXr4eNhHLT9LnKpYN1dHtYEPi982igk2HZPKP71KPdEhlzLiKt5yQSSJugz 7AnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=mUnXwjIH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lx15-20020a17090b4b0f00b0023d464d2b0fsi4580057pjb.144.2023.03.17.21.37.57; Fri, 17 Mar 2023 21:38:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=mUnXwjIH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229886AbjCRD5H (ORCPT + 99 others); Fri, 17 Mar 2023 23:57:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229599AbjCRD5F (ORCPT ); Fri, 17 Mar 2023 23:57:05 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24CF988EDF; Fri, 17 Mar 2023 20:57:01 -0700 (PDT) X-UUID: ed5a1b3ec54011ed91027fb02e0f1d65-20230318 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=nmAJCU4vEFZ4NeWXnt6p2mWQtYOq1ViTVxlUuDegioA=; b=mUnXwjIHecHwq0H64ZqLKaszh2gy0bEjtDM6kj3uvV26/ZO2K8QfZAijBqdqptI12QDZuO5ETr0RFHaMd7qZsf4vPNNJJtctMDGMqv4nLMo3GQ5Ym9AX+Wm4tKJ5AbnMmTsw8HfWOQjwCfm++VblH47Zj1/A8TbVfyY0bQ900II=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.21,REQID:f9bba031-a555-4386-b33c-d81efa65a1bf,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:83295aa,CLOUDID:ed5d9cb3-beed-4dfc-bd9c-e1b22fa6ccc4,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-UUID: ed5a1b3ec54011ed91027fb02e0f1d65-20230318 Received: from mtkmbs11n2.mediatek.inc [(172.21.101.187)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 435376119; Sat, 18 Mar 2023 11:56:56 +0800 Received: from mtkmbs13n2.mediatek.inc (172.21.101.108) by mtkmbs11n1.mediatek.inc (172.21.101.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.25; Sat, 18 Mar 2023 11:56:55 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs13n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.25 via Frontend Transport; Sat, 18 Mar 2023 11:56:54 +0800 From: Yunfei Dong To: Yunfei Dong , Chen-Yu Tsai , Nicolas Dufresne , Hans Verkuil , AngeloGioacchino Del Regno , Benjamin Gaignard , =?utf-8?q?N=C3=ADcolas?= =?utf-8?q?_F_=2E_R_=2E_A_=2E_Prado?= CC: Matthias Brugger , Hsin-Yi Wang , Fritz Koenig , Daniel Vetter , Steve Cho , , , , , , Subject: [PATCH v5,2/2] media: mediatek: vcodec: Force capture queue format to MM21 Date: Sat, 18 Mar 2023 11:56:51 +0800 Message-ID: <20230318035651.27454-2-yunfei.dong@mediatek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230318035651.27454-1-yunfei.dong@mediatek.com> References: <20230318035651.27454-1-yunfei.dong@mediatek.com> MIME-Version: 1.0 X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760678947784411567?= X-GMAIL-MSGID: =?utf-8?q?1760678947784411567?= While the decoder can produce frames in both MM21 and MT21C formats, only MM21 is currently supported by userspace tools (like gstreamer and libyuv). In order to ensure userspace keeps working after the SCP firmware is updated to support both MM21 and MT21C formats, force the MM21 format for the capture queue. This is meant as a stopgap solution while dynamic format switching between MM21 and MT21C isn't implemented in the driver. Fixes: 7501edef6b1f ("media: mediatek: vcodec: Different codec using different capture format") Signed-off-by: Yunfei Dong Reviewed-by: Nicolas F. R. A. Prado Tested-by: Nicolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno --- .../platform/mediatek/vcodec/mtk_vcodec_dec.c | 24 +++---------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c index 641f533c417f..c99705681a03 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c @@ -39,10 +39,9 @@ static bool mtk_vdec_get_cap_fmt(struct mtk_vcodec_ctx *ctx, int format_index) { const struct mtk_vcodec_dec_pdata *dec_pdata = ctx->dev->vdec_pdata; const struct mtk_video_fmt *fmt; - struct mtk_q_data *q_data; int num_frame_count = 0, i; - bool ret = true; + fmt = &dec_pdata->vdec_formats[format_index]; for (i = 0; i < *dec_pdata->num_formats; i++) { if (dec_pdata->vdec_formats[i].type != MTK_FMT_FRAME) continue; @@ -50,27 +49,10 @@ static bool mtk_vdec_get_cap_fmt(struct mtk_vcodec_ctx *ctx, int format_index) num_frame_count++; } - if (num_frame_count == 1) + if (num_frame_count == 1 || fmt->fourcc == V4L2_PIX_FMT_MM21) return true; - fmt = &dec_pdata->vdec_formats[format_index]; - q_data = &ctx->q_data[MTK_Q_DATA_SRC]; - switch (q_data->fmt->fourcc) { - case V4L2_PIX_FMT_VP8_FRAME: - if (fmt->fourcc == V4L2_PIX_FMT_MM21) - ret = true; - break; - case V4L2_PIX_FMT_H264_SLICE: - case V4L2_PIX_FMT_VP9_FRAME: - if (fmt->fourcc == V4L2_PIX_FMT_MM21) - ret = false; - break; - default: - ret = true; - break; - } - - return ret; + return false; } static struct mtk_q_data *mtk_vdec_get_q_data(struct mtk_vcodec_ctx *ctx,