From: Lynne <dev@lynne.ee> To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> Subject: Re: [FFmpeg-devel] [PATCH 2/3] hwcontext_vulkan: add queue and frame locking functions Date: Tue, 5 Apr 2022 16:16:24 +0200 (CEST) Message-ID: <Mzu4M6e--3-2@lynne.ee> (raw) In-Reply-To: <164915152261.21047.1253226111359045378@lain.red.khirnov.net> 5 Apr 2022, 11:38 by anton@khirnov.net: > Quoting Lynne (2022-04-03 16:52:24) > >> +#include <pthread.h> >> > > 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".
next prev parent reply other threads:[~2022-04-05 14:16 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-04-03 14:51 [FFmpeg-devel] [PATCH 1/3] hwcontext_vulkan: expose image queue families Lynne [not found] ` <MzjuD2p--3-2@lynne.ee-MzjuHsU----2> 2022-04-03 14:52 ` [FFmpeg-devel] [PATCH 2/3] hwcontext_vulkan: add queue and frame locking functions Lynne 2022-04-05 9:38 ` Anton Khirnov 2022-04-05 14:16 ` Lynne [this message] [not found] ` <MzjuQ-Z--3-2@lynne.ee-MzjuTDW----2> 2022-04-03 14:53 ` [FFmpeg-devel] [PATCH 3/3] lavu: bump version and add APIchanges for Vulkan API changes Lynne [not found] ` <MzjuZff--3-2@lynne.ee-Mzjubs4--J-2> 2022-04-03 15:49 ` [FFmpeg-devel] [PATCH] hwcontext_vulkan: properly enable sync2 and make prepare_frame compatible Lynne
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=Mzu4M6e--3-2@lynne.ee \ --to=dev@lynne.ee \ --cc=ffmpeg-devel@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git