资源简介
jetson tk1 平台上的 ov5640驱动 以及应用捕获程序,已验证
代码片段和文件信息
#include
/* Verification Test Environment Include Files */
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define TEST_BUFFER_NUM 3
struct testbuffer
{
unsigned char *start;
size_t offset;
unsigned int length;
};
struct testbuffer buffers[TEST_BUFFER_NUM];
int g_in_width = 176;
int g_in_height = 144;
int g_out_width = 176;
int g_out_height = 144;
int g_top = 0;
int g_left = 0;
int g_input = 0;
int g_capture_count = 100;
int g_rotate = 0;
int g_cap_fmt = V4L2_PIX_FMT_UYVY;
int g_camera_framerate = 30;
int g_extra_pixel = 0;
int g_capture_mode = 0;
char g_v4l_device[100] = “/dev/video0“;
static void print_pixelformat(char *prefix int val)
{
printf(“%s: %c%c%c%c\n“ prefix ? prefix : “pixelformat“
val & 0xff
(val >> 8) & 0xff
(val >> 16) & 0xff
(val >> 24) & 0xff);
}
int start_capturing(int fd_v4l)
{
unsigned int i;
struct v4l2_buffer buf;
enum v4l2_buf_type type;
for (i = 0; i < TEST_BUFFER_NUM; i++)
{
memset(&buf 0 sizeof (buf));
buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
buf.memory = V4L2_MEMORY_MMAP;
buf.index = i;
if (ioctl(fd_v4l VIDIOC_QUERYBUF &buf) < 0)
{
printf(“VIDIOC_QUERYBUF error\n“);
return -1;
}
buffers[i].length = buf.length;
buffers[i].offset = (size_t) buf.m.offset;
buffers[i].start = mmap (NULL buffers[i].length
PROT_READ | PROT_WRITE MAP_SHARED
fd_v4l buffers[i].offset);
memset(buffers[i].start 0xFF buffers[i].length);
}
for (i = 0; i < TEST_BUFFER_NUM; i++)
{
memset(&buf 0 sizeof (buf));
buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
buf.memory = V4L2_MEMORY_MMAP;
buf.index = i;
buf.m.offset = buffers[i].offset;
if (g_extra_pixel){
buf.m.offset += g_extra_pixel *
(g_out_width + 2 * g_extra_pixel) + g_extra_pixel;
}
if (ioctl (fd_v4l VIDIOC_QBUF &buf) < 0) {
printf(“VIDIOC_QBUF error\n“);
return -1;
}
}
type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
if (ioctl (fd_v4l VIDIOC_STREAMON &type) < 0) {
printf(“VIDIOC_STREAMON error\n“);
return -1;
}
return 0;
}
int stop_capturing(int fd_v4l)
{
enum v4l2_buf_type type;
type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
return ioctl (fd_v4l VIDIOC_STREAMOFF &type);
}
int v4l_capture_setup(void)
{
struct v4l2_format f
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 50964 2017-06-07 10:58 ov5640_v4l2_0607.c
文件 3592 2017-04-14 10:11 ov5640驱动tk1移植.txt
文件 11063 2017-06-08 17:35 capture.c
- 上一篇:WINCC-如何使用自定义的对话框实现用户登录实测
- 下一篇:QT获取天气程序
相关资源
- linux ov5640驱动源码
- Jetson_Nano开发板原理图.pdf
- linux下操做OV5640摄像头
- deepstream_sdk_v5.0.0_jetson.tbz2
- ov5640自动对焦固件
- Jetson-tx2 加密芯片测试案例
- Jetson TX2 串口POLLIN中断
- OV5640-datasheet.pdf
- libwebkitgtk1.0.0的rpm安装包
- STK安装包及教材工具书
- STK11.2安装包网盘链接及提取码.txt
- STM32F429+OV5640原理图
- OV5640寄存器配置文件 45帧
- OV5640学习笔记
- OV5640摄像头模块原理图及封装库.rar
- Jetson-TX2-Generic-Customer-Pinmux-Template
评论
共有 条评论