LinuxÉãÏñÍ·±à³ÌС½á
ת×Ô£ºhttp://blog.chinaunix.net/u/7547/showart_122619.html
1.open device:
video_dev = open("\dev\video0",O_RDWR));
2.get the information of the video device
struct video_capability video_cap;
memset(&video_cap,0,sizeof(video_cap));
if(ioctl(video_dev,VIDIOCGCAP,&video_cap) == -1)
{
perror("Cann't get the information of the video device");
close(video_dev);
exit(1);
}
3.get the information of the channels
struct video_channel video_chan;
memset(&video_chan,0,sizeof(video_chan));
for(channel = 0;channel < video_cap.channels;channel++)
{
video_chan.channel = channel;
if(ioctl(video_dev,VIDIOCGCHAN,&video_chan) == -1)
{
perror("Cann't get the information of the channels");
close(video_dev);
exit(3);
}
if(video_chan.type == VIDEO_TYPE_TV)
{
#ifdef DEBUG
printf("NO.%d channel is %s,type is tv!\n",channel,video_chan.name);
#endif
}
if(video_chan.type == VIDEO_TYPE_CAMERA)
Ïà¹ØÎĵµ£º
http://news.csdn.net/a/20091229/216149.html
Techradar£ºLinuxÑݱäµÄ15¸öÖØ´óÀï³Ì±®
2009-12-29 15:50 | 273´ÎÔĶÁ | À´Ô´£º»ª¾ü×ÊѶ ¡¾ÒÑÓÐ0ÌõÆÀÂÛ¡¿·¢±íÆÀÂÛ
¹Ø¼ü´Ê£ºLinux | ¸ÐлcarlkxiafhwfhwµÄÌṩ | ÊÕ²ØÕâÆªÐÂÎÅ
¾Ý¹úÍâýÌ屨µÀ£¬½üÈÕ£¬×ÊÑ¶ÍøÕ¾TechradarÁоÙÁ˽üÊ®ÄêÀ´LinuxÏ ......
Ò»¡¢±³¾°ÖªÊ¶
1¡¢USB Mass StorageÀà¹æ·¶¸ÅÊö
USB ×éÖ¯ÔÚuniversal Serial Bus Mass Storage Class Spaceification 1.1°æ±¾Öж¨ÒåÁ˺£Á¿´æ´¢É豸ÀࣨMass Storage Class£©µÄ¹æ·¶£¬Õâ¸öÀà¹æ·¶°üÀ¨Ëĸö
¶ÀÁ¢µÄ×ÓÀ ......
CMake ÊÇÒ»¸ö¿çƽ̨µÄ×Ô¶¯»¯½¨¹¹ÏµÍ³,ËüʹÓÃÒ»¸öÃûΪ CMakeLists.txt µÄÎļþÀ´ÃèÊö¹¹½¨¹ý³Ì,¿ÉÒÔ²úÉú±ê×¼µÄ¹¹½¨Îļþ,Èç Unix µÄ Makefile »òWindows Visual C++ µÄ projects/workspaces ¡£Îļþ CMakeLists.txt ÐèÒªÊÖ¹¤±àд,Ò²¿ÉÒÔͨ¹ý±àд½Å±¾½øÐаë×Ô¶¯µÄÉú³É¡£CMake ÌṩÁË±È autoconfig ¸ü¼ò½àµÄÓï·¨¡£ÔÚ linux Æ½Ì¨Ï ......
ÔÚÔĶÁNginxµÄ´úÂë.ÏÈÅöµ½µÄÊÇÏ̲߳¿·ÖµÄ
ÒòΪ´Ómain¿ªÊ¼×îÔçÊÇ×öÏ̲߳¿·ÖµÄ¹¤×÷
ʵϰһÏÂpthread·½ÃæµÄÄÚÈÝ
#include "pthread.h"
#include "stdio.h"
void* thread_test(void* ptr)
{
while(1)
printf("i am child pthread\n");
}
int ma ......