From patchwork Tue Oct 18 16:53:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 38804 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4a86:b0:9d:28a3:170e with SMTP id fn6csp2206600pzb; Tue, 18 Oct 2022 09:54:13 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6dLvaQKzY9/zG0VcL0uvrZfip2UwQABbgTXOZ+4KFZNsij/CamxKGNiDPSiXIWXsu6Dqcz X-Received: by 2002:a17:907:7f25:b0:78d:e76a:ef18 with SMTP id qf37-20020a1709077f2500b0078de76aef18mr3213482ejc.378.1666112052746; Tue, 18 Oct 2022 09:54:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666112052; cv=none; d=google.com; s=arc-20160816; b=bJCTyEyeo4UnKJUdw3wnD/cM5A2TKy22nssn+/nwXga5Vn19YWevONWwOkwAx3HSyX OngPEm+0dP7IEi//Etw8A6u8FBWQjq2w+YKTZzh/92n77fE+uzxXU+sDV+MqrJN21K9t T+LK7SnwDyEEls11aovsinDVwF3yGYGjXjz9jU3PEVlHDIRYeuVBzYCCPITmMGaWCMi7 XO8KzO7aY3o0/O2OKDQnajomlafBwenYbCQsb3qRMIf3mfjbXA+NpBQZJfCnurhD+P/8 3cz7xyXPGT7hkFaBmkRRFbkPTgsOwgso39ZJ6owWOciOAC0P6ABybzmCDpoJ7ks2E5pd W2Vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=EOZlUCFAnWpm4Oyeu7C3dcFGJlQJBXJCqJUg81DHRdw=; b=hZzRl8TGUtHzITGbYhTJwxO4zJ1Ya35OH5PoVPErEEyRwDUXVHxBr8cWrRR3RRjrTn sasUGJwEuKHo60gtyRFVa31pH5l1obTFStp9hcyUiSLgqJm7Xs8hMBE8BWdt7JYEAUS0 w99lOYHmpCOjTAgVQefguTOt3+0aG3ZXOAqPUhYwgSR+nk6rs3fYJRF2nIozA6IBZBTt BI4rXMlRxt1v1cFPPgk1o9F8EDC9cKKuqM8sXrhF9W+YNP/tFoNs+bXLtBwcagOdeYZZ BhmFhVYhtxioPbnTclkFEPyAW+lEa2+BD175HCe+I6FQbj6ug7i1zxTNHyZZfeDHNzWY Kt4g== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id hr12-20020a1709073f8c00b00770872942d8si11409766ejc.958.2022.10.18.09.54.11; Tue, 18 Oct 2022 09:54:12 -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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4F70368BD47; Tue, 18 Oct 2022 19:54:07 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 563BA68BBFE for ; Tue, 18 Oct 2022 19:54:00 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id A02BB2404F8 for ; Tue, 18 Oct 2022 18:53:59 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id uEE_BBzck4Lm for ; Tue, 18 Oct 2022 18:53:58 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id CB67D2404F5 for ; Tue, 18 Oct 2022 18:53:58 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id C44523A13E9 for ; Tue, 18 Oct 2022 18:53:58 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Tue, 18 Oct 2022 18:53:07 +0200 Message-Id: <20221018165307.28242-4-anton@khirnov.net> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221018165307.28242-1-anton@khirnov.net> References: <20221018165307.28242-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 4/4] fftools/ffmpeg: set thread names 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 1nlAcCTWXSFg --- fftools/ffmpeg_demux.c | 9 +++++++++ fftools/ffmpeg_mux.c | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c index 6e89f5999a..487053c592 100644 --- a/fftools/ffmpeg_demux.c +++ b/fftools/ffmpeg_demux.c @@ -177,6 +177,13 @@ static void ts_fixup(InputFile *ifile, AVPacket *pkt, int *repeat_pict) *repeat_pict = av_stream_get_parser(ist->st)->repeat_pict; } +static void thread_set_name(InputFile *f) +{ + char name[16]; + snprintf(name, sizeof(name), "dmx%d:%s", f->index, f->ctx->iformat->name); + ff_thread_setname(name); +} + static void *input_thread(void *arg) { InputFile *f = arg; @@ -190,6 +197,8 @@ static void *input_thread(void *arg) goto finish; } + thread_set_name(f); + while (1) { DemuxMsg msg = { NULL }; diff --git a/fftools/ffmpeg_mux.c b/fftools/ffmpeg_mux.c index 2b70143978..778626e20f 100644 --- a/fftools/ffmpeg_mux.c +++ b/fftools/ffmpeg_mux.c @@ -184,6 +184,13 @@ static int sync_queue_process(Muxer *mux, OutputStream *ost, AVPacket *pkt) return 0; } +static void thread_set_name(OutputFile *of) +{ + char name[16]; + snprintf(name, sizeof(name), "mux%d:%s", of->index, of->format->name); + ff_thread_setname(name); +} + static void *muxer_thread(void *arg) { Muxer *mux = arg; @@ -197,6 +204,8 @@ static void *muxer_thread(void *arg) goto finish; } + thread_set_name(of); + while (1) { OutputStream *ost; int stream_idx;