<html><head></head><body>Hi,<br><br>As long as everyone uses the same or interoperable API for threads, it doesn't matter if they are the same. We already have code using POSIX or Win32 threads and code using atomic waits. Some underlying libraries probably use other custom mechanisms.<br><br>(I considered forking the VLC thread code out to reuse elsewhere, but it's still not so trivially dependent on other VLC portability layers.)<br><br>Same points apply to sockets as well.<br><br>Now if Rust does not provide adequate facilities, you can wrap VLC code. But for the most part, I would expect that it's not afflicted with the same legacy run-time issues than C. Mostly we should wrap the relevant VLC object types, IMO.<br><br><div class="gmail_quote">Le 20 août 2020 14:05:56 GMT+02:00, Thomas Guillem <thomas@gllm.fr> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">I think we could port some VLC Core API to Rust like:<br>- vlc_stream<br>- socket/network/i11e<br>- thread<br><br>I think it's important for socket and thread since it's better to use only one implementation for those in one application.<br><br>For this example, if the vlc_stream API was ported, the Rust API could have a Demux() function like VLC demuxes and the Rust code would take care of reading its own stream.<br><br>On Thu, Aug 20, 2020, at 13:16, Steve Lhomme wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">On 2020-08-20 13:08, Alexandre Janniaux wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;">Hi,<br><br>On Thu, Aug 20, 2020 at 12:27:43PM +0200, Steve Lhomme wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #8ae234; padding-left: 1ex;">On 2020-08-20 11:02, Romain Vimont wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #fcaf3e; padding-left: 1ex;">On Thu, Aug 20, 2020 at 10:13:05AM +0200, Steve Lhomme wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #e9b96e; padding-left: 1ex;">On 2020-08-19 17:22, Alexandre Janniaux wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ccc; padding-left: 1ex;"> Hi,<br><br> On Wed, Aug 19, 2020 at 05:04:08PM +0200, Rémi Denis-Courmont wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ccc; padding-left: 1ex;">And then I would expect that the interface from Rust is not ad-hoc, but rather wrapping the plugin API directly.<br></blockquote> I'm not sure to understand this correctly.<br><br> Does it mean that rust should use vlccore function for the plugin<br> behaviour, or that the plugin should directly expose itself without<br> a C wrapper, or something else?<br></blockquote>Have generic Rust code that handles the VLC filter API and then each filter<br>be written in Rust without caring of the C binding.<br></blockquote>This is basically what Geoffroy Couprie did few years ago:<br><a href="https://www.youtube.com/watch?v=YTy_JOxGOd4">https://www.youtube.com/watch?v=YTy_JOxGOd4</a><br></blockquote> " i skipped the video because of the french accent."<br><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #fcaf3e; padding-left: 1ex;">This is great, but the problem IMO is that it is too intrusive in<br>practice: wrapping the core API (which is not "stable" like libvlc) in<br>Rust implies that every core API change must be reflected to the<br>wrapper/bindings (+ not all C developers are Rust developers).<br></blockquote> I wasn't talking about the core but the plugins. Each plugin type would be a<br> Rust "class".<br><br> The plugin API's are rather stable compared to the core API. And the Rust<br> binding for each plugin type would be responsible to talk to the core. Just<br> like we update plugins when we change their API or the core API.<br></blockquote>What you seems to write is basically write this module in<br>pure rust without C wrapper then, right?<br></blockquote>yes the minimum is done in C, just to plug the core to the module/plugin <br>API. On the other hand it becomes tricky to call VLC core API's from <br>Rust, which this module doesn't seem to need. But eventually some module <br>may need to do that.<hr>vlc-devel mailing list<br>To unsubscribe or modify your subscription options:<br><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br></blockquote><hr>vlc-devel mailing list<br>To unsubscribe or modify your subscription options:<br><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a></pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>