×
Namespaces

Variants
Actions

Video4linux

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Article
Created: xharada (10 Feb 2009)
Last edited: hamishwillee (31 Jul 2012)

Overview

This article is about using "Video for Linux" on maemo and requires some knowledge of maemo as this is a fairly in-depth article using Linux port.

Introduction

Video4linux – V4L (Video for Linux) is an API that offers access to capture devices such as web-cams, video/TV cards, radio cards, and others. Nowadays it is in its second version (V4L2 – Video for Linux 2). V4L/V4L2 are both integrated with latest Linux Kernels, therefore, with maemo distribution.

Basically, V4L/V4L2 work sending predefined structures to opened Linux devices. For example, the following code snippet shows how to retrieve capabilities from a specific device:

#define DEFAULT_DEVICE "/dev/video0"
//V4L Structure
struct v4l2_capability vc;
 
//Open the device, for example /dev/video0, or /dev/radio0
int fd = open(DEFAULT_DEVICE, O_RDONLY);
 
//Send structure to the opened device using V4L2 API
ioctl(fd, VIDIOC_QUERYCAP, &vc);

External links

This page was last modified on 31 July 2012, at 13:20.
44 page views in the last 30 days.
×