|
libvdo
|
VDO is a package that consists of two primary components:
The vdo package provides a C compatible library for communicating with the vdo service. The library provides two objects, each having its own header file:
The vdo library API is divided into objects. Every API call from a client is done via an object, or a static function from an object's class. The most common objects are:
Each object has its own header file, with the same name, e.g. vdo-stream.h and vdo-channel.h.
The vdo library it built on top of GLib, which is a general-purpose, portable utility library for C. This library provides functionality, for implementing the VDO objects above, but also useful macros. GError is used for error handling. Read GLib and error handling page for more info, and examples on best practice when using vdo objects.
Many vdo library functions use the VdoMap as a parameter. It is a hash map with a variant value type, and provides a flexible way of setting and getting properties on vdo objects. Read here for more info.
The vdo repository contains some examples, on how to use vdo library to stream video to a client. When creating a new application that uses vdo, it is recommended to use the examples to get started.
For a non-blocking streaming example, see vdo-example.cc. This is the recommended way to use the vdo library in a single threaded or event loop driven application. There is also an example on how to use the blocking API, see vdo-example-blocking.cc.
The vdo-example-rgb.cc shows how to stream non encoded RGB video from vdo, not supported on all platforms.
The vdo-example-nv12.cc shows how to stream non encoded YUV NV12 video from vdo.