class V4L2::AllocatedBuffer

Overview

Represents a buffer allocated and controlled by the application, which the V4L2 kernel API will write data into.

Defined in:

v4l2/allocated_buffer.cr

Constructors

Instance Method Summary

Constructor Detail

def self.malloc(length : UInt32) : AllocatedBuffer #

Mallocs a new buffer of the given length.


[View source]
def self.mmap(fd : Int32, offset : UInt32, length : UInt32) : AllocatedBuffer #

Memory-maps a new buffer using the given file descriptor, offset, and length.


[View source]
def self.new(memory : Memory, pointer : Pointer(UInt8), length : UInt32) #

Initializes an allocated buffer, with the specified memory type, pointer, and length.


[View source]

Instance Method Detail

def finalize #

De-allocates the buffer.


[View source]
def length : UInt32 #

The length of the allocated buffer.


[View source]
def memory : Memory #

The memory type of the allocated buffer.


[View source]
def pointer : Pointer(UInt8) #

The raw pointer to the allocated buffer.


[View source]
def to_slice : Slice(UInt8) #

Returns a slice to the allocated buffer.


[View source]
def to_unsafe : Pointer(UInt8) #

Returns a raw pointer to the allocated buffer.


[View source]