Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1387589rwd; Sat, 27 May 2023 16:56:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5j4lpfRWuVXLl04IAa1ot2KTyK1UPofKucYxriR0bDygO38hl9Pl1d89XmI3RQTDRrzbAe X-Received: by 2002:a17:90b:118a:b0:24e:2248:31c with SMTP id gk10-20020a17090b118a00b0024e2248031cmr6768938pjb.22.1685231763495; Sat, 27 May 2023 16:56:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685231763; cv=none; d=google.com; s=arc-20160816; b=QQCyWOxZnbWTCqo8rUCx2m5ldFBowFp1rWOzZ/7z1hb0ivCnxKPm7DaQwae1f62HKN 9Xw/rnOirirVvHvxb6ubU/9OXR+2D+1Q1dotcr3az2pkk63OhvAIC+P2WInmiND4OPxA LKxqjm2pMxaM78kco/0ROyzG8xX77AgYhN8Eo9+QLV3ya+or2sB9+bmyEG1BRR+Jsoz0 ij2JDhbC+ZOsV97xsNDtPnawz8WmcpRCktZ+6F7eNp5ylyySJeKPe76OaIGEyOzPsi7F vBt+Ymf7FmPlUnf8AcOUN+YO9lWBe1rACGZBwsEyNuM8tM97EwkozxvSNdoMK83y1wFN gf6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=L6xYUZJ8iVcW3BpQIbPt8WWQzk8DcOdbdHRGC/mMYeA=; b=Aut35sZj2JZJPouduk5+F7xz0CxPJawmnzUg0oZ/63IcFM7lcT+S544LJVIZQdd40/ Q0lDoCEGb0zIUm8w7qOYg0WaXZU4zBkf+hKzyOnGmjw4mbR1GqbIXR5Ld/OSVkwNM4G5 iDc4DlRg2Y+LenXfyq7rhrPQPhuriV81E2CBNKLSBhUkhcKS190H6pBJHXLs/1BdN4UA MO67kWFOz/YttKArNNyK+sLRKiQve8WUkACTbnwJddJWiSCJA3rXsXD3VLqOrgwdToLv TeOSYYncw/I+hrcLBbhOP1gotOCDcNFoYdMGCoMKKXdwQ5Gz90ir73FgM4I3OXMlRNvm EdKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=Jlhlo7id; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lt17-20020a17090b355100b0024770f5087csi7925978pjb.120.2023.05.27.16.55.33; Sat, 27 May 2023 16:56:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=Jlhlo7id; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229501AbjE0XPQ (ORCPT + 99 others); Sat, 27 May 2023 19:15:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229437AbjE0XPP (ORCPT ); Sat, 27 May 2023 19:15:15 -0400 Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65D75B1 for ; Sat, 27 May 2023 16:15:14 -0700 (PDT) Received: by mail-lj1-x22a.google.com with SMTP id 38308e7fff4ca-2af225e5b4bso20238491fa.3 for ; Sat, 27 May 2023 16:15:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685229312; x=1687821312; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=L6xYUZJ8iVcW3BpQIbPt8WWQzk8DcOdbdHRGC/mMYeA=; b=Jlhlo7idKKu5KAnN4tARG5uVba0XztCxaCs1cPzemwXWz+3FG8qYED7aCRuysMp3l3 D6NaFUvmMgxYOjjHaVBpFx+gJw6xt7c5gCCYHtF6PY8U6cADXlrZAoDDnPvJgC7H7s0Q PRi5D3fTCjISxN98jspoFv/EYpD2site9nPjsTHigvFjenn5NRMnrIxdj10uNYPrAZFw dqyD2Sez0qFyoo1U441oWYW7Y6Hmdsi+eSCwRFzEjHJlgtzwaLJttBb+ntlxkZTu+OjX nZJzAR7DGMM+pXL8kxmJiPMOFNOoC5Q5xvA7UMWNqopmb+A5Je3ABUK1ZNE9lkibmvpn YctA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685229312; x=1687821312; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=L6xYUZJ8iVcW3BpQIbPt8WWQzk8DcOdbdHRGC/mMYeA=; b=U00/gP+7QUGGzCvTE0IdbrYLgkinFwNurjme/YkEPoK5eMCFF/Np3oiM4uTEzJGouc oIHboSk889lQndsKblrTumROtghvl0OjPgUsNULgN0yBEnG4hRYifaquSBSvRW+YGxTb 3HHGWj8cqtJHZ65j1GO/Yt+rArsOj0o3IfWD/bZW2XpVkSqMN5VzZPwB2OIJP5LZ18r9 v/3leBJFGnxrF1HL01foFsI2Aj3fen5e9DvfdiFEzj1ou9ekhe/uxcZSLhq0OjGr09mh vRCPj00ysh9eylcCbLQv7TaYll+YrS3syvptmpiQJyS42EQSpZaEJM/k6ldpN7Vwn5RM fIwA== X-Gm-Message-State: AC+VfDxkzVAD0iACbcSErsYF8oqFiC0t4W4tTcwtOsMMjdF5Lmlev49w yyibMndkI5c4Ude5sj6YxLwCoU+w75UMPA== X-Received: by 2002:a2e:894b:0:b0:2af:2826:b20d with SMTP id b11-20020a2e894b000000b002af2826b20dmr3257799ljk.13.1685229312079; Sat, 27 May 2023 16:15:12 -0700 (PDT) Received: from localhost.localdomain (188.146.125.123.nat.umts.dynamic.t-mobile.pl. [188.146.125.123]) by smtp.gmail.com with ESMTPSA id d17-20020a2e3611000000b002b0488ef239sm1649404lja.93.2023.05.27.16.15.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 May 2023 16:15:11 -0700 (PDT) From: Arkadiusz Bokowy To: linux-bluetooth@vger.kernel.org Cc: Arkadiusz Bokowy Subject: [PATCH BlueZ] media: Register app objects in proxy_added_cb() Date: Sun, 28 May 2023 01:14:58 +0200 Message-Id: <20230527231458.673167-1-arkadiusz.bokowy@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org The proxy_added_cb() function is called every time a new client is added to the application object manager. Registering media endpoint and player in that proxy_added_cb() callback function will allow to register new endpoints and players not only during the initial RegisterApplication call, but also during the application lifetime. For instance, this might allow to dynamically enable/disable support for additional codecs. --- profiles/audio/media.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/profiles/audio/media.c b/profiles/audio/media.c index 6ce668e31..4c42b7817 100644 --- a/profiles/audio/media.c +++ b/profiles/audio/media.c @@ -2821,9 +2821,6 @@ static void client_ready_cb(GDBusClient *client, void *user_data) goto reply; } - queue_foreach(app->proxies, app_register_endpoint, app); - queue_foreach(app->proxies, app_register_player, app); - if (app->err) { if (app->err == -EPROTONOSUPPORT) reply = btd_error_not_supported(app->reg); @@ -2867,6 +2864,10 @@ static void proxy_added_cb(GDBusProxy *proxy, void *user_data) path = g_dbus_proxy_get_path(proxy); DBG("Proxy added: %s, iface: %s", path, iface); + + app_register_endpoint(proxy, app); + app_register_player(proxy, app); + } static bool match_endpoint_by_path(const void *a, const void *b) -- 2.30.2