From patchwork Sat Sep 10 19:32:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Furniss X-Patchwork-Id: 533 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.140.134 with SMTP id o128csp899994vsd; Sat, 10 Sep 2016 12:32:17 -0700 (PDT) X-Received: by 10.194.87.169 with SMTP id az9mr8414845wjb.81.1473535937068; Sat, 10 Sep 2016 12:32:17 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 17si8485979wju.18.2016.09.10.12.32.15; Sat, 10 Sep 2016 12:32:17 -0700 (PDT) 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=@gmail.com; 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 dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C6A80689F0E; Sat, 10 Sep 2016 22:32:01 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com [74.125.82.43]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E72E5689ED5 for ; Sat, 10 Sep 2016 22:31:55 +0300 (EEST) Received: by mail-wm0-f43.google.com with SMTP id w12so84293104wmf.0 for ; Sat, 10 Sep 2016 12:32:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=UYvYRD56aXAPSB6/67GzvdTiwoR4JUpFO1cajayYSos=; b=XKn6rHC7c3aOFZccImc8iIblkdmtF3gSh1aVpxIH//pk5BFau7HUt1ww/hShSdX12P uIVvk4doxmx+ns2wsx6Tiy1zszSerp9W0dYZz8G7/nahdntQsXLa+zn+ff3GXUNoSzd2 WIJrsl9wAmCygy3kRCIDnJNQmKQRI7QOb1L8n90IMtFR7SMAheOJg2mFncC1ByxSJBh3 z3JCE5Li5jMeRu23d0LY/0Gh8tFT3+vmPLxztO79828wM7OwhV9HIY2BhrC/3btpUpj4 mchsVebkhc9FMk2fJB59TXAE94dgwWwwwyS2bEXAiSY8A9LlG3RP6J3PpvqgrMxQ3zgQ E0HQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=UYvYRD56aXAPSB6/67GzvdTiwoR4JUpFO1cajayYSos=; b=OF1E5inWv0eVBzui5RKvi5S4+panQeBfI8+Hc8Tq2RcwqRZMpCeNDQrxtS9rZsX/mf TWkYIyfvLPGEigo9DIqTEpe7zoYdHUacRINJKBlJ/rLanRo89RNfQSGQs2yCyY3hOAB1 brh2Phc1RF2V6R/3JdUXet6PwIIyhVky4FdbRHgwUWzax/G8QP4eQkXDxxTYllD7nPUb RQZ438c4ppn45qhSjCbecCOWHIPo6NPE7zbOJN7fiFDeDX2YKVFSj81kOQuf8zJa7Am4 /YdGaH7K722erR7wWL2ffRgnsG7N6MCuvRO+U+eOIs4iaA+gSZ711aExykC/O3PUM4A7 iqqQ== X-Gm-Message-State: AE9vXwM7AvUvwb7mlo6GURvuSR4DTxmv2v1vNjFXAzovcT/4siYnVxWS0Y7vySC7bn6PRw== X-Received: by 10.28.169.142 with SMTP id s136mr3878194wme.95.1473535926391; Sat, 10 Sep 2016 12:32:06 -0700 (PDT) Received: from [192.168.0.3] (249.3.114.87.dyn.plus.net. [87.114.3.249]) by smtp.gmail.com with ESMTPSA id lj2sm9553260wjc.38.2016.09.10.12.32.05 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 10 Sep 2016 12:32:05 -0700 (PDT) To: ffmpeg-devel@ffmpeg.org References: <09abd4f5-7259-0901-6c64-e5fb9a8db2cf@sky.com> <2c366865-734c-298c-5af2-0745c68c6973@rothenpieler.org> <1c24bc26-cc94-4a39-187f-830583ea721e@sky.com> <57D136F5.6000108@gmail.com> <57D17304.6010206@gmail.com> <597b1048-a30a-25f8-65a2-fcccb19db888@sky.com> <57D1EDE4.4040203@gmail.com> <57D44457.4040002@gmail.com> <20160910175037.GA557112@phare.normalesup.org> <57D45569.6010800@gmail.com> From: Andy Furniss Message-ID: <57D45FB2.9030607@gmail.com> Date: Sat, 10 Sep 2016 20:32:02 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0 SeaMonkey/2.40 MIME-Version: 1.0 In-Reply-To: <57D45569.6010800@gmail.com> Subject: Re: [FFmpeg-devel] adding RGBA and BGRA to nvenc.c 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" Andy Furniss wrote: > Nicolas George wrote: >> I had an inkling that it was about the packet -> frame conversion, >> but it seems rawdec does the right thing in this particular case. >> Still, I suggest you add a quick debug av_log() in >> libavcodec/rawdec.c to check that need_copy is false. > > I shall have go later this evening. I did as below and for both -f null - and -f rawvideo -y /dev/null it says false. if (!frame->buf[0]) return AVERROR(ENOMEM); @@ -341,6 +344,7 @@ static int raw_decode(AVCodecContext *avctx, void *data, int *got_frame, buf = dst; } else if (need_copy) { + av_log(NULL, AV_LOG_ERROR, "ADF need_copy2 = true\n"); memcpy(frame->buf[0]->data, buf, buf_size); buf = frame->buf[0]->data; } diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c index 1259577..28a8fd0 100644 --- a/libavcodec/rawdec.c +++ b/libavcodec/rawdec.c @@ -248,10 +248,13 @@ static int raw_decode(AVCodecContext *avctx, void *data, int *got_frame, if ((res = av_image_check_size(avctx->width, avctx->height, 0, avctx)) < 0) return res; - if (need_copy) + if (need_copy) { frame->buf[0] = av_buffer_alloc(FFMAX(context->frame_size, buf_size)); - else + av_log(NULL, AV_LOG_ERROR, "ADF need_copy = true\n"); + } else { frame->buf[0] = av_buffer_ref(avpkt->buf); + av_log(NULL, AV_LOG_ERROR, "ADF need_copy = false\n"); + }