From patchwork Sat Jan 6 08:46:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "LongChair ." X-Patchwork-Id: 7154 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.78.2 with SMTP id r2csp325225jaa; Sat, 6 Jan 2018 00:46:38 -0800 (PST) X-Google-Smtp-Source: ACJfBotwVuFzuYHa/WXwihKKIhL02plUCBePcYaR6/Swi/P/JJ/p2C3ZCokiOBWTw/XhV787RRxy X-Received: by 10.28.139.5 with SMTP id n5mr4071452wmd.23.1515228398173; Sat, 06 Jan 2018 00:46:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515228398; cv=none; d=google.com; s=arc-20160816; b=CphVr3V5j6I6MBxHAoRkIGYxqhCNFkj1aJoxUTlW6Hgh8jK4ZlsntcamqI0S35tbA3 VkSbukg3b6oD3hhbCxGFtmcqOICj3uSz8Pb4j87KOnH9HNSRMZz9Fde3woWwXShtQAud 3s0Uas4FnUEJBOA5tmZUxea/GPQngozNRnNfDCrkt6OOXDqO8hCbASGMVkpE6l+HefHO 92k2GSTxw7PaAQRkNrcozypdhBygvaC0SAf7Yod1tJMtkdQ5ClE8hV1D+YsS1Muf/WN6 AaYLNYpR42f82+TkwDRJeh7NuH6lZGxEZwakrQKDaLYa3NNDPNmkcWLBh5gjp7Iw/nyl OPFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:spamdiagnosticmetadata:spamdiagnosticoutput :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:to:from:dkim-signature:delivered-to :arc-authentication-results; bh=yFsS13sK3I5O1b2nnO7t89paJRBXcrrgwisbbVaMdvA=; b=P0jzMYXoTwnjYGvD/CeLp7JbFvy1YmWaiIDwdwm/qky5dx6iEljZH+BJOTpxdGqwSf C7O2xn3eAYkSkiXf+6hHqc/OS0M5HQ20gYS8ZKvHsvqjrB5z+/dI8H8tlbZ4g9FZVwTU fkwoy0hsIQE3mr362ptS7UHqFmGBf0SbLDdIzJrm4hfk0QGu5v6sLGcRQlflSelO9y0m /nAiABrE/8WT0VEeeao/jhagDZCQBV63f8nHzS9ymcrZglxD3ZcgNSVEopB8S5zi6dhA qiV1aPA2Hb9oibKl4DrJio1AQkRgyUk1jRFu4vEO8Po+G9nKiOWMueMko1I6035yb7Bl Hp9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@hotmail.com header.s=selector1 header.b=MYPihucR; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=hotmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id r7si4608105wmc.49.2018.01.06.00.46.37; Sat, 06 Jan 2018 00:46:38 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@hotmail.com header.s=selector1 header.b=MYPihucR; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=hotmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 97F90689A63; Sat, 6 Jan 2018 10:46:35 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-oln040092002057.outbound.protection.outlook.com [40.92.2.57]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B2D01689992 for ; Sat, 6 Jan 2018 10:46:28 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=dP5vP4kM1BkV5LZiQcTyqFLBQqpkJqC8VLBnI8PTsfU=; b=MYPihucRhVyE4YSlNWYzpbusSb4TIy/Sgt6eCArANJRg76LhEwNCz1Uz9nVtfTkWUUH+q9lAiHeNJSm68l1SWxrajBUVXDc3pQnvlXySAF+xrx8BS8QsgF9WZcRFJMJwCj7EbyKqdFfcMohy3FwG7vkVuJ/CxSA/LtzGPx8FbEYYy92CPOMytGdeWcWEjAjt+7NRGdQNxkjE6b8/c9rl8EIMN2aNXFQSessxTyQwMyWml34fVZeo4q4mKElp0Q9fjMVYLFS7+UqEL/QOp9CUZVUT3yJLLhl1QTMaxu2ow+kuM58+TXRIBu+n+q8RIdXDgX63a10FAReJt61eVIFJIg== Received: from BY2NAM01FT055.eop-nam01.prod.protection.outlook.com (10.152.68.59) by BY2NAM01HT173.eop-nam01.prod.protection.outlook.com (10.152.68.193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.302.6; Sat, 6 Jan 2018 08:46:26 +0000 Received: from MWHPR17MB1614.namprd17.prod.outlook.com (10.152.68.55) by BY2NAM01FT055.mail.protection.outlook.com (10.152.68.122) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.20.345.12 via Frontend Transport; Sat, 6 Jan 2018 08:46:26 +0000 Received: from MWHPR17MB1614.namprd17.prod.outlook.com ([10.173.242.16]) by MWHPR17MB1614.namprd17.prod.outlook.com ([10.173.242.16]) with mapi id 15.20.0386.006; Sat, 6 Jan 2018 08:46:26 +0000 From: "LongChair ." To: "ffmpeg-devel@ffmpeg.org" Thread-Topic: [FFmpeg-devel] avcodec/rkmpp : Fix broken build and remove some useless code Thread-Index: AQHThle5QVmdmSIGs0WfNXl3DYAgvaNlp4CAgAAAtACAAAJ4AIAABeAAgADYaIA= Date: Sat, 6 Jan 2018 08:46:26 +0000 Message-ID: References: <20180105201923.4cb77887@debian> <20180105203044.306e02ec@debian> In-Reply-To: Accept-Language: fr-FR, en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:035116C2770C01828B11FFB7EF45F8109BBB8A1A9EDD3E2797EF1F7C2D06959D; UpperCasedChecksum:E1611D28D66AF9B68E48A39D279A257B821ACD6CB118245E5BC06A17F4EE382D; SizeAsReceived:7381; Count:46 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [KBCsfAVy1m5ha00UicJj5Yc+jwJrvVRO] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; BY2NAM01HT173; 6:qHmdlxwMOm2/NZT7ascX+FA31PQ+MtpuHeWeLKHnVrs/CaArlhwKBESq3j1NR8WE6xdd4vxXs9LYdVOOSR257aAk5KBCkD0h6Ccb/dOXyiwmPQ9RuApVujp0AqaNXpGdkz2Vze2KNL9hLZAEQdFZc1D+6We2EGXM/kz66GSPBNyEBbxe8aPaAyGXSe1qOTGDC4W6VkY2XpngSBT9JI1k0getRMbo/bQBgPlrZeLCry+eVCknfrakifOkRp0ZsDeDwH3WOr+wEO5V0Ij0i9CRQcTVwJwHH4W3Kim8U1AF7Mjh8Mr7i1N0att+Wvlo9PL7wFiPOFeJhu8uJK1soLj/fuOJbZqK26iRuuS57FK4HDw=; 5:V+XzZo0SJPHsTXNKhZFsm7DFVMP87E9XoLIn5yW1GKf5X8RdE2E2YhNAw9YgoUV1L5pIZTdDfw5BB53GOXOmaunpaj+q40UIe3Zn3+gmfCn6xB+t3UjdCNYOksS+zg/MmgVgYQRycsjujPjrFnia9goTGtti+iL44rMi2q3nY+o=; 24:EOzDdJLJJzewiERLkrFpueSi+SzH+12f7B4xOHm8yDd8snyreoJVUsM5n+32kWrqwlpKu5N0hGIAHGykQ/KpB958NkHFueGJBSVHtCca+1c=; 7:y5uR3EpFpOZP0Bc4tKuWg0L3d0Cv3x1RB91eMwffEpH9lX9ELax2WkY8OuJ1JuJfbpptnPxVB/TG/IELZfwL8CIyfH9RyIvt6Td7AVH7FVrMZqGkp2N3OTufD5X+a9Tqy4W3kBdUGB75WYltfta5gxqnhnJo4fVR5+Ma37CdbEyJuntd4zeWDcxdBXB8UgTlw1klZvXdVpDy3D/UAUgrG0y+TermEthecrMYQIUF5A+icdl2Kn1OMfiA9t4h7ASP x-incomingheadercount: 46 x-eopattributedmessage: 0 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(201702061074)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031324274)(2017031323274)(2017031322404)(1603101448)(1601125374)(1701031045); SRVR:BY2NAM01HT173; x-ms-traffictypediagnostic: BY2NAM01HT173: x-ms-office365-filtering-correlation-id: 23b0b0ac-4e90-43cd-0aba-08d554e1f890 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(444000031); SRVR:BY2NAM01HT173; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:BY2NAM01HT173; x-forefront-prvs: 0544D934E1 x-forefront-antispam-report: SFV:NSPM; SFS:(7070007)(98901004); DIR:OUT; SFP:1901; SCL:1; SRVR:BY2NAM01HT173; H:MWHPR17MB1614.namprd17.prod.outlook.com; FPR:; SPF:None; LANG:; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: hotmail.com X-MS-Exchange-CrossTenant-Network-Message-Id: 23b0b0ac-4e90-43cd-0aba-08d554e1f890 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Jan 2018 08:46:26.3920 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2NAM01HT173 Subject: Re: [FFmpeg-devel] avcodec/rkmpp : Fix broken build and remove some useless code X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Here are two updated patches. I have added the current version check to 1.3.7 and removed the header check for control operation. On 05/01/2018 20:51, LongChair . wrote: > Yes this was bound to very old versions afaik. > > Mpp repo was squashed and we didn't have any version requirement > > Current version is 1.3.7, if i trust my repo fork, previous version was > 1.0.0, so we could add that as a requirement. > > > On 05/01/2018 20:30, wm4 wrote: >> On Fri, 5 Jan 2018 19:22:00 +0000 >> "LongChair ." wrote: >> >>> Yes the newly used  control operation seems to have always been there >>> anyways, so there shouldn't be much compatibility issues. >> I mean the second patch removes a workaround for some old misbehavior, >> right? So it should probably be made sure that the user can't use an >> old version. >> >> Also please avoid https://en.wikipedia.org/wiki/Top_posting#Top-posting >> on the list. >> _______________________________________________ >> ffmpeg-devel mailing list >> ffmpeg-devel@ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel From 9b42a3c7f1230d001743099e9930f26a06ca6cf5 Mon Sep 17 00:00:00 2001 From: LongChair Date: Tue, 2 Jan 2018 12:38:01 +0100 Subject: [PATCH] avcodec/rkmpp : remove stream start retries before first frame. those were needed because of some odd mpp behavior that seems to have been fixed. Makes the code cleaner. --- libavcodec/rkmppdec.c | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/libavcodec/rkmppdec.c b/libavcodec/rkmppdec.c index 946b827918..143d05bd51 100644 --- a/libavcodec/rkmppdec.c +++ b/libavcodec/rkmppdec.c @@ -47,7 +47,6 @@ typedef struct { MppApi *mpi; MppBufferGroup frame_group; - char first_frame; char first_packet; char eos_reached; @@ -329,28 +328,14 @@ static int rkmpp_retrieve_frame(AVCodecContext *avctx, AVFrame *frame) MppBuffer buffer = NULL; AVDRMFrameDescriptor *desc = NULL; AVDRMLayerDescriptor *layer = NULL; - int retrycount = 0; int mode; MppFrameFormat mppformat; uint32_t drmformat; - // on start of decoding, MPP can return -1, which is supposed to be expected - // this is due to some internal MPP init which is not completed, that will - // only happen in the first few frames queries, but should not be interpreted - // as an error, Therefore we need to retry a couple times when we get -1 - // in order to let it time to complete it's init, then we sleep a bit between retries. -retry_get_frame: ret = decoder->mpi->decode_get_frame(decoder->ctx, &mppframe); - if (ret != MPP_OK && ret != MPP_ERR_TIMEOUT && !decoder->first_frame) { - if (retrycount < 5) { - av_log(avctx, AV_LOG_DEBUG, "Failed to get a frame, retrying (code = %d, retrycount = %d)\n", ret, retrycount); - usleep(10000); - retrycount++; - goto retry_get_frame; - } else { - av_log(avctx, AV_LOG_ERROR, "Failed to get a frame from MPP (code = %d)\n", ret); - goto fail; - } + if (ret != MPP_OK && ret != MPP_ERR_TIMEOUT) { + av_log(avctx, AV_LOG_ERROR, "Failed to get a frame from MPP (code = %d)\n", ret); + goto fail; } if (mppframe) { @@ -366,7 +351,6 @@ retry_get_frame: avctx->height = mpp_frame_get_height(mppframe); decoder->mpi->control(decoder->ctx, MPP_DEC_SET_INFO_CHANGE_READY, NULL); - decoder->first_frame = 1; av_buffer_unref(&decoder->frames_ref); @@ -480,7 +464,6 @@ retry_get_frame: goto fail; } - decoder->first_frame = 0; return 0; } else { av_log(avctx, AV_LOG_ERROR, "Failed to retrieve the frame buffer, frame is dropped (code = %d)\n", ret); @@ -560,7 +543,6 @@ static void rkmpp_flush(AVCodecContext *avctx) ret = decoder->mpi->reset(decoder->ctx); if (ret == MPP_OK) { - decoder->first_frame = 1; decoder->first_packet = 1; } else av_log(avctx, AV_LOG_ERROR, "Failed to reset MPI (code = %d)\n", ret); -- 2.14.1