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 DA44B4289E for ; Tue, 5 Apr 2022 14:16:33 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 43D8468B0B4; Tue, 5 Apr 2022 17:16:31 +0300 (EEST) Received: from w4.tutanota.de (w4.tutanota.de [81.3.6.165]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BCBBB68A3F4 for ; Tue, 5 Apr 2022 17:16:24 +0300 (EEST) Received: from w3.tutanota.de (unknown [192.168.1.164]) by w4.tutanota.de (Postfix) with ESMTP id 57A5F106016F for ; Tue, 5 Apr 2022 14:16:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1649168184; s=s1; d=lynne.ee; h=From:From:To:To:Subject:Subject:Content-Description:Content-ID:Content-Type:Content-Type:Content-Transfer-Encoding:Content-Transfer-Encoding:Cc:Date:Date:In-Reply-To:In-Reply-To:MIME-Version:MIME-Version:Message-ID:Message-ID:Reply-To:References:References:Sender; bh=sQl9CcxhCU6HW/Pj5tRdsF4AgEJB9qMnM7v1VlMIXxk=; b=VfxmzbptB3uAwG5u3NaMfG98FbIlWV1ThhEcXKlPpgQ6SH5S9NIUNruQIJeSdlIV bkNKhaZar2waqWZngTNDMaXicCQIDkQGSRVontyvREWoErueV9oktjQ1dQnk9+m+Yni BQgHLEVRvCZ+Qv+UO4kXxu1EZJzF0BFdSutxF6g+Jckg2peOa262wyqypORhW05kKmn OzK7eAIoM0rcTZo5EDRvNuZzv7RNhmwpG5Zt4jf5nVtBOEBEFc6mmfpTbsh4jYPnV5L FjZzP+tmBnPWk6cQ4cGnn6asxjEMMEJHdRbMc6912M3UO8pGISmmV1ISfCY5OmQauAr 9lQt6g7PdA== Date: Tue, 5 Apr 2022 16:16:24 +0200 (CEST) From: Lynne To: FFmpeg development discussions and patches Message-ID: In-Reply-To: <164915152261.21047.1253226111359045378@lain.red.khirnov.net> References: <164915152261.21047.1253226111359045378@lain.red.khirnov.net> MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH 2/3] hwcontext_vulkan: add queue and frame locking functions 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: 5 Apr 2022, 11:38 by anton@khirnov.net: > Quoting Lynne (2022-04-03 16:52:24) > >> +#include >> > > Either make vulkan depend on threads or make this all conditional somehow. > I'll make it optional. The locking functions would do nothing in that case, with a note for the API user. >> @@ -4129,7 +4209,19 @@ static int vulkan_frames_derive_to(AVHWFramesContext *dst_fc, >> >> AVVkFrame *av_vk_frame_alloc(void) >> { >> - return av_mallocz(sizeof(AVVkFrame)); >> + AVVkFrame *f = av_mallocz(sizeof(AVVkFrame)); >> + if (!f) >> + return NULL; >> + >> + f->internal = av_mallocz(sizeof(*f->internal)); >> > > Doxy says AVVkFrame can be freed with av_free. > That's already been broken, since if an API user passed an AVVkFrame to map from a CUDA, it would allocate the internal field anyway. What about making the internal field its own struct which would live in AVFrame->buf[1]? That way, it would get free'd on av_frame_free(). The AVVkFrame field would get deprecated. > I'd expect some prescription for who calls this and when. Like > "Any users accessing any queues associated with this device MUST call > this callback before manipulating the queue and unlock_queue() after > they are done." > > Same for lock_frame() > Will add stricter notes. >> + */ >> + void (*lock_queue)(AVHWDeviceContext *ctx, int queue_family, int index); >> > > any reason those are signed? > Not really, I can change them into uint32_t's, as that's what Vulkan functions take. >> + >> + /** >> + * Similar to lock_queue(), unlocks a queue. Must only be called after it. >> > s/similar/complementary/ > Fixed. _______________________________________________ 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".