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

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

?? pa_win_ds.c

?? 一個開源的sip源代碼
?? C
?? 第 1 頁 / 共 5 頁
字號:
/* * $Id: pa_win_ds.c 1116 2006-09-06 15:47:03Z rossb $ * Portable Audio I/O Library DirectSound implementation * * Authors: Phil Burk, Robert Marsanyi & Ross Bencina * Based on the Open Source API proposed by Ross Bencina * Copyright (c) 1999-2006 Ross Bencina, Phil Burk, Robert Marsanyi * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files * (the "Software"), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *//* * The text above constitutes the entire PortAudio license; however,  * the PortAudio community also makes the following non-binding requests: * * Any person wishing to distribute modifications to the Software is * requested to send the modifications to the original developer so that * they can be incorporated into the canonical version. It is also  * requested that these non-binding requests be included along with the  * license above. *//** @file @ingroup hostaip_src    @todo implement paInputOverflow callback status flag        @todo implement paNeverDropInput.    @todo implement host api specific extension to set i/o buffer sizes in frames    @todo implement initialisation of PaDeviceInfo default*Latency fields (currently set to 0.)    @todo implement ReadStream, WriteStream, GetStreamReadAvailable, GetStreamWriteAvailable    @todo audit handling of DirectSound result codes - in many cases we could convert a HRESULT into        a native portaudio error code. Standard DirectSound result codes are documented at msdn.    @todo implement IsFormatSupported    @todo check that CoInitialize() CoUninitialize() are always correctly        paired, even in error cases.    @todo call PaUtil_SetLastHostErrorInfo with a specific error string (currently just "DSound error").    @todo make sure all buffers have been played before stopping the stream        when the stream callback returns paComplete    old TODOs from phil, need to work out if these have been done:        O- fix "patest_stop.c"*/#include <stdio.h>#include <string.h> /* strlen() */#include "pa_util.h"#include "pa_allocation.h"#include "pa_hostapi.h"#include "pa_stream.h"#include "pa_cpuload.h"#include "pa_process.h"#include "pa_win_ds_dynlink.h"#if (defined(WIN32) && (defined(_MSC_VER) && (_MSC_VER >= 1200))) /* MSC version 6 and above */#pragma comment( lib, "dsound.lib" )#pragma comment( lib, "winmm.lib" )#endif/* provided in newer platform sdks and x64 */#ifndef DWORD_PTR#define DWORD_PTR DWORD#endif#define PRINT(x) PA_DEBUG(x);#define ERR_RPT(x) PRINT(x)#define DBUG(x)   PRINT(x)#define DBUGX(x)  PRINT(x)#define PA_USE_HIGH_LATENCY   (0)#if PA_USE_HIGH_LATENCY#define PA_WIN_9X_LATENCY     (500)#define PA_WIN_NT_LATENCY     (600)#else#define PA_WIN_9X_LATENCY     (140)#define PA_WIN_NT_LATENCY     (280)#endif#define PA_WIN_WDM_LATENCY       (120)#define SECONDS_PER_MSEC      (0.001)#define MSEC_PER_SECOND       (1000)/* prototypes for functions declared in this file */#ifdef __cplusplusextern "C"{#endif /* __cplusplus */PaError PaWinDs_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index );#ifdef __cplusplus}#endif /* __cplusplus */static void Terminate( struct PaUtilHostApiRepresentation *hostApi );static PaError OpenStream( struct PaUtilHostApiRepresentation *hostApi,                           PaStream** s,                           const PaStreamParameters *inputParameters,                           const PaStreamParameters *outputParameters,                           double sampleRate,                           unsigned long framesPerBuffer,                           PaStreamFlags streamFlags,                           PaStreamCallback *streamCallback,                           void *userData );static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi,                                  const PaStreamParameters *inputParameters,                                  const PaStreamParameters *outputParameters,                                  double sampleRate );static PaError CloseStream( PaStream* stream );static PaError StartStream( PaStream *stream );static PaError StopStream( PaStream *stream );static PaError AbortStream( PaStream *stream );static PaError IsStreamStopped( PaStream *s );static PaError IsStreamActive( PaStream *stream );static PaTime GetStreamTime( PaStream *stream );static double GetStreamCpuLoad( PaStream* stream );static PaError ReadStream( PaStream* stream, void *buffer, unsigned long frames );static PaError WriteStream( PaStream* stream, const void *buffer, unsigned long frames );static signed long GetStreamReadAvailable( PaStream* stream );static signed long GetStreamWriteAvailable( PaStream* stream );/* FIXME: should convert hr to a string */#define PA_DS_SET_LAST_DIRECTSOUND_ERROR( hr ) \    PaUtil_SetLastHostErrorInfo( paDirectSound, hr, "DirectSound error" )/************************************************* DX Prototypes **********/static BOOL CALLBACK CollectGUIDsProc(LPGUID lpGUID,                                     LPCTSTR lpszDesc,                                     LPCTSTR lpszDrvName,                                     LPVOID lpContext );/************************************************************************************//********************** Structures **************************************************//************************************************************************************//* PaWinDsHostApiRepresentation - host api datastructure specific to this implementation */typedef struct PaWinDsDeviceInfo{    GUID                             guid;    GUID                            *lpGUID;    double                           sampleRates[3];} PaWinDsDeviceInfo;typedef struct{    PaUtilHostApiRepresentation inheritedHostApiRep;    PaUtilStreamInterface    callbackStreamInterface;    PaUtilStreamInterface    blockingStreamInterface;    PaUtilAllocationGroup   *allocations;    /* implementation specific data goes here */    PaWinDsDeviceInfo       *winDsDeviceInfos;} PaWinDsHostApiRepresentation;/* PaWinDsStream - a stream data structure specifically for this implementation */typedef struct PaWinDsStream{    PaUtilStreamRepresentation streamRepresentation;    PaUtilCpuLoadMeasurer cpuLoadMeasurer;    PaUtilBufferProcessor bufferProcessor;/* DirectSound specific data. *//* Output */    LPDIRECTSOUND        pDirectSound;    LPDIRECTSOUNDBUFFER  pDirectSoundOutputBuffer;    DWORD                outputBufferWriteOffsetBytes;     /* last write position */    INT                  outputBufferSizeBytes;    INT                  bytesPerOutputFrame;    /* Try to detect play buffer underflows. */    LARGE_INTEGER        perfCounterTicksPerBuffer; /* counter ticks it should take to play a full buffer */    LARGE_INTEGER        previousPlayTime;    UINT                 previousPlayCursor;    UINT                 outputUnderflowCount;    BOOL                 outputIsRunning;    /* use double which lets us can play for several thousand years with enough precision */    double               dsw_framesWritten;    double               framesPlayed;/* Input */    LPDIRECTSOUNDCAPTURE pDirectSoundCapture;    LPDIRECTSOUNDCAPTUREBUFFER   pDirectSoundInputBuffer;    INT                  bytesPerInputFrame;    UINT                 readOffset;      /* last read position */    UINT                 inputSize;        MMRESULT         timerID;    int              framesPerDSBuffer;    double           framesWritten;    double           secondsPerHostByte; /* Used to optimize latency calculation for outTime */    PaStreamCallbackFlags callbackFlags;    /* FIXME - move all below to PaUtilStreamRepresentation */    volatile int     isStarted;    volatile int     isActive;    volatile int     stopProcessing; /* stop thread once existing buffers have been returned */    volatile int     abortProcessing; /* stop thread immediately */} PaWinDsStream;/************************************************************************************** Duplicate the input string using the allocations allocator.** A NULL string is converted to a zero length string.** If memory cannot be allocated, NULL is returned.**/static char *DuplicateDeviceNameString( PaUtilAllocationGroup *allocations, const char* src ){    char *result = 0;        if( src != NULL )    {        size_t len = strlen(src);        result = (char*)PaUtil_GroupAllocateMemory( allocations, (long)(len + 1) );        if( result )            memcpy( (void *) result, src, len+1 );    }    else    {        result = (char*)PaUtil_GroupAllocateMemory( allocations, 1 );        if( result )            result[0] = '\0';    }    return result;}/************************************************************************************** DSDeviceNameAndGUID, DSDeviceNameAndGUIDVector used for collecting preliminary** information during device enumeration.*/typedef struct DSDeviceNameAndGUID{    char *name; // allocated from parent's allocations, never deleted by this structure    GUID guid;    LPGUID lpGUID;} DSDeviceNameAndGUID;typedef struct DSDeviceNameAndGUIDVector{    PaUtilAllocationGroup *allocations;    PaError enumerationError;    int count;    int free;    DSDeviceNameAndGUID *items; // Allocated using LocalAlloc()} DSDeviceNameAndGUIDVector;static PaError InitializeDSDeviceNameAndGUIDVector(        DSDeviceNameAndGUIDVector *guidVector, PaUtilAllocationGroup *allocations ){    PaError result = paNoError;    guidVector->allocations = allocations;    guidVector->enumerationError = paNoError;    guidVector->count = 0;    guidVector->free = 8;    guidVector->items = (DSDeviceNameAndGUID*)LocalAlloc( LMEM_FIXED, sizeof(DSDeviceNameAndGUID) * guidVector->free );    if( guidVector->items == NULL )        result = paInsufficientMemory;        return result;}static PaError ExpandDSDeviceNameAndGUIDVector( DSDeviceNameAndGUIDVector *guidVector ){    PaError result = paNoError;    DSDeviceNameAndGUID *newItems;    int i;        /* double size of vector */    int size = guidVector->count + guidVector->free;    guidVector->free += size;    newItems = (DSDeviceNameAndGUID*)LocalAlloc( LMEM_FIXED, sizeof(DSDeviceNameAndGUID) * size * 2 );    if( newItems == NULL )    {        result = paInsufficientMemory;    }    else    {        for( i=0; i < guidVector->count; ++i )        {            newItems[i].name = guidVector->items[i].name;            if( guidVector->items[i].lpGUID == NULL )            {                newItems[i].lpGUID = NULL;            }            else            {                newItems[i].lpGUID = &newItems[i].guid;                memcpy( &newItems[i].guid, guidVector->items[i].lpGUID, sizeof(GUID) );;            }        }        LocalFree( guidVector->items );        guidVector->items = newItems;    }                                    return result;}/*    it's safe to call DSDeviceNameAndGUIDVector multiple times*/static PaError TerminateDSDeviceNameAndGUIDVector( DSDeviceNameAndGUIDVector *guidVector )

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕日韩精品一区| 成人免费高清在线| 国产精品88av| 欧美日韩aaaaaa| 中文字幕欧美一区| 国产麻豆精品在线| 日韩精品一区国产麻豆| 亚洲一区二区五区| 99精品国产99久久久久久白柏 | 91久久一区二区| 久久美女艺术照精彩视频福利播放| 一区二区三国产精华液| 成人黄色777网| 久久久影视传媒| 极品少妇xxxx精品少妇偷拍| 欧美日韩亚洲综合| 亚洲午夜免费福利视频| 99在线精品一区二区三区| 国产欧美日韩综合| 国产中文一区二区三区| 精品欧美一区二区在线观看| 日韩av一区二区在线影视| 欧洲一区二区三区在线| 综合色天天鬼久久鬼色| 成人av一区二区三区| 国产视频一区二区在线| 风间由美中文字幕在线看视频国产欧美| 日韩亚洲欧美高清| 另类专区欧美蜜桃臀第一页| 日韩精品一区二区三区中文不卡 | 国产乱人伦精品一区二区在线观看| 久久久精品免费观看| 久久99久久99| 久久免费美女视频| 成人美女视频在线观看18| 国产亚洲婷婷免费| 94色蜜桃网一区二区三区| 亚洲人成亚洲人成在线观看图片| 91美女视频网站| 亚洲a一区二区| 欧美一区二区免费观在线| 美女视频一区在线观看| 久久影音资源网| 成人黄色在线看| 一区二区三区中文在线| 777奇米四色成人影色区| 免费成人在线观看视频| 国产亚洲成av人在线观看导航| 国产成人午夜99999| 亚洲品质自拍视频| 717成人午夜免费福利电影| 蜜乳av一区二区三区| 国产欧美精品在线观看| 一本大道久久a久久综合婷婷| 亚洲一区二区av电影| 日韩免费一区二区三区在线播放| 国产精品资源站在线| 亚洲视频1区2区| 欧美精品一级二级| 岛国精品一区二区| 性感美女极品91精品| 久久视频一区二区| 91传媒视频在线播放| 麻豆久久久久久久| 中文字幕一区二区三区四区不卡| 欧美老女人第四色| 粉嫩蜜臀av国产精品网站| 亚洲午夜国产一区99re久久| 久久女同精品一区二区| 欧美午夜一区二区三区免费大片| 国产综合色视频| 午夜精彩视频在线观看不卡| 国产日韩欧美综合一区| 欧美日韩亚洲综合| 成人18视频日本| 九色porny丨国产精品| 亚洲综合激情另类小说区| 亚洲精品一区二区三区在线观看 | 一区av在线播放| 久久亚洲二区三区| 欧美日韩大陆一区二区| 成+人+亚洲+综合天堂| 久久激情五月婷婷| 亚洲一区二区视频在线| 中文字幕一区二区三区在线观看| 日韩一区二区高清| 欧美亚洲国产一区二区三区 | 蜜臀av国产精品久久久久| 中文字幕一区av| 久久老女人爱爱| 日韩一级精品视频在线观看| 欧洲精品一区二区| 97se亚洲国产综合在线| 成人伦理片在线| 国产精品一区二区免费不卡| 蜜桃视频一区二区| 天天操天天色综合| 亚洲国产欧美另类丝袜| 亚洲精品国产品国语在线app| 国产日韩欧美a| 欧美极品aⅴ影院| 精品动漫一区二区三区在线观看| 欧美一区二区网站| 欧美日韩高清一区二区不卡| 欧美日韩中文字幕一区二区| 欧美视频在线观看一区二区| 在线观看视频一区| 欧美日韩黄色影视| 欧美乱熟臀69xxxxxx| 欧美日本一道本在线视频| 欧美无人高清视频在线观看| 欧美日韩一区不卡| 欧美日韩精品一区二区天天拍小说| 日本伦理一区二区| 欧美日韩高清一区二区不卡| 欧美视频在线播放| 制服丝袜成人动漫| 日韩欧美综合在线| 久久精品视频网| 国产精品伦理在线| 夜夜嗨av一区二区三区网页| 一区二区三区鲁丝不卡| 亚洲一级片在线观看| 免费观看日韩av| 国产精品18久久久| 91麻豆国产在线观看| 欧美图片一区二区三区| 欧美一级免费大片| 久久人人爽人人爽| 亚洲同性同志一二三专区| 亚洲精品国产一区二区三区四区在线| 亚洲黄网站在线观看| 日韩成人午夜电影| 成人综合在线观看| 日本韩国欧美三级| 日韩免费看网站| 亚洲国产成人午夜在线一区| 玉足女爽爽91| 美女精品自拍一二三四| 99这里只有久久精品视频| 欧美夫妻性生活| 国产精品免费aⅴ片在线观看| 亚洲综合无码一区二区| 麻豆免费精品视频| 一道本成人在线| 精品理论电影在线| 亚洲一区在线免费观看| 国产一区二区三区综合| 日本精品一区二区三区高清| 26uuu精品一区二区| 一区二区三区日韩欧美| 国产主播一区二区三区| 欧美日韩午夜在线视频| 国产精品嫩草久久久久| 美女看a上一区| 91激情在线视频| 久久久久高清精品| 亚洲成人午夜影院| 99久久精品国产麻豆演员表| 欧美α欧美αv大片| 一区二区三区四区视频精品免费 | 欧美成人a视频| 亚洲精品国产精品乱码不99| 国产乱理伦片在线观看夜一区| 欧美四级电影网| 中文字幕制服丝袜一区二区三区| 免费欧美高清视频| 在线观看免费亚洲| 国产精品人人做人人爽人人添| 日本午夜一区二区| 欧美亚洲图片小说| 一区精品在线播放| 国产成人免费xxxxxxxx| 欧美成人三级在线| 免费看欧美女人艹b| 在线观看不卡一区| 亚洲欧洲日韩女同| 国产99精品国产| 久久久精品欧美丰满| 久久国产三级精品| 欧美一区二区三区免费视频| 亚洲综合一区二区| 在线亚洲人成电影网站色www| 亚洲国产经典视频| 大胆亚洲人体视频| 欧美激情资源网| 国产黄色成人av| 国产三级欧美三级日产三级99 | 久久久久国产精品厨房| 极品少妇一区二区| 精品99一区二区| 久久精品国产亚洲a| 日韩精品中文字幕在线不卡尤物 | xf在线a精品一区二区视频网站| 免费在线观看一区| 精品日产卡一卡二卡麻豆| 理论片日本一区| 久久蜜桃av一区精品变态类天堂| 国内精品国产成人国产三级粉色 | 成人污污视频在线观看|