docs: Gram and nit fixes for part-buffer.txt

This commit is contained in:
Reynaldo H. Verdejo Pinochet 2013-10-14 17:44:27 -07:00
parent 20c32ffbdf
commit 72edc18465

View file

@ -12,7 +12,7 @@ Requirements
- It must be fast - It must be fast
* allocation, free, low fragmentation * allocation, free, low fragmentation
- Must be able to attach multiple memory blocks to the buffer - 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 - efficient handling of subbuffer, copy, span, trim
Lifecycle Lifecycle
@ -75,13 +75,13 @@ Data access
----------- -----------
Accessing the data of the buffer can happen by retrieving the individual 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 GstMemory objects in the GstBuffer or by using the gst_buffer_map() and
gst_buffer_unmap() function. gst_buffer_unmap() functions.
The _map and _unmap function will always return the memory of all blocks as one The _map and _unmap functions will always return the memory of all blocks as
large contiguous region of memory. Using the _map and _unmap function might be one large contiguous region of memory. Using the _map and _unmap functions
more convenient than accessing the individual memory blocks at the expense of might be more convenient than accessing the individual memory blocks at the
being more expensive because it might perform memcpy operations. expense of being more expensive because it might perform memcpy operations.
For buffers with only one GstMemory object (the most common case), _map and For buffers with only one GstMemory object (the most common case), _map and
_unmap have no performance penalty at all. _unmap have no performance penalty at all.
@ -94,18 +94,17 @@ Data access
* write access with 1 memory block * 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 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 and the original memory block is replaced with this copy. Then the memory
block is mapped in write mode. block is mapped in write mode and unmapped after usage.
The memory block is unmapped after usage.
* Read access with multiple memory blocks * Read access with multiple memory blocks
The memory blocks are combined into one large memory block. If the buffer is 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 writable, the memory blocks are replaced with this new combined block. If the
buffer is not writable, the memory is returned as is. buffer is not writable, the memory is returned as is. The memory block is
The memory block is then mapped in read mode. then mapped in read mode.
When the memory is unmapped after usage and the buffer has multiple memory 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 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 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 combined into one large memory block and the existing blocks are replaced with
this new block. The memory is then mapped in write mode. this new block. The memory is then mapped in write mode and unmapped after
The memory is unmapped after usage. usage.
Use cases Use cases
@ -126,7 +125,7 @@ Use cases
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 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 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 to fragment the h264 data into multiple packets, each with their own RTP and
payload specific header. payload specific header.