91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 16KB
    文件類型: .gz
    金幣: 1
    下載: 0 次
    發布日期: 2021-05-22
  • 語言: 其他
  • 標簽: avilib??JPEM??AVI視頻??

資源簡介

這是一個測試程序,將V4L2采集到的JPEG數據使用avilib封裝成AVI視頻,詳細介紹看博客 http://blog.csdn.net/li_wen01/article/details/53707863

資源截圖

代碼片段和文件信息

/*
?*??avilib.c
?*
?*??Copyright?(C)?Thomas?謘treich?-?June?2001
?*??multiple?audio?track?support?Copyright?(C)?2002?Thomas?謘treich?
?*
?*??Original?code:
?*??Copyright?(C)?1999?Rainer?Johanni??
?*
?*??This?file?is?part?of?transcode?a?linux?video?stream?processing?tool
?*??????
?*??transcode?is?free?software;?you?can?redistribute?it?and/or?modify
?*??it?under?the?terms?of?the?GNU?General?Public?License?as?published?by
?*??the?Free?Software?Foundation;?either?version?2?or?(at?your?option)
?*??any?later?version.
?*???
?*??transcode?is?distributed?in?the?hope?that?it?will?be?useful
?*??but?WITHOUT?ANY?WARRANTY;?without?even?the?implied?warranty?of
?*??MERCHANTABILITY?or?FITNESS?FOR?A?PARTICULAR?PURPOSE.??See?the
?*??GNU?General?Public?License?for?more?details.
?*???
?*??You?should?have?received?a?copy?of?the?GNU?General?Public?License
?*??along?with?GNU?Make;?see?the?file?COPYING.??If?not?write?to
?*??the?Free?Software?Foundation?675?Mass?Ave?Cambridge?MA?02139?USA.?
?*
?*/

#include?“avilib.h“
//#include?

#define?INFO_LIST

/*?The?following?variable?indicates?the?kind?of?error?*/

long?AVI_errno;

#define?MAX_INFO_STRLEN?64
static?char?id_str[MAX_INFO_STRLEN];

#define?frame_RATE_SCALE?1000000

#ifndef?PACKAGE
#define?PACKAGE?“my“
#define?VERSION?“0.00“
#endif

#ifndef?O_BINARY
/*?win32?wants?a?binary?flag?to?open();?this?sets?it?to?null
???on?platforms?that?don‘t?have?it.?*/
#define?O_BINARY?0
#endif

/*******************************************************************
?*?????????????????????????????????????????????????????????????????*
?*????Utilities?for?writing?an?AVI?File????????????????????????????*
?*?????????????????????????????????????????????????????????????????*
?*******************************************************************/

static?size_t?avi_read(int?fd?char?*buf?size_t?len)
{
???size_t?n?=?0;
???size_t?r?=?0;

???while?(r???????n?=?read?(fd?buf?+?r?len?-?r);

??????if?(n?<=?0)
??return?r;
??????r?+=?n;
???}

???return?r;
}

static?size_t?avi_write?(int?fd?char?*buf?size_t?len)
{
???size_t?n?=?0;
???size_t?r?=?0;

???while?(r???????n?=?write?(fd?buf?+?r?len?-?r);
??????if?(n??????????return?n;
??????
??????r?+=?n;
???}
???return?r;
}

/*?HEADERBYTES:?The?number?of?bytes?to?reserve?for?the?header?*/

#define?HEADERBYTES?2048

/*?AVI_MAX_LEN:?The?maximum?length?of?an?AVI?file?we?stay?a?bit?below
????the?2GB?limit?(Remember:?2*10^9?is?smaller?than?2?GB)?*/

#define?AVI_MAX_LEN?(UINT_MAX-(1<<20)*16-HEADERBYTES)

#define?PAD_EVEN(x)?(?((x)+1)?&?~1?)


/*?Copy?n?into?dst?as?a?4?byte?little?endian?number.
???Should?also?work?on?big?endian?machines?*/

static?void?long2str(unsigned?char?*dst?int?n)
{
???dst[0]?=?(n????)&0xff;
???dst[1]?=?(n>>?8)&0xff;
???dst[2]?=?(n>>16)&0xff;
???dst[3]?=?(n>>24)&0xff;
}

/*?Convert?a?string?of?4?or?2?bytes?to?a?number
???also?working?on?big?endian?machines?*/

static?unsigned?long?str2ulong(unsigned?char?*str)
{
???return?(?str[0]?|?

評論

共有 條評論