- GstMemory:管理一小块实际的虚拟内存
- GstBuffer:一个对象,是element、plugin、application互相信息交互的最小数据单位,内部包含GstMemory、时间信息和一些其他信息。
- GstMeta:附加在GstBuffer上,用来提供一些描述内存的额外信息。
- GstBufferPool:buffer池,但是只能分配尺寸固定的buffer。
GstMemory:
/**
* GstMemory:
* @mini_object: parent structure
* @allocator: pointer to the #GstAllocator
* @parent: parent memory block
* @maxsize: the maximum size allocated
* @align: the alignment of the memory
* @offset: the offset where valid data starts
* @size: the size of valid data
*
* Base structure for memory implementations. Custom memory will put this structure
* as the first member of their structure.
*/
struct _GstMemory {
GstMiniObject mini_object;
GstAllocator *allocator;
GstMemory *parent;
gsize maxsize;
gsize align;
gsize offset;
gsize size;
};
GstMemory由GstAllocator创建。
GstAllocator:
/**
* GstAllocator:
* @mem_map: the implementation of the GstMemoryMapFunction
* @mem_unmap: the implementation of the GstMemoryUnmapFunction
* @mem_copy: the implementation of the GstMemoryCopyFunction
* @mem_share: the implementation of the GstMemoryShareFunction
* @mem_is_span: the implementation of the GstMemoryIsSpanFunction
* @mem_map_full: the implementation of the GstMemoryMapFullFunction.
* Will be used instead of @mem_map if present. (Since: 1.6)
* @mem_unmap_full: the implementation of the GstMemoryUnmapFullFunction.
* Will be used instead of @mem_unmap if present. (Since: 1.6)
*
* The #GstAllocator is used to create new memory.
*/
struct _GstAllocator
{
GstObject object;
const gchar *mem_type;
/*< public >*/
GstMemoryMapFunction mem_map;
GstMemoryUnmapFunction mem_unmap;
GstMe

GStreamer中的GstMemory是管理内存的基本结构,由GstAllocator创建。GstBuffer是数据交换的最小单元,包含多个GstMemory、时间戳和其他元数据。GstMeta用于附加额外信息到GstBuffer。GstBufferPool则用于管理固定大小的缓冲区,提供高效内存分配。内存访问需通过gst_memory_map和gst_memory_unmap进行保护。
3035

被折叠的 条评论
为什么被折叠?



