Git Product home page Git Product logo

Comments (7)

ystreet avatar ystreet commented on September 18, 2024

What if, we had a stateful builder for a list of packets (returned through an iterator) that kept track of at least the sequence number and allowed editing each packet's other header values (marker, csrc, timestamp, extension data, etc) while generating a payload with a FnMut. That would allow the reading side to (dynamically) put as many bytes as it wants into the rtp payload.

On the generating side, a trait to write into whatever the user provided would probably be best here.

Maybe something like: https://gist.github.com/ystreet/ad93b54c02885583385e86f2ea6889eb

from rtp-types.

sdroege avatar sdroege commented on September 18, 2024

Having Boxes in there seems like a bad idea because of the additional heap allocations.

For writing, this doesn't allow e.g. to append a gst::Memory as payload and then when writing it out creating a gst::Buffer that contains the header in a new gst::Memory and the payload just refs the original gst::Memory another time.

from rtp-types.

ystreet avatar ystreet commented on September 18, 2024

The idea is to use the same RtpPacketListBuilder for multiple packets. e.g. a complete video frame. If you are only generating a single packet, then the existing approach is fine already.

Can certainly add a separate push_payload function and associated generics on the RtpWriter trait for the separate header and payload concern.

from rtp-types.

sdroege avatar sdroege commented on September 18, 2024

I'll later have to read your suggestion more carefully then, I think I didn't understand it :)

from rtp-types.

ystreet avatar ystreet commented on September 18, 2024

Updated gist has a version with a RtpWriter::push_payload() with a generic lifetime that seems to work.

from rtp-types.

tp-m avatar tp-m commented on September 18, 2024

I don't need any fancy gst::Buffer or gst::Memory stuff at this point btw, I just want to be able to generate/writeout N bytes into place directly with a closure or whatever without first writing it all into an intermediary buffer and then having the builder copy it over. (e.g. to swizzle some bytes during payloading)

from rtp-types.

ystreet avatar ystreet commented on September 18, 2024

Custom extension/payload data and modifying payload data on the fly should be reasonably possible now with #10.

More specific use-cases can be discussed in new issues.

from rtp-types.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.