資源簡介
程序功能
1、在linux下使用v4l2框架采集視頻
2、使用socket tcp發(fā)送采集到的視頻數(shù)據(jù),下載一個接收yuv數(shù)據(jù)的顯示軟件就可以播放
3、使用select、多線程、線程鎖等技術,值得參考
4、程序邏輯清晰,代碼簡單
包含文件video.c
代碼片段和文件信息
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#define?SERVERPORT?6666
#define?SERVERIP?“10.1.1.42“
typedef?struct?VideoBuffer
{
void?*start;
size_t?length;
}VideoBuffer;
typedef?struct?data
{
unsigned?int?datasize;
char?buf[];
}buf_t;
buf_t?*databuf;
static?VideoBuffer?*buffers=NULL;
pthread_mutex_t?g_lock;
pthread_cond_t?g_cond;
int?fd;
//設置視頻的制式及格式
int?mark()
{
int?ret;
struct?v4l2_capability?cap;//獲取視頻設備的功能
struc
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????5244??2010-11-19?11:49??video.c
-----------?---------??----------?-----??----
?????????????????5244????????????????????1
評論
共有 條評論