HELLO·Android
系统源代码
IT资讯
技术文章
我的收藏
注册
登录
-
我收藏的文章
创建代码块
我的代码块
我的账号
Android 10
|
10.0.0_r6
下载
查看原文件
收藏
根目录
external
ltp
testcases
kernel
device-drivers
v4l
user_space
v4l2_show.c
/* * v4l-test: Test environment for Video For Linux Two API * * 17 Jul 2009 0.3 show_v4l2_frmsizeenum() added * 5 Jul 2009 0.2 show_v4l2_input() introduced * 7 May 2009 0.1 First release * * Written by Mrton Nmeth
* Released under GPL */ #include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include "v4l2_test.h" #include "dev_video.h" #include "video_limits.h" #include "test_VIDIOC_REQBUFS.h" void show_v4l2_requestbuffers(struct v4l2_requestbuffers *reqbuf) { dprintf("\treqbuf = { " ".count=%u, " ".type=%i, " ".memory=%i, " ".reserved = { 0x%X, 0x%X } " "}\n", reqbuf->count, reqbuf->type, reqbuf->memory, reqbuf->reserved[0], reqbuf->reserved[1] ); } void show_v4l2_buffer(struct v4l2_buffer *buf) { unsigned int i; dprintf("\tbuf = { " ".index=%u, " ".type=%i, " ".bytesused=%u, " ".flags=0x%x, " ".field=%i, " ".timestamp = { tv_sec=%lu, tv_usec=%lu }, " ".timecode = { " ".type=%u, " ".flags=0x%x, " ".frames=%u, " ".seconds=%u, " ".minutes=%u, " ".hours=%u, " ".userbits = { 0x%x, 0x%x, 0x%x, 0x%x } " " }, " ".sequence=%u, " ".memory=%i, ", buf->index, buf->type, buf->bytesused, buf->flags, buf->field, buf->timestamp.tv_sec, buf->timestamp.tv_usec, buf->timecode.type, buf->timecode.flags, buf->timecode.frames, buf->timecode.seconds, buf->timecode.minutes, buf->timecode.hours, buf->timecode.userbits[0], buf->timecode.userbits[1], buf->timecode.userbits[2], buf->timecode.userbits[3], buf->sequence, buf->memory); switch (buf->memory) { case V4L2_MEMORY_USERPTR: dprintf(".m.userptr=0x%lx, ", buf->m.userptr); for (i = sizeof(buf->m.userptr); i < sizeof(buf->m); i++) { dprintf("((__u8*)&.m)[%u]=0x%x, ", i, ((__u8 *) & buf->m)[i]); } break; case V4L2_MEMORY_MMAP: case V4L2_MEMORY_OVERLAY: default: dprintf(".m.offset=%u, ", buf->m.offset); for (i = sizeof(buf->m.offset); i < sizeof(buf->m); i++) { dprintf("((__u8*)&.m)[%u]=0x%x, ", i, ((__u8 *) & buf->m)[i]); } } dprintf(".length=%u, " ".input=%u, " ".reserved=0x%x " "}\n", buf->length, buf->input, buf->reserved); } void show_v4l2_input(struct v4l2_input *input) { dprintf("\tinput = {.index=%u, .name=\"%s\", " ".type=0x%X, .audioset=0x%X, .tuner=0x%X, " ".std=%llX, " ".status=0x%X, " ".reserved[]={ 0x%X, 0x%X, 0x%X, 0x%X } }\n", input->index, input->name, input->type, input->audioset, input->tuner, input->std, input->status, input->reserved[0], input->reserved[1], input->reserved[2], input->reserved[3] ); } void show_v4l2_frmsizeenum(struct v4l2_frmsizeenum *framesize) { dprintf("\tframesize = { .index=%u, " ".pixel_format=0x%x, " ".type=%u, ", framesize->index, framesize->pixel_format, framesize->type); switch (framesize->type) { case V4L2_FRMSIZE_TYPE_DISCRETE: dprintf(".discrete = { .width=%u, heigth=%u }, ", framesize->discrete.width, framesize->discrete.height); break; case V4L2_FRMSIZE_TYPE_CONTINUOUS: case V4L2_FRMSIZE_TYPE_STEPWISE: dprintf(".stepwise = { .min_width=%u, " ".max_width=%u, " ".step_width=%u, " ".min_height=%u, " ".max_height=%u, " ".step_height=%u }, ", framesize->stepwise.min_width, framesize->stepwise.max_width, framesize->stepwise.step_width, framesize->stepwise.min_height, framesize->stepwise.max_height, framesize->stepwise.step_height); break; default: ; } dprintf(".reserved = { 0x%x, 0x%x } }\n", framesize->reserved[0], framesize->reserved[1] ); }
C++程序
|
166行
|
3.66 KB
原始内容
高亮显示
复制内容
×
已收藏
收藏成功,您可以在我收藏的代码页面中查看,其地址为:
https://www.androidos.net.cn/my/collect/code
。
登录后可以享受更多权益
您还没有登录,登录后您可以:
收藏Android系统代码
收藏喜欢的文章
多个平台共享账号
去登录
首次使用?从这里
注册