class V4L2::AllocatedBuffer
- V4L2::AllocatedBuffer
- Reference
- Object
Overview
Represents a buffer allocated and controlled by the application, which the V4L2 kernel API will write data into.
Defined in:
v4l2/allocated_buffer.crConstructors
-
.malloc(length : UInt32) : AllocatedBuffer
Mallocs a new buffer of the given length.
-
.mmap(fd : Int32, offset : UInt32, length : UInt32) : AllocatedBuffer
Memory-maps a new buffer using the given file descriptor, offset, and length.
-
.new(memory : Memory, pointer : Pointer(UInt8), length : UInt32)
Initializes an allocated buffer, with the specified memory type, pointer, and length.
Instance Method Summary
-
#finalize
De-allocates the buffer.
-
#length : UInt32
The length of the allocated buffer.
-
#memory : Memory
The memory type of the allocated buffer.
-
#pointer : Pointer(UInt8)
The raw pointer to the allocated buffer.
-
#to_slice : Slice(UInt8)
Returns a slice to the allocated buffer.
-
#to_unsafe : Pointer(UInt8)
Returns a raw pointer to the allocated buffer.
Constructor Detail
def self.mmap(fd : Int32, offset : UInt32, length : UInt32) : AllocatedBuffer
#
Memory-maps a new buffer using the given file descriptor, offset, and length.
Initializes an allocated buffer, with the specified memory type, pointer, and length.