[Asterisk-code-review] Add data buffer API to store packets. (asterisk[15])

Joshua Colp asteriskteam at digium.com
Wed Mar 21 12:19:09 CDT 2018


Joshua Colp has posted comments on this change. ( https://gerrit.asterisk.org/8604 )

Change subject: Add data buffer API to store packets.
......................................................................


Patch Set 4:

There's two use cases for this. The one currently being tackled is for a buffer for RTP sending, where you are asked for an arbitrary packet and retransmit it. New packets get added, old ones go away.

For this case where you always have n number of packets in the buffer then caching data structures that you know you are going to end up using is a good. Thus why I originally stuffed a cache in there.

The second case is where you are reordering received packets - in this case you do take the head of the buffer out (or potentially wait a bit for other packets to come in so it gets reordered). I don't think we should try to make this API support this just yet until it is further fully worked out and used.

As is made evident, trying to keep both in mind at once confuses things. It may even be that we can't reuse the data butter for the receive case (although I THINK we can with an API addition).

Using a different data structure is possible - for example a vector - but the complexity goes up. You either have to enforce that position starts at 0 and goes up (which pushes mapping logic into res_rtp_asterisk to sustain that) or you have to establish some kind of mapping internally so that you know your index.


-- 
To view, visit https://gerrit.asterisk.org/8604
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 15
Gerrit-MessageType: comment
Gerrit-Change-Id: Iff13c5d4795d52356959fe2a57360cd57dfade07
Gerrit-Change-Number: 8604
Gerrit-PatchSet: 4
Gerrit-Owner: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Matthew Fredrickson <creslin at digium.com>
Gerrit-Comment-Date: Wed, 21 Mar 2018 17:19:09 +0000
Gerrit-HasComments: No
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180321/8cc4a913/attachment.html>


More information about the asterisk-code-review mailing list