S3C6410的tv out输出lcd的内容
来源:互联网 发布:京东联盟网站源码 编辑:程序博客网 时间:2024/05/29 19:48
http://blog.chinaunix.net/uid-20587912-id-2940408.html
s3c6410 TVout 测试
一.tvout_app的移植
为了测试S3C6410的电视输出,我拿了官方的tvout_app中的测试,这个做的相当初糙,好象是很老的版本,在更改了Makefile后编译,最后发现有函数未定义
/home/huisen/project/tvout/tvout_app/tv_test.c:450: undefined reference to `s3c_get_media_memory'
查看源码是这个原因造成的
ctrl.value = POST_BUFF_BASE_ADDR;
而这个宏是如下定义
#define POST_BUFF_BASE_ADDR(UINT32)s3c_get_media_memory(S3C_MDEV_TV)
这个应用程序直接调用驱动里的函数,这在LINUX是不可以的。我估计三星也没把这TVOUT当回事,直接就发布了,编译通不过也不管。虽然在培训上s3c6410用的很多,但是很多细节上来看,在花了很长时间做s3c2440后,三星匆忙推出s3c6410,然后大队人马就去搞s5p系列了。留一下一堆问题。
一种最简单方法是扩展s3c-tvenc的驱动,增加一个VIDIOC_G_CTRL的ioctl指令,让其在驱动中调用s3c_get_media_memory.
在s3c-tvenc.c 增加如下代码:
新增函数: s3c_tvenc_get_v4l2_control()
在s3c_tvenc_do_ioctl()增加命令支持
- static int s3c_tvenc_get_v4l2_control(struct v4l2_control *ctrl)
- {
- switch(ctrl->id) {
- case V4L2_CID_MPEG_STREAM_PID_VIDEO:
- ctrl->value = tv_param.sp.SrcFrmSt;
- return 0;
- default:
- return -EINVAL;
- }
- return 0;
-
- }
- static int s3c_tvenc_do_ioctl(struct inode *inode,struct file *filp,unsigned int cmd,void *arg)
- {
- // ...
- /* add by Andrew Huang */
- case VIDIOC_G_CTRL:
- {
- struct v4l2_control *ctrl = arg;
- //printk("P: VIDIOC_S_CTRL \n");
- ret = s3c_tvenc_get_v4l2_control(ctrl);
- return ret;
- }
- // ...
- }
修改tv_test.c 代码,增加对上述ioctl命令的调用
修改 450行,增加如下代码
- //add by Andrew Huang
- #if 1
- ret = ioctl(tvout_fp, VIDIOC_G_CTRL, &ctrl);
- if(ret < 0) {
- printf("V4L2 APPL : ioctl(VIDIOC_G_CTRL) failed\n");
- goto err;
- }
- #else
- //ctrl.value = POST_BUFF_BASE_ADDR; // 编译通不过
- #endif
去掉一些编译警告后,可以测试了。
- [root@huisen tvout_app]# make clean
- rm -f tv_test ./tv_test.o ./FrameExtractor.o ./SsbSipH264Decode.o ./H264Frames.o ./SsbSipMfcDecode.o ./SsbSipLogMsg.o
- [root@huisen tvout_app]# make
- arm-linux-gcc -Wall -O0 -lpthread -I/home/huisen/rom/mini6410/linux-2.6.28.6/include -I. -g -c -o tv_test.o tv_test.c
- arm-linux-gcc -Wall -O0 -lpthread -I/home/huisen/rom/mini6410/linux-2.6.28.6/include -I. -g -c -o FrameExtractor.o FrameExtractor.c
- arm-linux-gcc -Wall -O0 -lpthread -I/home/huisen/rom/mini6410/linux-2.6.28.6/include -I. -g -c -o SsbSipH264Decode.o SsbSipH264Decode.c
- arm-linux-gcc -Wall -O0 -lpthread -I/home/huisen/rom/mini6410/linux-2.6.28.6/include -I. -g -c -o H264Frames.o H264Frames.c
- arm-linux-gcc -Wall -O0 -lpthread -I/home/huisen/rom/mini6410/linux-2.6.28.6/include -I. -g -c -o SsbSipMfcDecode.o SsbSipMfcDecode.c
- arm-linux-gcc -Wall -O0 -lpthread -I/home/huisen/rom/mini6410/linux-2.6.28.6/include -I. -g -c -o SsbSipLogMsg.o SsbSipLogMsg.c
- arm-linux-gcc -Wall -O0 -lpthread -I/home/huisen/rom/mini6410/linux-2.6.28.6/include -I. -g -o tv_test ./tv_test.o ./FrameExtractor.o ./SsbSipH264Decode.o ./H264Frames.o ./SsbSipMfcDecode.o ./SsbSipLogMsg.o -lpthread
二.测试电视电视输出
你可以直接使用一个电视机,当然有时比较麻烦,有时不好找,或者用电视机盒转到VGA的显示器上.
我使用专业一点的AV/TV 8"的监视器,这是我用用来做高清摄像头,DVR开发的,这时可以用来测试一下S3C6410的TV输出,将其输入信号变成AV信号
测试1:将LCD的显示结果发送到TV上
./tv_test 0
运行时能看电视屏幕显示LCD的效果,操作LCD,TV同步更新.注意这里设备结点是(/dev/video14)
三.测试H.264输出
第一次测试,H.264失败
- [root@hxy tvout_app]# ./tv_test 1 slamtv60.264
- This mode works with MFC decoder
- SsbSipH264DecodeExe:1
- H.264 Decoder Configuration Failed.
首先在Linux 2.6.28.6中有两个MFC驱动,查看.config使用的是 CONFIG_VIDEO_MFC10,即MFC 1.0的驱动
后试着换了一下三星自带两个测试视频.可以正常的电视上播放
- [root@FriendlyARM tvout_app]# ./tv_test 1 wanted.264
- This mode works with MFC decoder
- width=640 height=480.
- Device file open
- V4L2 APPL : Name of the interface is S3C TV-OUT driveTVENCODER
- V4L2 APPL : [1]: IN channel name Memory input (MSDMA)
- V4L2 APPL : DMA INPUT
- V4L2 APPL : [0]: OUT channel name TV-OUT
- V4L2 APPL : TV OUT
动画能正常播放,但是电影有点小卡.
0 0
- S3C6410的tv out输出lcd的内容
- ti 板子的tv输出和lcd输出的切换
- S3C6410-linux已经实现OSD与视频在LCD与TV上的完美叠加
- s3c6410 LCD在uboot下的驱动
- s3c6410 LCD驱动的分析过程(1)
- S3C6410(arm11核)的LCD移植
- 打印输出语句:System.out.println("内容"+i+1+"内容");与System.out.println("内容"+(i+1)+"内容");的区别
- 将System.out.println()打印的内容输出到文件
- Logcat中查看System.out.println()输出的内容(转)
- hadoop中System.out.println输出内容的查看
- 基于S3C6410&WINCE6.0的LCD驱动详解
- 基于S3C6410&WINCE6.0的LCD驱动详解
- 基于S3C6410&WINCE6.0的LCD驱动详解
- s3c6410(arm11核)的LCD驱动理解一(probe)
- 基于S3C6410&WINCE6.0的LCD驱动详解
- 基于S3C6410&WINCE6.0的LCD驱动详解
- 基于am3358的lcd输出
- S3C6410 TFT-LCD控制器的设置(LCD型号为WXCAT43,开发板为飞凌OK6410B)
- [LeetCode163]Missing Ranges
- [LeetCode167]Two Sum II - Input array is sorted
- 一个简单的马尔可夫过程例子
- Volley源码解析
- B-树和B+树的应用:数据搜索和数据库索引【转】
- S3C6410的tv out输出lcd的内容
- [LeetCode170]Two Sum III - Data structure design
- [LeetCode186]Reverse Words in a String II
- [LeetCode243]Shortest Word Distance
- [LeetCode244]Shortest Word Distance II
- [LeetCode245] Shortest Word Distance III
- [Web前端]梳理-JavaScript.5.函数,6.作用域
- servlet解决浏览器的跨域
- [Rman]Rman增量备份level012的区别