audiobuffersplit: Add support for specifying output buffer size
authorSanchayan Maity <sanchayan@asymptotic.io>
Fri, 11 Sep 2020 12:47:20 +0000 (18:17 +0530)
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Mon, 21 Sep 2020 15:17:18 +0000 (15:17 +0000)
commit248d2bb79585c87cc00c598b5ece9ba4c297d57d
treed6aad4e7bfcdc180d8af36cbb8907092d4bc12ce
parentb707454a5aba1bf7399c6c03502d51d70dc63a73
audiobuffersplit: Add support for specifying output buffer size

Currently for buffer splitting only output duration can be specified.
Allow specifying a buffer size in bytes for splitting.

Consider a use case of the below pipeline
appsrc ! rptL16pay ! capsfilter ! rtpbin ! udpsink

Maintaining MTU for RTP transfer is desirable but in a scenario
where the buffers being pushed to appsrc do not adhere to this,
an audiobuffersplit element placed between appsrc and rtpL16pay
with output buffer size specified considering the MTU can help
mitigate this.

While rtpL16pay already has a MTU setting, in case of where an
incoming buffer has a size close to MTU, for eg. with a MTU of
1280, a buffer of size 1276 bytes would be split into two buffers,
one of 1268 and other of 8 bytes considering RTP header size of
12 bytes. Putting audiobuffersplit between appsrc and rtpL16pay
can take care of this.

While buffer duration could still be used being able to specify
the size in bytes is helpful here.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1578>
docs/plugins/gst_plugins_cache.json
gst/audiobuffersplit/gstaudiobuffersplit.c
gst/audiobuffersplit/gstaudiobuffersplit.h