From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Third Newsgroups: gmane.emacs.devel Subject: Re: Introducing emacs-webkit and more thoughts on Emacs rendering (was Rethinking the design of xwidgets) Date: Mon, 23 Nov 2020 23:47:27 +0000 Message-ID: <20201123234727.GA26836@breton.holly.idiocy.org> References: <864kmzupp0.fsf@akirakyle.com> <86pn46awrr.fsf@akirakyle.com> <87y2ise7j5.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33171"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Lars Ingebrigtsen , Akira Kyle , emacs-devel@gnu.org To: Arthur Miller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Nov 24 00:48:14 2020 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 1khLZ8-0008Wu-Hy for ged-emacs-devel@m.gmane-mx.org; Tue, 24 Nov 2020 00:48:14 +0100 Original-Received: from localhost ([::1]:34158 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1khLZ7-0008Aq-EN for ged-emacs-devel@m.gmane-mx.org; Mon, 23 Nov 2020 18:48:13 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45364) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1khLYa-0007lc-9W for emacs-devel@gnu.org; Mon, 23 Nov 2020 18:47:40 -0500 Original-Received: from wilbur.contactoffice.com ([212.3.242.68]:48382) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1khLYX-0005k5-KR for emacs-devel@gnu.org; Mon, 23 Nov 2020 18:47:39 -0500 Original-Received: from smtpauth1.co-bxl (smtpauth1.co-bxl [10.2.0.15]) by wilbur.contactoffice.com (Postfix) with ESMTP id 805F416EA; Tue, 24 Nov 2020 00:47:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1606175252; s=20200222-6h9o; d=idiocy.org; i=alan@idiocy.org; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:Content-Type:In-Reply-To; l=2046; bh=IXqTp1qN+aMsBYcVeoc9T4z/enebOReBbn80qPez9GM=; b=AfiNXMPypqbUnkdaMu3kCBVCklCPuCO7B8WH1XmVHLtcnJooxwTc0wLaFyXerwDa MArxLA/OKHYT2bM+OSBGiDYjkiLnPrC85UkshPQYOeLkauIrwNrzT33VFl7+3PFPuHg sE3uXQxVSolK+FTxBP1DOfo4xz9B6x4p25Fbx6UAqDvTVdhk22RRv9ZFVImYalrhtVQ aKzE01E7t9wcTNNMl8UfaRqa6RyNxYVEMHCQZBMbm0gNxFqrYw2Q9AE2qcOXWanIokQ Pwlhqhw8Mlt4Lh5cA5JWBOfOTq8ujWtMRBWb6UfOH+CLfwk4zmNCsox48l3cZo4Zflz 7fno3rBRgQ== Original-Received: by smtp.mailfence.com with ESMTPA ; Tue, 24 Nov 2020 00:47:29 +0100 (CET) Original-Received: by breton.holly.idiocy.org (Postfix, from userid 501) id 8D71C2026870D6; Mon, 23 Nov 2020 23:47:27 +0000 (GMT) Mail-Followup-To: Alan Third , Arthur Miller , Lars Ingebrigtsen , Akira Kyle , emacs-devel@gnu.org Content-Disposition: inline In-Reply-To: X-ContactOffice-Account: com:241649512 Received-SPF: pass client-ip=212.3.242.68; envelope-from=alan@idiocy.org; helo=wilbur.contactoffice.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:259705 Archived-At: On Mon, Nov 23, 2020 at 03:59:31PM +0100, Arthur Miller wrote: > Just a curious question: have you ever looked at libmpv? > Would it be possible to embedd video via livmpv in an image container > just as jpg, png etc? > > libmpv is a C library for mpv player ment to be embedded, and works in > all 3 major desktop platforms. > > https://github.com/mpv-player/mpv-examples/tree/master/libmpv > > Mpv itself comes with crap-load of video codecs and image formats already > built-in; it is a fork mplayer2. What is good, if one could create a > OpenGL context for an Emacs window (X11/Win32 Window - shouldn't be > hard), you could controll rendering directly, since they don't take over > your even loop: > > "You will have to simulate this with the mouse/keypress/keydown/keyup commands." > > It would probably fit into Emacs well. > > I don't know myself how to implement "new image format" for Emacs; too > much to look through the spaghetty of if-defs in image.c, IIRC it's actually possible to load videos using the imagemagick backend, the trouble is that Emacs can't really handle them as it decodes and stores each frame individually. Emacs has no way to "remember" where it is in a file, as each image is loaded and stored individually. For example, to display an animated gif Emacs opens the file, decodes frame one, closes the file and then displays the frame. When asked to display frame two it opens the file, decodes frame two (which in the case of a gif involves decoding frame one again) closes the file and displays it. To display frame three it opens the file, decodes frame three (which involves decoding frames one and two again), closes the file and displays it. And so on and so on. I think it's like this because it was only intended for displaying occasional graphics like the fringe bitmaps and similar, and, IMHO, to do anything different would require a major overhaul of image.c, and probably the lisp image API while maintaining backwards compatibility. -- Alan Third