You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make frame pooled and holding reference to a buffer, also pooled.
This will allow to create queues/ring buffers of frames, reuse existing buffers (e.g. attach buffer from packet directly to a frame), and reuse existing frames (e.g. return same frame twice).
This is also needed to be able to return frame of different size than requested and thus implement partial reads (#615).
Frames now can hold non-raw samples (and have arbitrary encoding).
It means that same buffer pool may be used for buffers of different
types, not known at compile type.
Hence, Buffer<T> is now replaced with Buffer, which can hold any
binary data. Slice<T> remains typed and is used when the type of
buffer contents is known.
Sponsored-by: waspd
gavv
added a commit
to gavv/roc-toolkit
that referenced
this issue
May 15, 2024
Preparations for frame pooling.
Changes:
- All pipeline elements (roc_audio, roc_packet, roc_fec, roc_rtp)
now allocate buffers via PacketFactory and FrameFactory, and don't
use memory pools directly.
This ways these two layers are isolated and can be modified
independently.
- BufferFactory is removed. Instead, there are now two factories:
PacketFactory and FrameFactory.
- PacketFactory allocates packets and packet buffers.
- FrameFactory allocates frame buffers. When frame will become pooled,
it will also allocate frames.
It supports both byte buffers and raw sample buffers (for raw
frames).
- PacketFactory and FrameFactory can be created either with default
pools (embedded into factory) or with references to external pools.
This allows to pass decorated pools to factories.
Default (embedded) pools are used from tests, so that tests don't
need to bother about pools and are isolated from them as well.
- node::Context now creates pools, not factories. These pools are then
passed to roc_pipeline, roc_netio, and roc_sndio.
- roc_pipeline, roc_netio, and roc_sndio create factories from pools
and pass them to pipeline elements.
Later they can decorate pools before creating factories, e.g. with
LimitedPool to apply per-session memory limits.
Sponsored-by: waspd
Make frame pooled and holding reference to a buffer, also pooled.
This will allow to create queues/ring buffers of frames, reuse existing buffers (e.g. attach buffer from packet directly to a frame), and reuse existing frames (e.g. return same frame twice).
This is also needed to be able to return frame of different size than requested and thus implement partial reads (#615).
new_packet_buffer()
,new_packet()
new_byte_buffer()
,new_raw_buffer()
Slice<uint8_t> buffer()
void set_buffer(Slice<uint8_t>)
allocate_frame()
,reallocate_frame()
StatusCode write(Frame&)
StatusCode read(Frame&, packet::stream_timestamp_t duration)
set_duration()
hacks:The text was updated successfully, but these errors were encountered: