diff options
Diffstat (limited to 'docs/design/part-bufferlist.txt')
-rw-r--r-- | docs/design/part-bufferlist.txt | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/docs/design/part-bufferlist.txt b/docs/design/part-bufferlist.txt index bc82ec9915..91674509ac 100644 --- a/docs/design/part-bufferlist.txt +++ b/docs/design/part-bufferlist.txt @@ -21,17 +21,18 @@ for the following extra functionality: Use cases ---------- +~~~~~~~~~ A typical use case for multimedia pipelines is to append or remove 'headers' from packets of data. -* Generating RTP packets from h264 video +Generating RTP packets from h264 video +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - We receive as input a GstBuffer with an encoded h264 image and we need to - create RTP packets containing this h264 data as the payload. We typically need - to fragment the h264 data into multiple packets, each with their own RTP and - payload specific header. +We receive as input a GstBuffer with an encoded h264 image and we need to +create RTP packets containing this h264 data as the payload. We typically need +to fragment the h264 data into multiple packets, each with their own RTP and +payload specific header. +-------+-------+---------------------------+--------+ input H264 buffer: | NALU1 | NALU2 | ..... | NALUx | @@ -41,25 +42,25 @@ from packets of data. +-+ +-------+ +-+ +-------+ +-+ +-------+ output bufferlist: | | | NALU1 | | | | NALU2 | .... | | | NALUx | +-+ +-------+ +-+ +-------+ +-+ +-------+ - + : : : : \-----------/ \-----------/ group 1 group 2 - The output bufferlist consists of x groups consisting of an RTP payload header - and a subbuffer of the original input H264 buffer. Since the rtp headers and - the h264 data don't need to be contiguous in memory, we can avoid to memcpy the - h264 data into the rtp packets. +The output bufferlist consists of x groups consisting of an RTP payload header +and a subbuffer of the original input H264 buffer. Since the rtp headers and +the h264 data don't need to be contiguous in memory, we can avoid to memcpy the +h264 data into the rtp packets. - Since we can generate a bufferlist with multiple groups, we can push all the - RTP packets for the input data to the next element in one operation. +Since we can generate a bufferlist with multiple groups, we can push all the +RTP packets for the input data to the next element in one operation. - A typical udpsink will then use something like sendmsg to send the groups on - the network inside one UDP packet. This will further avoid having to memcpy - data into contiguous memory. +A typical udpsink will then use something like sendmsg to send the groups on +the network inside one UDP packet. This will further avoid having to memcpy +data into contiguous memory. API ---- +~~~ The GstBufferList is an opaque data structure and is operated on using an iterator. It derives from GstMiniObject so that it has basic refcounting and @@ -78,7 +79,7 @@ group. Metadata --------- +~~~~~~~~ Each of the buffers inside the bufferlist can have metadata assiociated with it. @@ -92,3 +93,4 @@ first group in the bufferlist. This means that: This allows for efficient (re)timestamping and re-typing (caps) of a group of buffers without having to modify each of the buffer's metadata. + |