亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? rebuffer.template

?? 一個共享源碼的音頻庫1
?? TEMPLATE
?? 第 1 頁 / 共 2 頁
字號:
/*	rebuffer.template -- this is a TEMPLATE for a rebuffer module	since C has no templates I use this method to get a type-independent	rebuffering module.  This avoids enormous amounts of duplicated code.	to use this file, #include it with the following tokens defined:	#define PRFX(word) XXXX ## word	#define INITFUNC(word) initXXXX ## word	#define NAMESTRING(word) "XXXX" #word	#define TYPE YYYY	where XXXX is replaced with the prefix you want for the module	name and YYYY is replaced with the type the routine works with.  	All the other stuff above stays the same.  Here is an example:	#define PRFX(word) int2 ## word	#define INITFUNC(word) initint2 ## word	#define NAMESTRING(word) "int2" #word	#define TYPE signed short int	#include "rebuffer.template"	I would just have you set two variables and do the above myself,	but the C preprocessor is so brain dead that it does not evaluate	actual arguments to preprocessor functions until after they are	substituted in! (and thus concatenated, and thus unable to be	substituted).	The alternative to this (other than to use C++, which would make this	whole damn library so much easier to write and to read) is to have	large numbers of almost identical copies of the rebuffering routines	with a few type fields different.  This is to be avoided.	This code will then define a module called (using above example)	int2rebufferv2f and another called int2rebufferf2v.*//* instance data of rebuffering modules */typedef struct PRFX(rebuffer_data){	bool multiple_of;	/* TRUE=buffer to multiple-of not exactly... */	AFframecount nsamps;	/* # of fixed samples / multiple-of */	TYPE *buf;		/* buf of nsamps samples */	long offset;		/* see code for meaning */	bool eof;		/* (pull only) end of input stream reached */	bool sent_short_chunk;	/* (pull only) end of output stream indicated */	TYPE *saved_buf;	/* (push only) saved buffer */	long saved_offset;	/* (push only) saved buffer offset */} PRFX(rebuffer_data);#define REBUFFER_DATA PRFX(rebuffer_data)/* REBUFFER variable to fixed -- PUSH ONLY */void PRFX(rebufferv2fmax_push)(struct _AFmoduleinst *i){  REBUFFER_DATA *d = i->modspec;      int nframes = d->nsamps/i->inc->f.channelCount;  if (d->multiple_of)    /* actually, it can be less, but this is ok */    i->outc->nframes = i->inc->nframes + nframes;   else    i->outc->nframes = nframes;}void PRFX(rebufferv2frun_push)(struct _AFmoduleinst *i){  REBUFFER_DATA *d = i->modspec;      long samples2push = i->inc->nframes * i->inc->f.channelCount;  TYPE *inbufp = i->inc->buf;  /* d->offset could be from 0 to nsamps. 0 is no saved samples,     nsamps is all saved samples (should never be nsamps though)      offset thus contains a count of the valid data samples */  assert(d->offset >= 0 && d->offset < d->nsamps);  /* check that we will be able to push even one block */  if (d->offset + samples2push >= d->nsamps)    {      /* push the currently buffered samples through */      if (d->offset != 0)        memcpy(i->outc->buf, d->buf, sizeof(TYPE)*d->offset);      if (d->multiple_of)        {          /* round down to nearest d->nsamps */          int n = (((d->offset+samples2push) / d->nsamps) * d->nsamps);          /*              Example with d->nsamps==5, d->offset==3, and samples2push=10.             B=a buffered sample             N=a new sample (pushed into module on this call)             Note that we group samples in groups of d->nsamps since they must             be pushed that way (any # of groups at a time):              offset  samples2push                 |-||------------|                 BBBNN  NNNNN  NNN....                    |-------|                     n-offset                 |----------|                       n             n is the number of samples we will push on this run.  What's             left over (3 samples in this case) will get buffered for use             in the next run.          */                                          assert(n > d->offset);          memcpy((TYPE *)i->outc->buf + d->offset, inbufp,                  sizeof(TYPE)*(n - d->offset)); /* fill in rest of outbuf */                    _AFpush(i, n / i->outc->f.channelCount);                    inbufp += n - d->offset;          samples2push -= n - d->offset;          assert(samples2push >= 0);          d->offset = 0;        /* the buffer is now empty */        }      else        {          while (d->offset + samples2push >= d->nsamps)            {              int n = d->nsamps - d->offset;              /*                  Same example as above.  Everything is the same except now                 we can only push one group of d->nsamps samples at a time,                 so we must loop through groups, and n takes on several                 values:                                     offset  samples2push                       |-||------------|                       BBBNN  NNNNN  NNN....                          ||  |---|                           n    n                 n says how many samples to take from the input chunk.                 n first has the value d->nsamps - d->offset, and then it                 always has the value d->nsamps.              */                             memcpy((TYPE *)i->outc->buf + d->offset, inbufp,                      sizeof(TYPE)*n); /* fill in rest of outbuf */                            _AFpush(i, d->nsamps / i->outc->f.channelCount);                            inbufp += n;              samples2push -= n;              assert(samples2push >= 0);              d->offset = 0;                /* clear out the buffer */            }        }           /* if we pushed blocks, then we must have used all stored samples */      assert(d->offset == 0);       }  /* at this point: guaranteed that  d->offset + samples2push < d->nsamps */  assert(d->offset + samples2push < d->nsamps);  /* save remaining samples in buffer */  if ( samples2push != 0 )    {      memcpy(d->buf+d->offset, inbufp, sizeof(TYPE)*samples2push);      d->offset += samples2push;    }  assert(d->offset >= 0 && d->offset < d->nsamps);}void PRFX(rebufferv2fsync1)(struct _AFmoduleinst *i){  REBUFFER_DATA *d = i->modspec;      assert(d->offset >= 0 && d->offset < d->nsamps);  /*     save all the samples and the offset so we can     restore our state later.  */  memcpy(d->saved_buf, d->buf, sizeof(TYPE)*d->nsamps);  d->saved_offset = d->offset;  }void PRFX(rebufferv2fsync2)(struct _AFmoduleinst *i){  REBUFFER_DATA *d = i->modspec;      /* d->offset could be from 0 to nsamps. 0 is no saved samples,     nsamps is all saved samples (should never be nsamps though)     offset thus contains a count of the valid data samples */  assert(d->offset >= 0 && d->offset < d->nsamps);  /*      push the currently buffered samples through--even if there     are none!           in other words, push a SHORT CHUNK -- see modules.c TOF for more info !  */  if (d->offset != 0)    {      memcpy(i->outc->buf, d->buf, sizeof(TYPE)*d->offset);    }  _AFpush(i, d->offset / i->outc->f.channelCount); /* SHORT CHUNK */  /* restore state saved in sync1 */  memcpy(d->buf, d->saved_buf, sizeof(TYPE)*d->nsamps);  d->offset = d->saved_offset;    assert(d->offset >= 0 && d->offset < d->nsamps);}void PRFX(rebufferv2ffree)(struct _AFmoduleinst *i){  REBUFFER_DATA *d = i->modspec;    if (d->buf)    free(d->buf);  if (d->saved_buf)    free(d->saved_buf);}_AFmodule PRFX(rebufferv2f) ={  NAMESTRING(rebufferv2f),  AF_NULL,  AF_NULL, PRFX(rebufferv2fmax_push),  AF_NULL, AF_NULL, AF_NULL,  PRFX(rebufferv2frun_push), PRFX(rebufferv2fsync1), PRFX(rebufferv2fsync2),  AF_NULL,  PRFX(rebufferv2ffree)};_AFmoduleinst INITFUNC(rebufferv2f)(AFframecount nsamps, bool multiple_of){  _AFmoduleinst ret = _AFnewmodinst(&PRFX(rebufferv2f));  REBUFFER_DATA *d = _af_malloc(sizeof (REBUFFER_DATA));  d->nsamps = nsamps;  d->offset = 0;  d->buf = _af_malloc(sizeof (TYPE) * nsamps);  d->multiple_of = multiple_of;  d->saved_buf = _af_malloc(sizeof (TYPE) * nsamps);  ret.modspec = d;    DEBG(printf("%s nsamps=%d multiple_of=%d\n", NAMESTRING(rebufferv2f),              nsamps, multiple_of));  return(ret);}/* ===== REBUFFER fixed to variable -- PULL ONLY */void PRFX(rebufferf2vmax_pull)(struct _AFmoduleinst *i){  REBUFFER_DATA *d = i->modspec;      long nframes = d->nsamps / i->inc->f.channelCount;  if (d->multiple_of)    /* actually, it can be less, but this is ok */    i->inc->nframes = i->outc->nframes + nframes;   else    i->inc->nframes = nframes;}void PRFX(rebufferf2vrun_pull)(struct _AFmoduleinst *i){  REBUFFER_DATA *d = i->modspec;      long samples2pull = i->outc->nframes * i->outc->f.channelCount;  TYPE *outbufp = i->outc->buf;    /* d->offset could be from 0 to nsamps. 0=saved all samples,     nsamps=saved no samples (should never be 0 though) 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产午夜精品美女毛片视频| 欧美一区二区私人影院日本| 成人午夜激情视频| 激情五月婷婷综合网| 蜜臀99久久精品久久久久久软件| 偷窥少妇高潮呻吟av久久免费| 亚洲综合在线第一页| 亚洲精品视频在线观看网站| 一区二区久久久久| 亚洲国产精品久久久久秋霞影院 | 99久久国产免费看| 99久久精品国产网站| 91网页版在线| 欧美人体做爰大胆视频| 欧美久久久久久久久久 | 久久99久国产精品黄毛片色诱| 日韩在线一区二区| 精品写真视频在线观看| 国产一区二区三区黄视频| 懂色av噜噜一区二区三区av| 99国产精品久久久久| 色94色欧美sute亚洲线路一ni | 蜜乳av一区二区| 国产专区欧美精品| 91丨porny丨蝌蚪视频| 欧美日本在线看| 国产亚洲精品超碰| 亚洲综合999| 色综合天天综合网国产成人综合天| 国产91丝袜在线18| 欧美伊人久久久久久午夜久久久久| 欧美一区二区三区在| 久久久精品tv| 亚洲不卡在线观看| 国产成人激情av| 欧美自拍丝袜亚洲| 国产欧美一区二区精品性色| 亚洲精品免费看| 国产一区二区三区视频在线播放| 91麻豆自制传媒国产之光| 日韩精品一区二区在线观看| 亚洲日本一区二区| 国产乱码字幕精品高清av| 欧美午夜精品久久久久久孕妇 | 天天影视色香欲综合网老头| 国产精品99久久久久久宅男| 欧日韩精品视频| 中文字幕免费不卡| 日韩电影在线观看电影| 99久久精品费精品国产一区二区| 日韩欧美中文一区二区| 一区二区欧美国产| 91小视频免费看| 欧美国产97人人爽人人喊| 美女视频网站久久| 欧美日韩一区二区三区在线| 中文字幕在线观看不卡| 国模少妇一区二区三区| 欧美精品18+| 一区二区三区在线视频观看58| 丁香网亚洲国际| 亚洲精品在线免费播放| 日韩av午夜在线观看| 欧美日韩高清一区二区| 亚洲黄色av一区| 91视频91自| 自拍视频在线观看一区二区| 国产成人免费视频一区| 国产日韩欧美综合一区| 国产精品一区二区男女羞羞无遮挡 | 欧美二区三区的天堂| 成人欧美一区二区三区在线播放| 国产精品自在欧美一区| 久久久噜噜噜久噜久久综合| 国产一二三精品| 久久久不卡网国产精品一区| 久久成人免费日本黄色| 久久综合久久久久88| 国产毛片精品视频| 欧美第一区第二区| 国内精品免费**视频| 久久久久久久精| 成人精品视频网站| 亚洲精品第一国产综合野| 在线精品视频一区二区三四| 亚洲伊人伊色伊影伊综合网| 欧美三区免费完整视频在线观看| 亚洲成人久久影院| 精品国产99国产精品| 丰满少妇在线播放bd日韩电影| 国产精品免费久久久久| 色88888久久久久久影院野外| 亚洲午夜电影在线观看| 91精品国产黑色紧身裤美女| 国内精品视频一区二区三区八戒| 欧美国产激情二区三区| 91农村精品一区二区在线| 亚洲成人免费在线观看| 精品国内二区三区| 波多野结衣欧美| 一个色综合av| 精品av久久707| 91亚洲大成网污www| 青青草97国产精品免费观看| 久久久久久99精品| 日本乱人伦aⅴ精品| 秋霞午夜av一区二区三区| 国产色爱av资源综合区| 91久久精品国产91性色tv| 不卡在线观看av| 日韩和欧美的一区| 国产日韩成人精品| 欧美日本乱大交xxxxx| 国产不卡一区视频| 亚洲超丰满肉感bbw| 国产精品素人一区二区| 欧美乱妇23p| 处破女av一区二区| 美腿丝袜亚洲综合| 亚洲精品欧美综合四区| 久久免费的精品国产v∧| 欧美性猛交xxxxxxxx| 成人激情综合网站| 六月丁香综合在线视频| 一片黄亚洲嫩模| 国产精品婷婷午夜在线观看| 日韩一区二区在线看| 91免费看`日韩一区二区| 精品一区二区日韩| 天天综合日日夜夜精品| 亚洲黄色av一区| 国产精品高潮呻吟| 久久影院电视剧免费观看| 欧美肥妇free| 色国产综合视频| 9色porny自拍视频一区二区| 国产在线麻豆精品观看| 日本在线不卡一区| 亚洲va欧美va人人爽午夜 | 95精品视频在线| 国产乱妇无码大片在线观看| 欧美a级理论片| 亚洲午夜羞羞片| 一区二区三区不卡视频 | 欧美性大战久久久久久久| www.在线成人| kk眼镜猥琐国模调教系列一区二区| 91在线一区二区| 成人久久18免费网站麻豆| 国产精品99久久久久久宅男| 韩国一区二区三区| 韩国理伦片一区二区三区在线播放| 日日夜夜精品视频免费| 午夜在线电影亚洲一区| 日韩国产精品久久久| 免费成人在线视频观看| 久久草av在线| 国产高清在线精品| 99久久精品免费观看| 欧亚一区二区三区| 欧美年轻男男videosbes| 51久久夜色精品国产麻豆| 欧美精品aⅴ在线视频| 欧美一区二区三区四区高清| 欧美成人一区二区三区| 26uuuu精品一区二区| 久久久久久免费毛片精品| 国产精品美日韩| 亚洲精品福利视频网站| 舔着乳尖日韩一区| 久久精品国产一区二区三| 国产成人aaa| 91在线你懂得| 69精品人人人人| 久久久蜜臀国产一区二区| 国产精品三级av在线播放| 亚洲一区二区欧美日韩| 久久se精品一区精品二区| 粉嫩一区二区三区在线看| 色婷婷av一区二区三区gif| 在线不卡a资源高清| 久久久久亚洲蜜桃| 亚洲免费av在线| 国内外精品视频| 色综合天天性综合| 日韩午夜精品视频| 国产精品精品国产色婷婷| 午夜精品久久久久久久99樱桃| 精品一区精品二区高清| 在线亚洲免费视频| www久久精品| 亚洲第一福利视频在线| 国产精品99久| 日韩一区二区不卡| 成人欧美一区二区三区白人| 久久精品免费观看| 在线观看91精品国产入口| 国产欧美一区二区三区在线看蜜臀 | 国产日韩欧美在线一区| 亚洲电影欧美电影有声小说|