mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
docs: Gram and nit fixes for part-buffer.txt
This commit is contained in:
parent
20c32ffbdf
commit
72edc18465
1 changed files with 16 additions and 17 deletions
|
@ -12,7 +12,7 @@ Requirements
|
|||
- It must be fast
|
||||
* allocation, free, low fragmentation
|
||||
- Must be able to attach multiple memory blocks to the buffer
|
||||
- Must be able to attach artibtrary metadata to buffers
|
||||
- Must be able to attach artbitrary metadata to buffers
|
||||
- efficient handling of subbuffer, copy, span, trim
|
||||
|
||||
Lifecycle
|
||||
|
@ -75,13 +75,13 @@ Data access
|
|||
-----------
|
||||
|
||||
Accessing the data of the buffer can happen by retrieving the individual
|
||||
GstMemory objects in the GstBuffer or my using the gst_buffer_map() and
|
||||
gst_buffer_unmap() function.
|
||||
GstMemory objects in the GstBuffer or by using the gst_buffer_map() and
|
||||
gst_buffer_unmap() functions.
|
||||
|
||||
The _map and _unmap function will always return the memory of all blocks as one
|
||||
large contiguous region of memory. Using the _map and _unmap function might be
|
||||
more convenient than accessing the individual memory blocks at the expense of
|
||||
being more expensive because it might perform memcpy operations.
|
||||
The _map and _unmap functions will always return the memory of all blocks as
|
||||
one large contiguous region of memory. Using the _map and _unmap functions
|
||||
might be more convenient than accessing the individual memory blocks at the
|
||||
expense of being more expensive because it might perform memcpy operations.
|
||||
|
||||
For buffers with only one GstMemory object (the most common case), _map and
|
||||
_unmap have no performance penalty at all.
|
||||
|
@ -94,18 +94,17 @@ Data access
|
|||
|
||||
* write access with 1 memory block
|
||||
|
||||
The buffer should be writable or this operation will fail..
|
||||
The buffer should be writable or this operation will fail.
|
||||
The memory block is accessed. If the memory block is readonly, a copy is made
|
||||
and the original memory block is replaced with this copy. then the memory
|
||||
block is mapped in write mode.
|
||||
The memory block is unmapped after usage.
|
||||
and the original memory block is replaced with this copy. Then the memory
|
||||
block is mapped in write mode and unmapped after usage.
|
||||
|
||||
* Read access with multiple memory blocks
|
||||
|
||||
The memory blocks are combined into one large memory block. If the buffer is
|
||||
writable, The memory blocks are replace with this new memory block. If the
|
||||
buffer is not writable, the memory is returned as is.
|
||||
The memory block is then mapped in read mode.
|
||||
writable, the memory blocks are replaced with this new combined block. If the
|
||||
buffer is not writable, the memory is returned as is. The memory block is
|
||||
then mapped in read mode.
|
||||
|
||||
When the memory is unmapped after usage and the buffer has multiple memory
|
||||
blocks, this means that the map operation was not able to store the combined
|
||||
|
@ -116,8 +115,8 @@ Data access
|
|||
|
||||
The buffer should be writable or the operation fails. The memory blocks are
|
||||
combined into one large memory block and the existing blocks are replaced with
|
||||
this new block. The memory is then mapped in write mode.
|
||||
The memory is unmapped after usage.
|
||||
this new block. The memory is then mapped in write mode and unmapped after
|
||||
usage.
|
||||
|
||||
|
||||
Use cases
|
||||
|
@ -126,7 +125,7 @@ Use cases
|
|||
Generating RTP packets from h264 video
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
We receive as input a GstBuffer with an encoded h264 image and we need to
|
||||
We receive a GstBuffer as input 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.
|
||||
|
|
Loading…
Reference in a new issue