华为手机input avcapturedeviceinput是什么

Input device
You are here:
Input Device
An input device is any
device that sends data to a computer, allowing you to interact with and control the computer.
The picture shows a
mouse, an example of an input device.
The most commonly used or primary input devices on a computer are the
and . However, there are dozens of other devices that can also be used to input data into the computer. Below is a list of computer input devices that can be utilized with a computer or a computing device.
Types of input devices
Electroencephalography (EEG)
Finger (with
, , , , and
Magnetic ink (like the ink found on checks)
Medical imaging devices (e.g., , CAT Scan, and Ultrasound images)
(using voice
, , or other
Sensors (e.g. heat and orientation sensors)
Sonar imaging devices
(using voice speech recognition or biometric verification)
Note: Although
contain data they are not considered input devices by themselves. It is the readers that read the cards that are considered the input device.
Tip: Keep in mind that drives such as a , , , and a
may be capable of sending
information to a computer, but they are
not input devices. They are considered .
What are the input devices of my computer
Every computer comes with a keyboard and a mouse (touchpad) that are considered input devices. As far as any other input device it all depends on what is included with your computer or attached to your computer. For example, if you also have a scanner it would be another computer input devices. The best method of determining all of the input devices your computer has is to go through the above list and note each of the input devices your computer has.
What does an input device send to a computer?
What a computer sends (inputs) to a computer all depends on a device. However, all input devices send
from the device over a
to the computer. For example, as you move a computer mouse the data it sends to the computer are the X-Y axis movements that the computer uses to display the
on the screen. You can see a live example of this on our
definition.
Why does a computer need an input device?
Today, input devices are important to the computer because they are what allows you to interact with a computer and add new information to the computer. For example, if a computer had no input devices it could run by itself but would have no way of having any settings changed, errors fixed, or any other user interaction. Also, if you wanted to add new information to the computer (e.g. text, command, document, picture, etc.) it could not be added without an input device.
Related pages
Also see: , , , , , , ,
Was this page useful?
Recently added pages
Useful links求助:造成华为交换机的接口input方向CRC错误包的可能原因是什么?
&dis interface XGigabitEthernet 4/0/11 | in CRC
& CRC: & & & & & & & & & & , &Giants: & & & & & & & & & & & & & & &0
& CRC: & & & & & & & & & & , &Giants: & & & & & & & & & & & & & & &0
& CRC: & & & & & & & & & & , &Giants: & & & & & & & & & & & & & & &0
& CRC: & & & & & & & & & & , &Giants: & & & & & & & & & & & & & & &0
& CRC: & & & & & & & & & & , &Giants: & & & & & & & & & & & & & & &0
& CRC: & & & & & & & & & & , &Giants: & & & & & & & & & & & & & & &0
& CRC: & & & & & & & & & & , &Giants: & & & & & & & & & & & & & & &0
dis int xg4/0/11& & & & & & & & & & & & & & &&
XGigabitEthernet4/0/11 current state : UP
Line protocol current state : UP
Switch Port, PVID : & 80, TPID : 8100(Hex), The Maximum Frame Length is 9216
IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 4c1f-cc17-bc5e
Last physical up time & :&
Last physical down time :&
Port Mode: COMMON FIBER
Speed : 10000, &Loopback: NONE
Duplex: FULL, &Negotiation: DISABLE
Mdi & : NORMAL
Last 300 seconds input rate
bits/sec, 692403 packets/sec
Last 300 seconds output rate
bits/sec, 488706 packets/sec
Input peak rate
bits/sec, Record time:&
Output peak rate
bits/sec, Record time:&
Input: &8 packets, 955 bytes
& Unicast: & & & & & & &4, &Multicast: & & & & & & & & & & 1764813
& Broadcast: & & & & & & & & & & & &5, &Jumbo: & & & & & & & & & & & & & & & 0
& Discard: & & & & & & & & & & & & &0, &Total Error: & & & & & & & &
& CRC: & & & & & & & & & & , &Giants: & & & & & & & & & & & & & & &0
& Jabbers: & & & & & & & & & &5618410, &Fragments: & & & & & & & & & & & & & 0
& Runts: & & & & & & & & & & & & & &0, &DropEvents: & & & & & & & & & & & & &0
& Alignments: & & & & & & & & & & & 0, &Symbols: & & & & & & & & & &
& Ignoreds: & & & & & & & & & & & & 0, &Frames: & & & & & & & & & & & & & & &0
& & & & & & & & & & & & & & & & & & & & &&
Output: &7 packets, 1740 bytes
& Unicast: & & & & & & &4, &Multicast: & & & & & & & & & & 1653243
& Broadcast: & & & & & & & & & & 2739, &Jumbo: & & & & & & & & & & & & & & & 0
& Discard: & & & & & & & & & & & & &0, &Total Error: & & & & & & & & & & & & 0
& Collisions: & & & & & & & & & & & 0, &ExcessiveCollisions: & & & & & & & & 0
& Late Collisions: & & & & & & & & &0, &Deferreds: & & & & & & & & & & & & & 0
& Buffers Purged: & & & & & & & & & 0
& & Input bandwidth utilization threshold : 100.00%
& & Output bandwidth utilization threshold: 100.00%
& & Input bandwidth utilization &: 7.65%
& & Output bandwidth utilization : 47.79%
其直连的设备为cisco的7609,详细接口信息:
sh int t8/1&
TenGigabitEthernet8/1 is up, line protocol is up (connected)
& Hardware is C6k 10000Mb 802.3, address is c40 (bia c40)
& Internet address is 117.79.135.102/30
& MTU 1500 bytes, BW
Kbit, DLY 10 usec,&
& & &reliability 255/255, txload 19/255, rxload 119/255
& Encapsulation ARPA, loopback not set
& Keepalive set (10 sec)
& Full-duplex, 10Gb/s, media type is 10Gbase-LR
& input flow-control is on, output flow-control is off
& ARP type: ARPA, ARP Timeout 04:00:00
& Last input 00:00:01, output never, output hang never
& Last clearing of &show interface& counters never
& Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
& Queueing strategy: fifo
& Output queue: 0/40 (size/max)
& 5 minute input rate
bits/sec, 487738 packets/sec
& 5 minute output rate
bits/sec, 685865 packets/sec
& L2 Switched: ucast: 0 pkt, 0 bytes - mcast: 0 pkt, 0 bytes
& L3 in Switched: ucast: 1 pkt, 2400 bytes - mcast: 0 pkt, 0 bytes
& L3 out Switched: ucast: 7 pkt, 828 bytes - mcast: 0 pkt, 0 bytes
& & &4 packets input, 5297 bytes, 0 no buffer
& & &Received 1671094 broadcasts (0 IP multicasts)
& & &0 runts, 0 giants, 0 throttles
& & &0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
& & &0 watchdog, 0 multicast, 0 pause input
& & &0 input packets with dribble condition detected
& & &7 packets output, 794 bytes, 0 underruns
& & &0 output errors, 0 collisions, 3 interface resets
& & &0 babbles, 0 late collision, 0 deferred
& & &0 lost carrier, 0 no carrier, 0 PAUSE output
& & &0 output buffer failures, 0 output buffers swapped out
谁能帮忙看下具体原因在哪?
文章评论 以下网友留言只代表其个人观点,不代表本网站的观点和立场。linux驱动(68)
input系统中,分为:
设备驱动层
事件处理层
将 input_dev结构体(表示一个输入设备) 注册到 核心层.
1: 这个input_dev必需由input_allocate_device()函数来分配
input_register_device()如果注册失败,必需调用input_free_device()来释放分配的空间
如果注册成功,在卸载函数中应该调用input_unregister_device()来注销input_dev
input_dev = input_allocate_device();
if (!input_dev)
ret = -ENOMEM;
ret = input_register_device(input_dev);
if (ret) {
printk("ts-if: Could not register input device(touchscreen)!\n");
input_free_device(input_dev);
成功 : 返回 0
失败 : 返回非0值
int input_register_device(struct input_dev * dev)
为生成设备节点序号做准备。
下面的代码会调用dev_set_name()来设置设备节点的名字
会在sysfs系统中以input0、input1、input2.....出现
static atomic_t input_no = ATOMIC_INIT(0);
struct input_handler *
const char *
struct input_dev
设备支持的事件类型
每一个事件的类型都用一个位来表示
如果某一位被置 1 ,表示该设备支持这类事件
被值 0 ,表示该设备不支持这类事件
unsigned long evbit[BITS_TO_LONGS(EV_CNT)];
__set_bit(EV_SYN,dev-&evbit);
如果驱动预先设置了延时,自动重复被驱动处理,
核心层就不做这件事了
init_timer(&dev-&timer);
if (!dev-&rep[REP_DELAY] && !dev-&rep[REP_PERIOD]) {
dev-&timer.data = (long)
dev-&timer.function = input_repeat_
dev-&rep[REP_DELAY] = 250;
dev-&rep[REP_PERIOD] = 33;
检查getkeycode函数有没有被定义。
如果没有定义,则使用默认的input_default_getkeycode.
if (!dev-&getkeycode)
dev-&getkeycode = input_default_
检查setkeycode函数有没有被定义。
如果没有定义,则使用默认的input_default_setkeycode.
if (!dev-&setkeycode)
dev-&setkeycode = input_default_
dev_set_name(&dev-&dev, "input%ld",
(unsigned long) atomic_inc_return(&input_no) - 1);
任何一个设备的注册都会经过这个函数,设备驱动模型中的核心函数
error = device_add(&dev-&dev);
if (error)
生成并返回设备的路径,调用者必需使用kfree()来释放结果
因为它的代码中有path = kzalloc(len, gfp_mask);
path = kobject_get_path(&dev-&dev.kobj, GFP_KERNEL);
printk(KERN_INFO "input: %s as %s\n",
dev-&name ? dev-&name : "Unspecified device", path ? path : "N/A");
kfree(path);
获取锁---访问临界区---释放锁
获取互斥锁且可以被信号打断,当正在等待锁的时信号到来了会返回EINTR
error = mutex_lock_interruptible(&input_mutex);
if (error) {
device_del(&dev-&dev);
input_dev维护了两条链表
1 : input_dev_list链表,该链表包含了系统中所有的input_dev。
2 : input_handle_list链表
将input_dev添加到input_dev_list链表
list_add_tail(&dev-&node, &input_dev_list);
遍历input_handler链表上,对链表中的每一个input_handler执行
input_attach_handler函数
list_for_each_entry(handler, &input_handler_list, node)
匹配input_dev和input_handler。下面讲解。
input_attach_handler(dev, handler);
当用户层调用poll()系统调用的时候,
input_proc_devices_poll函数会被调用
static unsigned int input_proc_devices_poll(struct file *file, poll_table *wait)
poll_wait(file, &input_devices_poll_wait, wait);
唤醒读等待队列input_devices_poll_wait
input_wakeup_procfs_readers();
mutex_unlock(&input_mutex);
用于匹配input_dev和input_handler
匹配成功的关键是 :
handler中的blacklist、id_table
如果匹配成功,会调用handler的connect函数
static int input_attach_handler(struct input_dev *dev, struct input_handler *handler)
//设备的标识,存储了设备的信息
struct input_device_id
kernel_ulong_//要匹配的项
设备中的这些信息将要和input_handler中的id_table中定义的进行匹配
//总线类型
//制造商ID
const struct input_device_id *
id = input_match_device(handler,dev);
return -ENODEV;
一下是匹配成功后要执行的。
调用handler的connect函数
err = handler-&connect(handler,dev,id);
if(error && error != -ENODEV)
pr_err("failed to attach handler %s to device %s, error: %d\n",
handler-&name, kobject_name(&dev-&dev.kobj), error);
static const struct input_device_id *input_match_device(struct input_handler *handler,
struct input_dev *dev)
const struct input_device_id *
id_table 表示驱动支持的设备列表
id_table的出现,让一个handler支持多个input_dev变成了可能。
evdev支持所有的设备
static const struct input_device_id evdev_ids[] = {
{ .driver_info = 1 },
//匹配所有的设备
keyboard支持的设备
static const struct input_device_id kbd_ids[] = {
//比较evbit
.flags = INPUT_DEVICE_ID_MATCH_EVBIT,
.evbit = { BIT_MASK(EV_KEY) },//只要能产生按键类事件,就支持
.flags = INPUT_DEVICE_ID_MATCH_EVBIT,
.evbit = { BIT_MASK(EV_SND) },//主要能产生声音就支持
for (id = handler-&id_ id-&flags || id-&driver_ id++) {
if (id-&flags & INPUT_DEVICE_ID_MATCH_BUS)
if (id-&bustype != dev-&id.bustype)
if (id-&flags & INPUT_DEVICE_ID_MATCH_VENDOR)
if (id-&vendor != dev-&id.vendor)
if (id-&flags & INPUT_DEVICE_ID_MATCH_PRODUCT)
if (id-&product != dev-&id.product)
if (id-&flags & INPUT_DEVICE_ID_MATCH_VERSION)
if (id-&version != dev-&id.version)
MATCH_BIT(evbit,
MATCH_BIT(keybit, KEY_MAX);
MATCH_BIT(relbit, REL_MAX);
MATCH_BIT(absbit, ABS_MAX);
MATCH_BIT(mscbit, MSC_MAX);
MATCH_BIT(ledbit, LED_MAX);
MATCH_BIT(sndbit, SND_MAX);
MATCH_BIT(ffbit,
MATCH_BIT(swbit,
if (!handler-&match || handler-&match(handler, dev))
return NULL;
static bool joydev_match(struct input_handler *handler, struct input_dev *dev)
evbit:设备支持哪些事件
EV_KEY : 0x01
evbit 是long类型
第0位被置1,表示支持所有事件。
某一位置1表示支持该事件
某一位为0标识不支持该事件
test_bit(EV_KEY, dev-&evbit) : 测试是否支持按键类事件
test_bit(BTN_TOUCH, dev-&keybit)测试是否支持按键类事件中是否支持触摸
if (test_bit(EV_KEY, dev-&evbit) && test_bit(BTN_TOUCH, dev-&keybit))
return false;
return true;
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:39403次
积分:1192
积分:1192
排名:千里之外
原创:82篇
-欣赏Linux内核的绝美风光.......
(1)(1)(1)(1)(4)(2)(3)(3)(4)(4)(4)(4)(2)(8)(22)(5)(11)(1)(1)

我要回帖

更多关于 avcapturedeviceinput 的文章

 

随机推荐