From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Akira Kyle 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 20:58:12 -0700 Message-ID: <86o8jnwgmj.fsf@akirakyle.com> References: <864kmzupp0.fsf@akirakyle.com> <86pn46awrr.fsf@akirakyle.com> <87y2ise7j5.fsf@gnus.org> <20201123234727.GA26836@breton.holly.idiocy.org> Mime-Version: 1.0 Content-Type: text/plain; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30254"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.4.13; emacs 28.0.50 Cc: Lars Ingebrigtsen , Akira Kyle , Arthur Miller , emacs-devel@gnu.org To: Alan Third Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Nov 24 04:58:50 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 1khPTe-0007iO-9o for ged-emacs-devel@m.gmane-mx.org; Tue, 24 Nov 2020 04:58:50 +0100 Original-Received: from localhost ([::1]:33218 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1khPTd-0008TV-BE for ged-emacs-devel@m.gmane-mx.org; Mon, 23 Nov 2020 22:58:49 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55462) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1khPT7-00081P-6r for emacs-devel@gnu.org; Mon, 23 Nov 2020 22:58:17 -0500 Original-Received: from mail-io1-f48.google.com ([209.85.166.48]:45209) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1khPT5-0007kt-DL for emacs-devel@gnu.org; Mon, 23 Nov 2020 22:58:16 -0500 Original-Received: by mail-io1-f48.google.com with SMTP id u21so20479408iol.12 for ; Mon, 23 Nov 2020 19:58:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=aDx1pplPXu01mr4Cv04URrn/at/gNdZ3vOzjSoQFZAY=; b=enH/x4rCRbfwgnnZD1ZRZwbA/mm4r/dsHU8FBPr5u9wGkekYQigXZ85PFqjbsjuB+G e8lwX6lJ05eZyh5rVxamJRUd/szONk66uSOnWTGLWLGpWU8/KToUUm8PC3zM8Mu/9K1m 3kj4WJi8q5QFEEz0YZacewUpiHBe8iLFoyflRRE30ojEB7pMxTEr8AvXeKd6zhr2J/E0 HPf2SmIBK5bi94dXeRUrll8hixzse3yy+zHWZ8aoFg3nhF+KwG6ghor4hQTLcM3+q8fp BfYSRoav7lL4q06IrPu/Pkrb/c8JckV/GQk+KqLlijDnT9oNUAMptqP1oIBn2DEtA0dp eFow== X-Gm-Message-State: AOAM531W6r0sZ+Do0yIgYl9MX4cGUhYiodDJsL7gAa8CRcOWgrvUH4DN Ynh1SDg+3HsN7gprUU3wpCeRW5U1T5+9mXjv X-Google-Smtp-Source: ABdhPJxdNRFr48ygJWsFWhPoCip/tI3xDK2PYOhcV1bL5DkCsjzvHJc5gkgjxdmft2agYnJgmizPPQ== X-Received: by 2002:a02:6a59:: with SMTP id m25mr2727755jaf.132.1606190294050; Mon, 23 Nov 2020 19:58:14 -0800 (PST) Original-Received: from data ([2601:281:8080:45f0:e0a5:922f:c6e9:c7eb]) by smtp.gmail.com with ESMTPSA id u16sm8492985ilj.6.2020.11.23.19.58.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Nov 2020 19:58:13 -0800 (PST) In-reply-to: <20201123234727.GA26836@breton.holly.idiocy.org> Received-SPF: pass client-ip=209.85.166.48; envelope-from=aikokyle@gmail.com; helo=mail-io1-f48.google.com X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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:259709 Archived-At: On Mon, Nov 23, 2020 at 04:47 PM, Alan Third 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. I second this and would also add that I think the emacs event loop would need modification as well, since my understanding is that it's pretty lazy, rendering things only when it needs to. So while its good that mpv wouldn't demand taking over the event loop, I think emacs might really struggle to display video frames at 30fps without some modifications or work around.