video4linux2_en

上传人:正** 文档编号:41971688 上传时间:2018-05-31 格式:DOC 页数:36 大小:307.50KB
返回 下载 相关 举报
video4linux2_en_第1页
第1页 / 共36页
video4linux2_en_第2页
第2页 / 共36页
video4linux2_en_第3页
第3页 / 共36页
video4linux2_en_第4页
第4页 / 共36页
video4linux2_en_第5页
第5页 / 共36页
点击查看更多>>
资源描述

《video4linux2_en》由会员分享,可在线阅读,更多相关《video4linux2_en(36页珍藏版)》请在金锄头文库上搜索。

1、The Video4Linux2 API: an introductionPosted October 11, 2006 by corbet Your editor has recently had the opportunity to write a Linux driver for a camera device - the camera which will be packaged with the One Laptop Per Child system, in particular. This driver works with the internal kernel API desi

2、gned for such purposes: the Video4Linux2 API. In the process of writing this code, your editor made the shocking discovery that, in fact, this API is not particularly well documented - though the user-space side is, instead, quite well documented indeed. In an attempt to remedy the situation somewha

3、t, LWN will, over the coming months, publish a series of articles describing how to write drivers for the V4L2 interface.V4L2 has a long history - the first gleam came into Bill Dirkss eye back around August of 1998. Development proceeded for years, and the V4L2 API was finally merged into the mainl

4、ine in November, 2002, when 2.5.46 was released. To this day, however, quite a few Linux drivers do not support the newer API; the conversion process is an ongoing task. Meanwhile, the V4L2 API continues to evolve, with some major changes being made in 2.6.18. Applications which work with V4L2 remai

5、n relatively scarce.V4L2 is designed to support a wide variety of devices, only some of which are truly “video“ in nature:The video capture interface grabs video data from a tuner or camera device. For many, video capture will be the primary application for V4L2. Since your editors experience is str

6、ongest in this area, this series will tend to emphasize the capture API, but there is more to V4L2 than that.The video output interface allows applications to drive peripherals which can provide video images - perhaps in the form of a television signal - outside of the computer.A variant of the capt

7、ure interface can be found in the video overlay interface, whose job is to facilitate the direct display of video data from a capture device. Video data moves directly from the capture device to the display, without passing through the systems CPU.The VBI interfaces provide access to data transmitte

8、d during the video blanking interval. There are two of them, the “raw“ and “sliced“ interfaces, which differ in the amount of processing of the VBI data performed in hardware.The radio interface provides access to audio streams from AM and FM tuner devices.Other types of devices are possible. The V4

9、L2 API has some stubs for “codec“ and “effect“ devices, both of which perform transformations on video data streams. Those areas have not yet been completely specified, however, much less implemented. There are also the “teletext“ and “radio data system“ interfaces currently implemented in the older

10、 V4L1 API; those have not been moved to V4L2 and there do not appear to be any immediate plans to do so.Video devices differ from many others in the vast number of ways in which they can be configured. As a result, much of a V4L2 driver implements code which enables applications to discover a given

11、devices capabilities and to configure that device to operate in the desired manner. The V4L2 API defines several dozen callbacks for the configuration of parameters like tuner frequencies, windowing and cropping, frame rates, video compression, image parameters (brightness, contrast, .), video stand

12、ards, video formats, etc. Much of this series will be devoted to looking at how this configuration process happens.Then, there is the small task of actually performing I/O at video rates in an efficient manner. The V4L2 API defines three different ways of moving video data between user space and the

13、 peripheral, some of which can be on the complex side. Separate articles will look at video I/O and the video-buf layer which has been provided to handle common tasks.Subsequent articles will appear every few weeks, and will be added to the list below:Part 2: registration and open() Part 3: Basic io

14、ctl() handlingPart 4: Inputs and OutputsPart 5a: Colors and formatsPart 5b: Format negotiationPart 6a: Basic frame I/OPart 6b: Streaming I/OPart 7: ControlsVideo4Linux2 part 2: registration and open()Posted October 18, 2006 by corbetThe LWN.net Video4Linux2 API series.This is the second article in t

15、he LWN series on writing drivers for the Video4Linux2 kernel interface; those who have not yet seen the introductory article may wish to start there. This installment will look at the overall structure of a Video4Linux driver and the device registration process. Before starting, it is worth noting t

16、hat there are two resources which will prove invaluable for anybody working with video drivers:The V4L2 API Specification. This document covers the API from the user-space point of view, but, to a great extent, V4L2 drivers implement that API directly. So most of the structures are the same, and the semantics of the V4L2 calls are clearly laid out. Print a copy (consider cutting out the Free Documentation License text to save trees)

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 中学教育 > 其它中学文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号