资源简介
基于三星arm平台 mfc5.1 v4l2 mfc视频解码 参考代码
代码片段和文件信息
/*
* V4L2 Codec decoding example application
* Kamil Debski
*
* Argument parser
*
* Copyright 2012 Samsung Electronics Co. Ltd.
*
* Licensed under the Apache License Version 2.0 (the “License“);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing software
* distributed under the License is distributed on an “AS IS“ BASIS
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#include
#include
#include
#include
#include “common.h“
#include “parser.h“
void print_usage(char *name)
{
// “d:f:i:m:c:V“
printf(“Usage:\n“);
printf(“\t./%s\n“ name);
printf(“\t-c - The codec of the encoded stream\n“);
printf(“\t\t Available codecs: mpeg4 h264\n“);
printf(“\t-d - frame buffer device (e.g. /dev/fb0)\n“);
printf(“\t-f - FIMC device (e.g. /dev/video4)\n“);
printf(“\t-i - Input file name\n“);
printf(“\t-m - MFC device (e.g. /dev/video8)\n“);
printf(“\t-V - synchronise to vsync\n“);
//printf(“\t- - \n“);
printf(“\tp2\n“);
printf(“\n“);
}
void init_to_defaults(struct instance *i)
{
memset(i 0 sizeof(*i));
}
int get_codec(char *str)
{
if (strncasecmp(“mpeg4“ str 5) == 0) {
return V4L2_PIX_FMT_MPEG4;
} else if (strncasecmp(“h264“ str 5) == 0) {
return V4L2_PIX_FMT_H264;
} else if (strncasecmp(“h263“ str 5) == 0) {
return V4L2_PIX_FMT_H263;
} else if (strncasecmp(“xvid“ str 5) == 0) {
return V4L2_PIX_FMT_XVID;
} else if (strncasecmp(“mpeg2“ str 5) == 0) {
return V4L2_PIX_FMT_MPEG2;
} else if (strncasecmp(“mpeg1“ str 5) == 0) {
return V4L2_PIX_FMT_MPEG1;
}
return 0;
}
int parse_args(struct instance *i int argc char **argv)
{
int c;
init_to_defaults(i);
while ((c = getopt(argc argv “c:d:f:i:m:V“)) != -1) {
switch (c) {
case ‘c‘:
i->parser.codec = get_codec(optarg);
break;
case ‘d‘:
i->fb.name = optarg;
break;
case ‘f‘:
i->fimc.name = optarg;
break;
case ‘i‘:
i->in.name = optarg;
break;
case ‘m‘:
i->mfc.name = optarg;
break;
case ‘V‘:
i->fb.double_buf = 1;
break;
default:
err(“Bad argument“);
return -1;
}
}
if (!i->in.name || !i->fb.name || !i->fimc.name || !i->mfc.name) {
err(“The following arguments are required: -d -f -i -m -c“);
return -1;
}
if (!i->parser.codec) {
err(“Unknown or not set codec (-c)“);
return -1;
}
switch (i->parser.codec) {
case V4L2_PIX_FMT_XVID:
case V4L2_PIX_FMT_H263:
case V4L2_PIX_FMT_MPEG4:
i->parser.func = parse_mpeg4_stream;
break;
case V4L2_PIX_FMT_H264:
i->parser.func = parse_h264_stream;
break;
case V4L2_PIX_FMT_MPEG1:
case V4L2_PIX_FMT_MPEG2:
相关资源
- 空间后方交会MFC版,C++源代码
- mfcc的C程序
- 解决装了IE8后VS2008添加MFC类出现脚本
- mfc实现简单文字输出
- MFC折叠和展开窗口实现方法.txt
- 三个PE解析器代码学习
- MFC 内嵌第三方Exe程序 VC2010
- ftp客户端及服务器 mfc 网络高级程序设
- 基于C++和MFC的哈夫曼编码压缩软件的
- mfc ado操作sql数据库查询、读写,删除
- c++实现的MFC课程设计--旅游管理系统
- MFC 编程:圣诞节的礼物
- 基于MFC图书管理系统
- 最好用的MFC改名工具
- 用MFC写的坦克大战
- vc网络聊天室源代码mfc聊天器VC网络编
- C++ MFC 放大和缩小图片源码
- SQlite3库及头文件在VS2010中MFC使用成功
- mfc邮箱地址管理系统(c++access)
- LZW压缩算法C++源码
- MFC下获取字符的点阵字模数据并显示
- OpenGL+MFC+点云
- MFC下配置opengl环境具体步骤
- 利用opencv做的垃圾检测代码
- 电梯仿真代码MFC(绝对可以
- 多窗口之间的通信
- 课程设计--计算器基于MFC
- rsa MFC实现源码
- MFC绘制阿基米德螺旋线.rar
- MFC在ListCtrl中加入Button
评论
共有 条评论