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 1510343598 for ; Mon, 18 Jul 2022 12:24:27 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 101C668B8AA; Mon, 18 Jul 2022 15:24:26 +0300 (EEST) Received: from mail-oa1-f50.google.com (mail-oa1-f50.google.com [209.85.160.50]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4BA5468B8A0 for ; Mon, 18 Jul 2022 15:24:20 +0300 (EEST) Received: by mail-oa1-f50.google.com with SMTP id 586e51a60fabf-10d4691a687so7836259fac.10 for ; Mon, 18 Jul 2022 05:24:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to:content-transfer-encoding; bh=K3FCPDxOpMODUPuCgLMymOYy8lOINmk7dBmRnqWn7jQ=; b=hxrn4YG5le5IklyHF817KpA+pP12uvxYvNoDW2GGiWW1BkJkw74w5HpI39k7RUH7X4 Z3MKJHWU4KV8VfRcpn5NL+j1luaHBDyA1EQfyEqAcmPjRwFxIsOBUDw0vnTP/Qhv4lLA TPoWamqG7BrYoDAQCpkIV8AzEpxmzRJUOw3yGZSHhMwq+gBmMQ5KovaeGos7/pMQkb5Q 5piHM1Y+eai7iDB5esecXHmHJPHg7czcY9EgrDOjqN/ii9e1O4sOnzzyQ93xZKZlxrDk EdRfKvBMS0e+XRdDUJTvgSoS2sxaUs22E40i3VeFzSy8P9tlgeEy4QAhTyXKzPsUMfu5 NpIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=K3FCPDxOpMODUPuCgLMymOYy8lOINmk7dBmRnqWn7jQ=; b=UK3knto/LKbyWdpc/ChSGwJ9NFKIRbMzmjiWI+7N/TwEltYqtyzAubu5T0NJ1ltpAy MoqnpYdX1cpdTlcmTkVc0pEuxPFuXJ3bLf0dHGgTLE+j2mLJ5rtLrsn26edE96zMZCmv 7Ei5YnzKetylldVbUlS400Az1HDN41B519+vTruAWu8ajSd9PpMlFklHStGvzD1ZOCvF u8fr89QcqLy4wcl4NE5FjgjtYzdZAAZhugUxywF7HTLN6DMMmSXCq77hZpB8XtS2ZPz8 DLqXKfhHYWzHd1tP9po8TB7Y3NmJ8+fygN0Lu0I3x9Bne5JZyU3aqHyLpmNLpaa0ukal YnSg== X-Gm-Message-State: AJIora/S3F2RDt4RqLieV4gkmBiMiRtOfy62iy7WuS0xqMa+3dcOCoGG CCThWZaZuXtLUrgPFXC8ysX9lXJinujBSA== X-Google-Smtp-Source: AGRyM1ue5U9m3WCkf3daE2qzLbsux4ue+B+eFwMrvojS67prQj4z27pjAC7FE95uQv0xFfE41TuAJQ== X-Received: by 2002:a05:6870:430b:b0:f2:ca00:e775 with SMTP id w11-20020a056870430b00b000f2ca00e775mr17418802oah.288.1658147058296; Mon, 18 Jul 2022 05:24:18 -0700 (PDT) Received: from [192.168.0.13] ([186.136.131.204]) by smtp.gmail.com with ESMTPSA id c5-20020a056830000500b0061ca5495cc2sm901035otp.30.2022.07.18.05.24.17 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 Jul 2022 05:24:17 -0700 (PDT) Message-ID: Date: Mon, 18 Jul 2022 09:24:21 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: <20220717192700.1077-1-anton@khirnov.net> From: James Almer In-Reply-To: <20220717192700.1077-1-anton@khirnov.net> Subject: Re: [FFmpeg-devel] [PATCH 1/4] lavu/frame: allow calling av_frame_make_writable() on non-refcounted frames 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 7/17/2022 4:26 PM, Anton Khirnov wrote: > This is an easy way to make a refcounted frame from a non-refcounted > one. > --- > doc/APIchanges | 5 +++++ > libavutil/frame.c | 3 --- > libavutil/frame.h | 3 ++- > libavutil/version.h | 2 +- > 4 files changed, 8 insertions(+), 5 deletions(-) > > diff --git a/doc/APIchanges b/doc/APIchanges > index f9a1484bbc..4e218af94e 100644 > --- a/doc/APIchanges > +++ b/doc/APIchanges > @@ -14,6 +14,11 @@ libavutil: 2021-04-27 > > API changes, most recent first: > > +2022-07-xx - xxxxxxxxxx - lavu 57.30.100 - frame.h > + av_frame_make_writable() may now be called on non-refcounted > + frames and will make a refcounted copy out of them. > + Previously an error was returned in such cases. > + > -------- 8< --------- FFmpeg 5.1 was cut here -------- 8< --------- > > 2022-06-12 - 7cae3d8b76 - lavf 59.25.100 - avio.h > diff --git a/libavutil/frame.c b/libavutil/frame.c > index 4c16488c66..7408817e1f 100644 > --- a/libavutil/frame.c > +++ b/libavutil/frame.c > @@ -542,9 +542,6 @@ int av_frame_make_writable(AVFrame *frame) > AVFrame tmp; > int ret; > > - if (!frame->buf[0]) > - return AVERROR(EINVAL); > - > if (av_frame_is_writable(frame)) > return 0; > > diff --git a/libavutil/frame.h b/libavutil/frame.h > index 33fac2054c..cc55d67e3c 100644 > --- a/libavutil/frame.h > +++ b/libavutil/frame.h > @@ -818,7 +818,8 @@ int av_frame_is_writable(AVFrame *frame); > * Ensure that the frame data is writable, avoiding data copy if possible. > * > * Do nothing if the frame is writable, allocate new buffers and copy the data > - * if it is not. > + * if it is not. Non-refcounted frames behave as non-writable, i.e. a copy > + * is always made. > * > * @return 0 on success, a negative AVERROR on error. > * > diff --git a/libavutil/version.h b/libavutil/version.h > index f185322550..734d3f8330 100644 > --- a/libavutil/version.h > +++ b/libavutil/version.h > @@ -79,7 +79,7 @@ > */ > > #define LIBAVUTIL_VERSION_MAJOR 57 > -#define LIBAVUTIL_VERSION_MINOR 29 > +#define LIBAVUTIL_VERSION_MINOR 30 > #define LIBAVUTIL_VERSION_MICRO 100 > > #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ LGTM. _______________________________________________ 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".