roc-toolkit icon indicating copy to clipboard operation
roc-toolkit copied to clipboard

Frame pool

Open gavv opened this issue 1 year ago • 0 comments

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).

  • [x] rework Buffer:
    • make Buffer non-template (always bytes)
    • make BufferFactory non-template
    • keep Slice template
  • [x] rework factories
    • PacketFactory: new_packet_buffer(), new_packet()
    • FrameFactory: new_byte_buffer(), new_raw_buffer()
    • remove BufferFactory
  • [x] rework Frame
    • Slice<uint8_t> buffer()
    • void set_buffer(Slice<uint8_t>)
  • [x] pooled frames
    • FramePtr
    • FrameFactory: allocate_frame(), reallocate_frame()
  • [x] IFrameWriter:
    • StatusCode write(Frame&)
  • [x] IFrameReader:
    • StatusCode read(Frame&, packet::stream_timestamp_t duration)
  • [x] Update roc_audio:
    • [x] Mixer
    • [x] Fanout
    • [x] ResamplerReader
    • [x] ResamplerWriter
    • [x] ChannelMapperReader
    • [x] ChannelMapperWriter
    • [x] PcmMapperReader
    • [x] PcmMapperWriter
    • [x] ProfilingReader
    • [x] ProfilingWriter
    • [x] Watchdog
    • [x] NullWriter
    • [x] Depacketizer
    • [x] Packetizer
    • [x] LatencyMonitor
    • [x] FeedbackMonitor
  • [x] Update roc_sndio:
    • [x] IDevice
    • [x] IBackend
    • [x] BackendDispatcher
    • [x] Pump
    • [x] WavBackend
    • [x] SoxBackend
    • [x] SndfileBackend
    • [x] PulseaudioBackend
  • [x] Update roc_pipeline:
    • [x] PipelineLoop
    • [x] ReceiverLoop
    • [x] ReceiverSource
    • [x] SenderLoop
    • [x] SenderSink
    • [x] TranscoderSource
    • [x] TranscoderSink
  • [x] Update roc_node
    • [x] Context
    • [x] Sender
    • [x] SenderEncoder
    • [x] Receiver
    • [x] ReceiverDecoder
  • [x] Update public_api:
    • [x] roc_sender
    • [x] roc_sender_encoder
    • [x] roc_receiver
    • [x] roc_receiver_decoder
  • [x] Update tools:
    • [x] roc_send
    • [x] roc_recv
    • [x] roc_copy
  • [ ] Update tests
    • [ ] roc_audio
    • [x] roc_sndio
    • [ ] roc_pipeline
    • [x] roc_node
    • [ ] public_api
  • [x] Remove set_duration() hacks:
    • [x] PipelineLoop
    • [x] Mixer

gavv avatar Feb 10 '24 08:02 gavv