[vlc-devel] RIST Protocol: remove old rist modules and add new ones based on the librist library
Sergio M. Ammirata, Ph.D.
sergio at ammirata.net
Sat Apr 18 19:26:42 CEST 2020
Who owns the memory space was a topic of much internal
On the sender side (access_output module):
We have to keep the data around for a long time (every
packet for 1 second or more depending on settings) to
fulfill re-trasmissions requests. This requirement forces
to use our own fifo and copy the data out of the calling
app into our fifo as soon as we get it.
That being said, we could take the approach you suggest and
loop internally within the library to "split" it into the
proper packet sizes there and save one or more memcpy
operations outside. I will make that change and re-submit.
On the receiver side (access module):
We have two ways to pass data to the calling app and we
left both in the code for comments. One uses a callback and
one uses a poll with a timeout against a fifo of length of
1000. In either case, we pass a pointer to the fifo
structure (a rist_data_block) to the app and save a memcpy
internally as these fifos our only freed during library
shutdown (data is valid for 1000 packets). Technically, the
app could use the data pointer directly without a memcpy
with the caveat that if it takes too long to process it
(1000 packets later), the data they read would belong to a
much newer packet and other unpredictable results would
Regarding the callback vs poll, I think poll matches the
architecture of the "BlockRist" loop better than having the
additional overhead of a fifo (unless I missed something).
Feedback/thoughts are welcome.
From: Ilkka Ollakka <ileoo at videolan.org>
Reply-To: Mailing list for VLC media player developers <
vlc-devel at videolan.org>
To: Mailing list for VLC media player developers <
vlc-devel at videolan.org>
Subject: Re: [vlc-devel] RIST Protocol: remove old rist
modules and add new ones based on the librist library
Date: Sat, 18 Apr 2020 17:04:31 +0300
On Fri, Apr 17, 2020 at 08:09:35PM -0400, Sergio M.
Ammirata, Ph.D. wrote:
I have created a new fork with just two commits to make
iteasy to read. One commit deletes the old modules and
thenext one creates the new ones.Can I get some feedback
please? I am ready to submit amerge request.
Didn't yet read the whole module code through, but I
spotted thatmodules use memcpy on quite core of write/read
functions, in most casesit means that they do lot of small
copies. And in littlebit later youcheck the side you have
on creating rist_buffer and writing.
On BlockRist this looks like only way to do it for now, as
libristdoesn't seem to support providing own allocation
function. So similarapproach that is used in in avcodec-
modules doesn't seem to be possible.
In access_output/rist.c:Write, Why not just queue blocks as
they are andwrite block at a time (and reduce it if it
doesn't fit), as you anywayloop until the buffer is empty?
That looks like possible approach,unless I missed something
on how librist handles given buffers?
mailing listTo unsubscribe or modify your subscription
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the vlc-devel