From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu Newsgroups: gmane.emacs.devel Subject: Re: GStreamer xwidget Date: Tue, 23 Nov 2021 15:07:08 +0800 Message-ID: <87sfvn5p0j.fsf@yahoo.com> References: <87ee7cq2mu.fsf.ref@yahoo.com> <87ee7cq2mu.fsf@yahoo.com> <87zgpzp80c.fsf@yahoo.com> <87czmvtf68.fsf@gnus.org> <87czmunkmo.fsf@yahoo.com> <8735noajkl.fsf@yahoo.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8886"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.60 (gnu/linux) Cc: larsi@gnus.org, emacs-devel@gnu.org To: Richard Stallman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Nov 23 08:08:10 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mpPuU-000221-AP for ged-emacs-devel@m.gmane-mx.org; Tue, 23 Nov 2021 08:08:10 +0100 Original-Received: from localhost ([::1]:54558 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mpPuS-0000QI-7X for ged-emacs-devel@m.gmane-mx.org; Tue, 23 Nov 2021 02:08:08 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:39816) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mpPti-0007T2-Li for emacs-devel@gnu.org; Tue, 23 Nov 2021 02:07:22 -0500 Original-Received: from sonic304-20.consmr.mail.ne1.yahoo.com ([66.163.191.146]:40970) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mpPtd-0006Er-TG for emacs-devel@gnu.org; Tue, 23 Nov 2021 02:07:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1637651236; bh=mvWH1gHCAnalT5DG/jyid9JXHNUUQFAgDTvS5CfcATQ=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=DevH0jBLhagn8CABYY7EhkazD7/Qx9CNRW1uMNWFgN+h27kByN1GhVJwLOsnJLVUTaqzyxWmZaLAJ5LRzmZdy1nQs6jJIHWuIFaZ7R4rVTNCS4kdWVS8/a7hVebnFRwwCP34g8lYKjZV7SxRNP609EYtqlYR7ADQVDQL6Noj3+ca2qJN7K1sqrKbBqxCY7AKMuKk08q7BOzrjinpW289UaS3biYoEBuHOw1ZbWkTCQZP+N8cymI0rbVTkb41A2XEs5K4fe3l/f8R17RdFhW/0yjrUiqk4y+s1gBpLMP3/9p0GjEWwTzZmj9P5RbKUzLCO1AvtozUoIBGiLEzDOI5eA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1637651236; bh=kDIrhR7o+DUYDlpFIlAY5feRUcAefzkG01YHVE2oTdp=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=EiGFRaTklx8KM0Emp7wSAEzuLX58XnoNPcvThiaT9QDEHQPi8usdfFYDz2hYFWKp3dn7IHE2seYvGK0A5Yyvb0YM/VOrTOpplVj8wGn0fU4cBOunYZcWRLiSCJQod9+6zbThCCckqvpsuym07842FPHJ+/kFTKORmJW6uji80gAKZa4jMawfYLqzGABO7BOvLmQUqqgwB+VioXusA/pshyybPpPdBXSm9ooyVUr+qCcDu2yRDLf4gNQ7j6iU9AON7OFxe6YT9icV63K0PnyAmrfWlm52XSzluZ3H0V2OafsESYIRc5wwMlNvkm+HLzCadx7B/F/y9DUaHKdkZ0IXkQ== X-YMail-OSG: vsCHAZ4VM1l7WQW0IHEepRBytT6Kbzyw0GdcX7rnKWNBN878SXCBAQnUdPhIGWX gDk50YMDxYkMELgYXTpjufTOc562INbrOVn0qhzu75VCiZbYUmZaLwzqZ1BnG2cl4MILeNZTu.Tj iN6XctHrTHygn.DGzjXuEgF60TgAnDTwclKwJiT.JOV.d9Ie4vLm6zY35mM3LLItNEo0u1TzHV3U d30L4OS.lLK1jQ71..moK525bqCPGvkYH8M27RuUt7hAz3MgBR7WICEk1EP1L6d383gGy_i6c7_X 0Irg9aC0gN1h3hCvIU3XCWP2Ekdzc5d2dVzpxZ0hpv0vUm2U6miwhU.5DcZroF.fDJedKKQ7EFQn BjTYiz.PY6cnXOR1WbWJscUILoSKV.ts1wfeejlfgAm6xaTBB0j6GB2yYLhGIq.7X855GoOsXWJS JADWEr70cA27kRZID2S8MfrXU8mDyKr0d__a7IGmyKl5oc5exy9VUeeiUhCr9yG.Ek9eee6mILz5 GxshsQUO.rJdPvl0wZun2wIPwf3jIVpIF67ErY4LGK5a2uArTzQW6fhnKgGDiTq9QLhXRzBNMKuM z0JbP_G7PkWrZkDvqGGsE7Qc6IFy3MammeF7ilWNPm.._ldYCaeiETSvGo04eBHkimV6pSDkQdpj tnfrCBv_t6N88TZbrDPztbgiUIKVXvaEUb.Mie_OUEkLtTAR_dTn13XYCARigEX4hYYGiu5loFYr BtlMkq4TaBEDDbSJob74kqWOC9HxkY4475YSD4rK7MI197cl2cC7JQPgXPTBOeYoqhD_Cyf3U8eR 5IjwvmFlGBkmrkfR_KuDNQufNWaSPXquWc6p9O9jJj X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.ne1.yahoo.com with HTTP; Tue, 23 Nov 2021 07:07:16 +0000 Original-Received: by kubenode512.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID e8c525cfc45c202f681a4d3e6a1e85c8; Tue, 23 Nov 2021 07:07:12 +0000 (UTC) In-Reply-To: (Richard Stallman's message of "Tue, 23 Nov 2021 01:11:39 -0500") X-Mailer: WebService/1.1.19306 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=66.163.191.146; envelope-from=luangruo@yahoo.com; helo=sonic304-20.consmr.mail.ne1.yahoo.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:279937 Archived-At: Richard Stallman writes: > Can you please show me precisely how Emacs would specify which plugins > to load? What are the specifications of the interface? What does the > code actually look like? If it uses any macros, what does it > macroexpand into? Here's how one would create a GStreamer element (and in doing so load a plugin): GstElement *element = gst_element_factory_make ("factoryname", NULL); Where "factoryname" is the name of the element factory you want. GStreamer will then find and load the shared library containing the plugin that provides an element by that name, and then use it to create the GstElement. Obviously, creating a GstElement is insufficient, because for it to be useful one will inevitably have to connect it to something, and configure it. For configuration, GstElements use GObject properties, so if I created an element of the type "tee", provided by `gst-plugins-base', and I wanted to configure it to work without any other element being attached to it, I would set the property named "allow-not-linked" to `TRUE' as follows: GstElement *tee = gst_element_factory_make ("tee", NULL); g_object_set (G_OBJECT (tee), "allow-not-linked", TRUE, NULL); Where `g_object_set' is provided by the GObject library (an object system for C that is free software, developed by GNOME) and `G_OBJECT' is a macro that casts `tee' from GstElement to the type named `GObject' after checking at run-time that the type of `tee' is correct. Then, I have to put it in a GstBin (which is a container for various GstElements) like so: gst_bin_add (GST_BIN (bin), tee); Where `gst_bin_add' is a function provided by the GStreamer library, `bin' is the bin, and `GST_BIN' is a cast macro similar to `G_OBJECT', but checks that `bin' is of the type `GstBin' instead of `GstObject'. Afterwards, I will have to "link" (note that this has nothing to do with linking programs with object files) `tee' to some other element that displays its output, like such: gst_element_link (tee, that_other_element); Thanks.