libvdo
vdo-frame.h File Reference

A video frame. More...

#include "vdo-map.h"
#include "vdo-types.h"
#include <gio/gio.h>
Include dependency graph for vdo-frame.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

VdoFrameType vdo_frame_get_frame_type (VdoFrame *self)
 Returns the type of this frame. More...
 
guint vdo_frame_get_sequence_nbr (VdoFrame *self)
 Returns the sequence number of this frame. More...
 
guint64 vdo_frame_get_timestamp (VdoFrame *self)
 Returns the timestamp of this frame. More...
 
gint64 vdo_frame_get_custom_timestamp (VdoFrame *self)
 Returns a custom timestamp for this frame. More...
 
gsize vdo_frame_get_size (VdoFrame *self)
 Returns the size of this frame. More...
 
gssize vdo_frame_get_header_size (VdoFrame *self)
 Returns the size of any H264/H265 headers contained in this frame. More...
 
gint vdo_frame_get_fd (VdoFrame *self)
 Returns a file descriptor for this frame. More...
 
VdoMapvdo_frame_get_extra_info (VdoFrame *self)
 Returns the extra info of this frame. More...
 
gpointer vdo_frame_get_opaque (VdoFrame *self)
 Returns a pointer to the opaque data of this frame. More...
 
gboolean vdo_frame_get_is_last_buffer (VdoFrame *self)
 Tests whether this frame is last buffer. More...
 
void vdo_frame_set_size (VdoFrame *self, gsize size)
 Sets the size of this frame. More...
 
void vdo_frame_set_frame_type (VdoFrame *self, VdoFrameType type)
 Sets the type of this frame. More...
 
void vdo_frame_set_sequence_nbr (VdoFrame *self, guint seqnum)
 Sets the sequence number of this frame. More...
 
void vdo_frame_set_timestamp (VdoFrame *self, guint64 timestamp)
 Sets the timestamp of this frame. More...
 
void vdo_frame_set_custom_timestamp (VdoFrame *self, gint64 timestamp)
 Returns a custom timestamp of this frame. More...
 
void vdo_frame_set_is_last_buffer (VdoFrame *self, gboolean is_last_buffer)
 Marks this frame as last buffer. More...
 
void vdo_frame_set_extra_info (VdoFrame *self, VdoMap *extra_info)
 Sets the extra info of this frame. More...
 
void vdo_frame_set_header_size (VdoFrame *self, gssize size)
 Sets the header size of this frame, normally used for H26x frames. More...
 
gpointer vdo_frame_memmap (VdoFrame *self)
 A convenience function that maps the frame into current process memory. More...
 
void vdo_frame_unmap (VdoFrame *self)
 Unmaps the frame from current process memory. More...
 
VdoChunk vdo_frame_take_chunk (VdoFrame *self, GError **error)
 Iterate buffer contents by chunks. More...
 

Detailed Description

A video frame.

Copyright (C) 2016-2019, Axis Communications AB, Lund

Function Documentation

◆ vdo_frame_get_custom_timestamp()

gint64 vdo_frame_get_custom_timestamp ( VdoFrame self)

Returns a custom timestamp for this frame.

Parameters
selfA VdoFrame
Returns
A custom timestamp for this frame as a gint64.

◆ vdo_frame_get_extra_info()

VdoMap* vdo_frame_get_extra_info ( VdoFrame self)

Returns the extra info of this frame.

Parameters
selfA VdoFrame
Returns
The extra info of this frame as VdoMap

◆ vdo_frame_get_fd()

gint vdo_frame_get_fd ( VdoFrame self)

Returns a file descriptor for this frame.

Deprecated:
Use vdo_buffer_get_fd
Parameters
selfA VdoFrame
Returns
A unix file descriptor referring to the content of this frame.

◆ vdo_frame_get_frame_type()

VdoFrameType vdo_frame_get_frame_type ( VdoFrame self)

Returns the type of this frame.

Parameters
selfA VdoFrame
Returns
The type of this frame as VdoFrameType

◆ vdo_frame_get_header_size()

gssize vdo_frame_get_header_size ( VdoFrame self)

Returns the size of any H264/H265 headers contained in this frame.

This can be used as an offset into the frame data buffer to get the frame data without headers.

Parameters
selfA VdoFrame
Returns
The combined size of the H264/H265 headers, or -1 if the header size is unknown.

◆ vdo_frame_get_is_last_buffer()

gboolean vdo_frame_get_is_last_buffer ( VdoFrame self)

