资源简介
1、通过文件检索可以将固定的目录下的三种类型的图片和音乐给检索出来,然后再利用libjpeg库和libpng库来对jpeg图片和png图片进行解码,再通过直接操作framebuffer来将图片显示在LCD屏上,还可以使用触摸屏来切换图片。而播放音乐就要移植madplay库并使用当中的命令来播放音乐,也可以使用触摸屏来切换音乐。
2、拍照功能,利用V4L2来实现采集一帧的图像并把它显示在LCD屏上。
3、语言交互功能,首先在客户端实现录音功能,并将录制的音频数据通过socket传输到服务端中,服务端就先进行语法构建然后再进行语法识别,最后将识别的结果保存在xml文件中,再通过socket将xml文件传输到客户端中,客户端再对这个文件进行解析,并得到识别的id号,然后再根据id进行相应的操作,如操作上述两个功能。
代码片段和文件信息
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
//#include “check_mac.h“
#define CAMERA_DEV “/dev/video3“
struct buffer {
void* start;
size_t length;
};
struct buffer* buffers = NULL;
static unsigned int n_buffers = 0;
unsigned int *fb_mem;
struct my_error_mgr {
struct jpeg_error_mgr pub; /* “public“ fields */
jmp_buf setjmp_buffer; /* for return to caller */
};
typedef struct my_error_mgr * my_error_ptr;
int SHOW_JPEG_file (char * filename)
{
/* This struct contains the JPEG decompression parameters and pointers to
* working space (which is allocated as needed by the JPEG library).
*/
struct jpeg_decompress_struct cinfo;
/* We use our private extension JPEG error handler.
* Note that this struct must live as long as the main JPEG parameter
* struct to avoid dangling-pointer problems.
*/
struct my_error_mgr jerr;
/* More stuff */
FILE * infile; /* source file */
char * buffer; /* Output row buffer */
int row_stride; /* physical row width in output buffer */
/* In this example we want to open the input file before doing anything else
* so that the setjmp() error recovery below can assume the file is open.
* VERY IMPORTANT: use “b“ option to fopen() if you are on a machine that
* requires it in order to read binary files.
*/
if ((infile = fopen(filename “rb“)) == NULL) {
fprintf(stderr “can‘t open %s\n“ filename);
return 0;
}
/* Step 1: allocate and initialize JPEG decompression object */
/* We set up the normal JPEG error routines then override error_exit. */
cinfo.err = jpeg_std_error(&jerr.pub);
jerr.pub.error_exit = NULL;
/* Establish the setjmp return context for my_error_exit to use. */
if (setjmp(jerr.setjmp_buffer)) {
/* If we get here the JPEG code has signaled an error.
* We need to clean up the JPEG object close the input file and return.
*/
jpeg_destroy_decompress(&cinfo);
fclose(infile);
return 0;
}
/* Now we can initialize the JPEG decompression object. */
jpeg_create_decompress(&cinfo);
/* Step 2: specify data source (eg a file) */
jpeg_stdio_src(&cinfo infile);
/* Step 3: read file parameters with jpeg_read_header() */
(void) jpeg_read_header(&cinfo TRUE);
/* We can ignore the return value from jpeg_read_header since
* (a) suspension is not possible with the stdio data source and
* (b) we passed TRUE to reject a tables-only JPEG file as an error.
* See libjpeg.txt for more info.
*/
/* Step 4: set parameters for decompression */
/* In this example we don‘t need to change any of the defaults set by
* jpeg_read_header() so we do nothing here.
*/
/* Step 5: Start decompressor */
(
相关资源
- linux基础培训.pdf
- Linux云计算-Shell脚本100例
- 京峰-Linux从入门到精通完整版
- OpenSSH升级包、依赖包
- Linux命令行与shell脚本编程大全.第3版
- Comfast CF-WU810N Linux驱动及安装说明.r
- Linux Shell脚本攻略第3版 图灵版
- linux命令行字典
- RGB565格式转BMP
- 6968389Linux内核剖析(书籍注释代码)
- rtl8723bs wifi linux驱动
- Linux安装SNMP服务所需要rpm包
- Linux课设实现ftp服务器和客户端
- 搭建OMAPL138的Linux开发环境 LINUX交叉编
- 嵌入式 L inux C 语言应用程序设计.pd
- linux音频设备编程
- QT之模仿手机主界面左右滑动翻页,带
- linux环境下课程设计《二级文件系统》
- GitLab技术分享PPT
- 8192CU LINUX驱动
- Linux Device Driver Development
- 网络调试助手---Linux和windowds下都可以
- Kali Linux渗透测试的艺术 PDF电子书 带
- Linux内核完全剖析
- Linux设备驱动程序(中文版第三版)
- Linux高级程序设计 第三版 源码杨宗德
- 移远移植源码-Linux
- Linux CentOS离线环境下安装Apache所需要
- Linux 基础教程 基于ubuntu
- Windows与Linux之间使用socket进行文件传
评论
共有 条评论