Tests whether this frame is last buffer.

Parameters
selfA VdoFrame
Returns
TRUE if this frame is the last buffer, otherwise FALSE

◆ vdo_frame_get_opaque()

gpointer vdo_frame_get_opaque ( VdoFrame self)

Returns a pointer to the opaque data of this frame.

Deprecated:
Use vdo_buffer_get_opaque
Parameters
selfA VdoFrame
Returns
A pointer to the opaque data of this frame

◆ vdo_frame_get_sequence_nbr()

guint vdo_frame_get_sequence_nbr ( VdoFrame self)

Returns the sequence number of this frame.

The returned sequence number is represented as an unsigned integer and starts at 0. The point where the sequence number counter wraps around is undefined.

Parameters
selfA VdoFrame
Returns
The sequence number of this frame as a guint.

◆ vdo_frame_get_size()

gsize vdo_frame_get_size ( VdoFrame self)

Returns the size of this frame.

Parameters
selfA VdoFrame
Returns
The size of this frame in bytes.

◆ vdo_frame_get_timestamp()

guint64 vdo_frame_get_timestamp ( VdoFrame self)

Returns the timestamp of this frame.

Parameters
selfA VdoFrame
Returns
The timestamp of this frame as a guint64.

◆ vdo_frame_memmap()

gpointer vdo_frame_memmap ( VdoFrame self)

A convenience function that maps the frame into current process memory.

This function will map the full buffer size as opposed to the current frame size. This is due to the requirement of mapping complete buffer size when the frame buffers are backed by AXIS' vcrfs which is the case for monolith cache.

Parameters
selfA VdoFrame
Returns
A pointer to the mapped memory buffer

◆ vdo_frame_set_custom_timestamp()

void vdo_frame_set_custom_timestamp ( VdoFrame self,
gint64  timestamp 
)

Returns a custom timestamp of this frame.

Parameters
selfA VdoFrame
timestampThe new custom timestamp for this frame

◆ vdo_frame_set_extra_info()

void vdo_frame_set_extra_info ( VdoFrame self,
VdoMap extra_info 
)

Sets the extra info of this frame.

Parameters
selfA VdoFrame
extra_infoThe new extra info for this frame

◆ vdo_frame_set_frame_type()

void vdo_frame_set_frame_type ( VdoFrame self,
VdoFrameType  type 
)

Sets the type of this frame.

Parameters
selfA VdoFrame
typeThe new type for this frame

◆ vdo_frame_set_header_size()

void vdo_frame_set_header_size ( VdoFrame self,
gssize  size 
)

Sets the header size of this frame, normally used for H26x frames.

The headers size can be used as an offset into the frame data buffer to get the frame data without headers. A size set to -1 indicates that the header size is unknown.

Parameters
selfA VdoFrame
sizeThe combined size of the H264/H265 headers.

◆ vdo_frame_set_is_last_buffer()

void vdo_frame_set_is_last_buffer ( VdoFrame self,
gboolean  is_last_buffer 
)

Marks this frame as last buffer.

Parameters
selfA VdoFrame
is_last_bufferIf TRUE, marks the frame as last buffer

◆ vdo_frame_set_sequence_nbr()

void vdo_frame_set_sequence_nbr ( VdoFrame self,
guint  seqnum 
)

Sets the sequence number of this frame.

Parameters
selfA VdoFrame
seqnumThe new sequence number for this frame

◆ vdo_frame_set_size()

void vdo_frame_set_size ( VdoFrame self,
gsize  size 
)

Sets the size of this frame.

Parameters
selfA VdoFrame
sizeThe new size in bytes for this frame

◆ vdo_frame_set_timestamp()

void vdo_frame_set_timestamp ( VdoFrame self,
guint64  timestamp 
)

Sets the timestamp of this frame.

Parameters
selfA VdoFrame
timestampThe new timestamp for this frame

◆ vdo_frame_take_chunk()

VdoChunk vdo_frame_take_chunk ( VdoFrame self,
GError **  error 
)

Iterate buffer contents by chunks.

while (1) {
VdoChunk chunk = vdo_frame_take_chunk(frame, NULL);
if (!chunk.data)
break;
}
Parameters
selfA VdoFrame
errorA location to return an error.
Returns
New chunks until VdoChunk.data equals NULL

◆ vdo_frame_unmap()

void vdo_frame_unmap ( VdoFrame self)

Unmaps the frame from current process memory.

Parameters
selfA VdoFrame