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

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

?? pa_skeleton.c

?? 一個開源的sip源代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* * $Id: pa_skeleton.c 1097 2006-08-26 08:27:53Z rossb $ * Portable Audio I/O Library skeleton implementation * demonstrates how to use the common functions to implement support * for a host API * * Based on the Open Source API proposed by Ross Bencina * Copyright (c) 1999-2002 Ross Bencina, Phil Burk * * 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 common_src @brief Skeleton implementation of support for a host API. @note This file is provided as a starting point for implementing support for a new host API. IMPLEMENT ME comments are used to indicate functionality which much be customised for each implementation.*/#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"/* prototypes for functions declared in this file */#ifdef __cplusplusextern "C"{#endif /* __cplusplus */PaError PaSkeleton_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index );#ifdef __cplusplus}#endif /* __cplusplus */static void Terminate( struct PaUtilHostApiRepresentation *hostApi );static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi,                                  const PaStreamParameters *inputParameters,                                  const PaStreamParameters *outputParameters,                                  double sampleRate );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 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 );/* IMPLEMENT ME: a macro like the following one should be used for reporting host errors */#define PA_SKELETON_SET_LAST_HOST_ERROR( errorCode, errorText ) \    PaUtil_SetLastHostErrorInfo( paInDevelopment, errorCode, errorText )/* PaSkeletonHostApiRepresentation - host api datastructure specific to this implementation */typedef struct{    PaUtilHostApiRepresentation inheritedHostApiRep;    PaUtilStreamInterface callbackStreamInterface;    PaUtilStreamInterface blockingStreamInterface;    PaUtilAllocationGroup *allocations;    /* implementation specific data goes here */}PaSkeletonHostApiRepresentation;  /* IMPLEMENT ME: rename this */PaError PaSkeleton_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex ){    PaError result = paNoError;    int i, deviceCount;    PaSkeletonHostApiRepresentation *skeletonHostApi;    PaDeviceInfo *deviceInfoArray;    skeletonHostApi = (PaSkeletonHostApiRepresentation*)PaUtil_AllocateMemory( sizeof(PaSkeletonHostApiRepresentation) );    if( !skeletonHostApi )    {        result = paInsufficientMemory;        goto error;    }    skeletonHostApi->allocations = PaUtil_CreateAllocationGroup();    if( !skeletonHostApi->allocations )    {        result = paInsufficientMemory;        goto error;    }    *hostApi = &skeletonHostApi->inheritedHostApiRep;    (*hostApi)->info.structVersion = 1;    (*hostApi)->info.type = paInDevelopment;            /* IMPLEMENT ME: change to correct type id */    (*hostApi)->info.name = "skeleton implementation";  /* IMPLEMENT ME: change to correct name */    (*hostApi)->info.defaultInputDevice = paNoDevice;  /* IMPLEMENT ME */    (*hostApi)->info.defaultOutputDevice = paNoDevice; /* IMPLEMENT ME */    (*hostApi)->info.deviceCount = 0;      deviceCount = 0; /* IMPLEMENT ME */        if( deviceCount > 0 )    {        (*hostApi)->deviceInfos = (PaDeviceInfo**)PaUtil_GroupAllocateMemory(                skeletonHostApi->allocations, sizeof(PaDeviceInfo*) * deviceCount );        if( !(*hostApi)->deviceInfos )        {            result = paInsufficientMemory;            goto error;        }        /* allocate all device info structs in a contiguous block */        deviceInfoArray = (PaDeviceInfo*)PaUtil_GroupAllocateMemory(                skeletonHostApi->allocations, sizeof(PaDeviceInfo) * deviceCount );        if( !deviceInfoArray )        {            result = paInsufficientMemory;            goto error;        }        for( i=0; i < deviceCount; ++i )        {            PaDeviceInfo *deviceInfo = &deviceInfoArray[i];            deviceInfo->structVersion = 2;            deviceInfo->hostApi = hostApiIndex;            deviceInfo->name = 0; /* IMPLEMENT ME: allocate block and copy name eg:                deviceName = (char*)PaUtil_GroupAllocateMemory( skeletonHostApi->allocations, strlen(srcName) + 1 );                if( !deviceName )                {                    result = paInsufficientMemory;                    goto error;                }                strcpy( deviceName, srcName );                deviceInfo->name = deviceName;            */            deviceInfo->maxInputChannels = 0;  /* IMPLEMENT ME */            deviceInfo->maxOutputChannels = 0;  /* IMPLEMENT ME */                        deviceInfo->defaultLowInputLatency = 0.;  /* IMPLEMENT ME */            deviceInfo->defaultLowOutputLatency = 0.;  /* IMPLEMENT ME */            deviceInfo->defaultHighInputLatency = 0.;  /* IMPLEMENT ME */            deviceInfo->defaultHighOutputLatency = 0.;  /* IMPLEMENT ME */              deviceInfo->defaultSampleRate = 0.; /* IMPLEMENT ME */                        (*hostApi)->deviceInfos[i] = deviceInfo;            ++(*hostApi)->info.deviceCount;        }    }    (*hostApi)->Terminate = Terminate;    (*hostApi)->OpenStream = OpenStream;    (*hostApi)->IsFormatSupported = IsFormatSupported;    PaUtil_InitializeStreamInterface( &skeletonHostApi->callbackStreamInterface, CloseStream, StartStream,                                      StopStream, AbortStream, IsStreamStopped, IsStreamActive,                                      GetStreamTime, GetStreamCpuLoad,                                      PaUtil_DummyRead, PaUtil_DummyWrite,                                      PaUtil_DummyGetReadAvailable, PaUtil_DummyGetWriteAvailable );    PaUtil_InitializeStreamInterface( &skeletonHostApi->blockingStreamInterface, CloseStream, StartStream,                                      StopStream, AbortStream, IsStreamStopped, IsStreamActive,                                      GetStreamTime, PaUtil_DummyGetCpuLoad,                                      ReadStream, WriteStream, GetStreamReadAvailable, GetStreamWriteAvailable );    return result;error:    if( skeletonHostApi )    {        if( skeletonHostApi->allocations )        {            PaUtil_FreeAllAllocations( skeletonHostApi->allocations );            PaUtil_DestroyAllocationGroup( skeletonHostApi->allocations );        }                        PaUtil_FreeMemory( skeletonHostApi );    }    return result;}static void Terminate( struct PaUtilHostApiRepresentation *hostApi ){    PaSkeletonHostApiRepresentation *skeletonHostApi = (PaSkeletonHostApiRepresentation*)hostApi;    /*        IMPLEMENT ME:            - clean up any resources not handled by the allocation group    */    if( skeletonHostApi->allocations )    {        PaUtil_FreeAllAllocations( skeletonHostApi->allocations );        PaUtil_DestroyAllocationGroup( skeletonHostApi->allocations );    }    PaUtil_FreeMemory( skeletonHostApi );}static PaError IsFormatSupported( struct PaUtilHostApiRepresentation *hostApi,                                  const PaStreamParameters *inputParameters,                                  const PaStreamParameters *outputParameters,                                  double sampleRate ){    int inputChannelCount, outputChannelCount;    PaSampleFormat inputSampleFormat, outputSampleFormat;        if( inputParameters )    {        inputChannelCount = inputParameters->channelCount;        inputSampleFormat = inputParameters->sampleFormat;        /* all standard sample formats are supported by the buffer adapter,            this implementation doesn't support any custom sample formats */        if( inputSampleFormat & paCustomFormat )            return paSampleFormatNotSupported;                    /* unless alternate device specification is supported, reject the use of            paUseHostApiSpecificDeviceSpecification */        if( inputParameters->device == paUseHostApiSpecificDeviceSpecification )            return paInvalidDevice;        /* check that input device can support inputChannelCount */        if( inputChannelCount > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels )            return paInvalidChannelCount;        /* validate inputStreamInfo */        if( inputParameters->hostApiSpecificStreamInfo )            return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */    }    else    {        inputChannelCount = 0;    }    if( outputParameters )    {        outputChannelCount = outputParameters->channelCount;        outputSampleFormat = outputParameters->sampleFormat;        /* all standard sample formats are supported by the buffer adapter,            this implementation doesn't support any custom sample formats */        if( outputSampleFormat & paCustomFormat )            return paSampleFormatNotSupported;                    /* unless alternate device specification is supported, reject the use of            paUseHostApiSpecificDeviceSpecification */        if( outputParameters->device == paUseHostApiSpecificDeviceSpecification )            return paInvalidDevice;        /* check that output device can support outputChannelCount */        if( outputChannelCount > hostApi->deviceInfos[ outputParameters->device ]->maxOutputChannels )            return paInvalidChannelCount;        /* validate outputStreamInfo */        if( outputParameters->hostApiSpecificStreamInfo )            return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */    }    else    {        outputChannelCount = 0;    }        /*        IMPLEMENT ME:            - if a full duplex stream is requested, check that the combination                of input and output parameters is supported if necessary            - check that the device supports sampleRate        Because the buffer adapter handles conversion between all standard        sample formats, the following checks are only required if paCustomFormat        is implemented, or under some other unusual conditions.            - check that input device can support inputSampleFormat, or that                we have the capability to convert from inputSampleFormat to                a native format            - check that output device can support outputSampleFormat, or that                we have the capability to convert from outputSampleFormat to                a native format    */    /* suppress unused variable warnings */    (void) sampleRate;    return paFormatIsSupported;}/* PaSkeletonStream - a stream data structure specifically for this implementation */typedef struct PaSkeletonStream{ /* IMPLEMENT ME: rename this */    PaUtilStreamRepresentation streamRepresentation;    PaUtilCpuLoadMeasurer cpuLoadMeasurer;    PaUtilBufferProcessor bufferProcessor;    /* IMPLEMENT ME:            - implementation specific data goes here    */    unsigned long framesPerHostCallback; /* just an example */}PaSkeletonStream;/* see pa_hostapi.h for a list of validity guarantees made about OpenStream parameters */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 ){    PaError result = paNoError;    PaSkeletonHostApiRepresentation *skeletonHostApi = (PaSkeletonHostApiRepresentation*)hostApi;    PaSkeletonStream *stream = 0;    unsigned long framesPerHostBuffer = framesPerBuffer; /* these may not be equivalent for all implementations */    int inputChannelCount, outputChannelCount;    PaSampleFormat inputSampleFormat, outputSampleFormat;    PaSampleFormat hostInputSampleFormat, hostOutputSampleFormat;    if( inputParameters )    {        inputChannelCount = inputParameters->channelCount;        inputSampleFormat = inputParameters->sampleFormat;        /* unless alternate device specification is supported, reject the use of            paUseHostApiSpecificDeviceSpecification */        if( inputParameters->device == paUseHostApiSpecificDeviceSpecification )            return paInvalidDevice;        /* check that input device can support inputChannelCount */        if( inputChannelCount > hostApi->deviceInfos[ inputParameters->device ]->maxInputChannels )            return paInvalidChannelCount;        /* validate inputStreamInfo */        if( inputParameters->hostApiSpecificStreamInfo )            return paIncompatibleHostApiSpecificStreamInfo; /* this implementation doesn't use custom stream info */        /* IMPLEMENT ME - establish which  host formats are available */        hostInputSampleFormat =            PaUtil_SelectClosestAvailableFormat( paInt16 /* native formats */, inputSampleFormat );

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区二区不卡| 在线电影院国产精品| 欧洲另类一二三四区| 欧美不卡123| 一区二区三区四区不卡在线 | 91精品国产乱| 亚洲精品乱码久久久久| 国产精品一卡二卡在线观看| 欧美精品亚洲二区| 亚洲精品少妇30p| 成人午夜激情片| 精品日产卡一卡二卡麻豆| 亚洲一区二区影院| 成人av中文字幕| 国产色91在线| 精品一区二区三区在线观看| 777a∨成人精品桃花网| 亚洲永久免费视频| 日本韩国一区二区三区视频| 国产精品免费视频一区| 丁香婷婷综合激情五月色| 久久久久一区二区三区四区| 激情久久五月天| 久久免费视频一区| 国产精品一区二区免费不卡| 亚洲精品一区二区三区福利 | 日韩精品中文字幕在线一区| 亚洲mv在线观看| 欧美三级电影一区| 亚洲综合清纯丝袜自拍| 91免费观看视频| 亚洲免费在线播放| 日本韩国精品一区二区在线观看| 中文字幕亚洲在| 在线亚洲免费视频| 丝袜美腿亚洲色图| 日韩免费一区二区| 国产美女视频91| 国产精品美女www爽爽爽| 99久久精品国产导航| 一区二区三区在线播放| 欧美日韩国产片| 免费在线观看精品| 国产日韩精品一区二区三区在线| 国产成人免费在线观看不卡| 综合欧美亚洲日本| 欧美视频精品在线| 久久机这里只有精品| 中文字幕免费一区| 色婷婷久久99综合精品jk白丝| 一区二区国产盗摄色噜噜| 欧美日韩aaaaa| 国产一区二区0| 一区二区视频在线| 91精品午夜视频| 成人激情动漫在线观看| 亚洲一线二线三线视频| 精品欧美一区二区三区精品久久| 国产a久久麻豆| 一区二区免费在线播放| 欧美成人性战久久| av中文字幕亚洲| 青椒成人免费视频| 最新国产精品久久精品| 91精品国产综合久久福利软件| 国产福利一区二区三区在线视频| 亚洲理论在线观看| 精品国产一区a| 91色porny在线视频| 日本一不卡视频| 亚洲欧洲精品天堂一级| 欧美成人精品1314www| 色综合中文字幕国产| 亚洲成人第一页| 中文文精品字幕一区二区| 欧美人妇做爰xxxⅹ性高电影| 国产一区二区三区久久悠悠色av| 亚洲国产毛片aaaaa无费看| 久久欧美一区二区| 91精品国产乱| 欧美曰成人黄网| 国产69精品久久777的优势| 日韩电影在线免费| 一区二区三区日韩欧美| 国产精品网站一区| 欧美成人r级一区二区三区| 欧美日韩亚洲国产综合| a级精品国产片在线观看| 精品夜夜嗨av一区二区三区| 亚洲综合av网| 亚洲欧美激情插| 国产精品色噜噜| 国产欧美日韩在线| 日韩免费电影一区| 555www色欧美视频| 欧美日韩中文一区| 91久久精品国产91性色tv| 国产99久久久国产精品| 韩日精品视频一区| 麻豆精品在线播放| 麻豆免费精品视频| 精品一区二区免费在线观看| 日日摸夜夜添夜夜添精品视频 | 日本一二三四高清不卡| 精品国精品国产| 日韩欧美久久久| 日韩一区二区三区在线观看| 欧美日韩精品一区二区三区| 欧美三级在线看| 欧美性淫爽ww久久久久无| 日本道在线观看一区二区| 99精品黄色片免费大全| 不卡视频一二三四| 不卡的电影网站| 成人av网站免费观看| 成人av在线播放网址| 99久久免费视频.com| www.视频一区| 在线视频中文字幕一区二区| 欧美亚洲高清一区| 欧美老女人在线| 91精品国产乱| 久久久国产一区二区三区四区小说| 精品成人一区二区三区| 久久影视一区二区| 亚洲国产激情av| 亚洲欧美日韩国产成人精品影院 | 亚洲欧洲韩国日本视频| 亚洲视频网在线直播| 一区二区三区四区五区视频在线观看| 一区二区三区国产精品| 日韩成人伦理电影在线观看| 久久精品99国产精品日本| 成人免费看片app下载| 日本福利一区二区| 日韩午夜精品视频| 欧美激情一区在线观看| 一区二区三区精品视频| 奇米色一区二区| 成人一区二区三区中文字幕| 色婷婷精品久久二区二区蜜臀av| 欧美日韩国产精品成人| 亚洲精品一区二区三区影院| 国产精品成人免费在线| 五月天视频一区| 国产成人精品亚洲午夜麻豆| 色妞www精品视频| 日韩精品一区二区三区视频播放 | 久久欧美中文字幕| 综合久久国产九一剧情麻豆| 强制捆绑调教一区二区| 不卡大黄网站免费看| 欧美高清性hdvideosex| 久久精品夜色噜噜亚洲aⅴ| 亚洲一区国产视频| 国产在线播放一区二区三区| 在线观看亚洲a| 国产人成一区二区三区影院| 亚洲大片免费看| thepron国产精品| 欧美精品一区男女天堂| 亚洲最快最全在线视频| 丁香天五香天堂综合| 欧美久久一二三四区| 国产精品久久久久久久久免费丝袜| 五月天一区二区三区| 97aⅴ精品视频一二三区| 久久久久久免费网| 男人的天堂久久精品| 欧洲人成人精品| 亚洲免费在线看| 成人激情动漫在线观看| 久久久久久久久久电影| 久久精品噜噜噜成人88aⅴ| 欧美在线免费观看亚洲| 国产精品久久久久久妇女6080| 精品一区二区国语对白| 91精品国产综合久久婷婷香蕉| 亚洲乱码日产精品bd| 波多野结衣中文字幕一区| 久久综合丝袜日本网| 美女在线视频一区| 欧美军同video69gay| 一级特黄大欧美久久久| 91免费国产视频网站| 成人欧美一区二区三区小说| 成人黄色电影在线| 欧美经典一区二区| 国产成人久久精品77777最新版本 国产成人鲁色资源国产91色综 | 日韩一区二区中文字幕| 1024成人网| 91蝌蚪国产九色| 亚洲日本乱码在线观看| 91香蕉视频污| 综合精品久久久| 一本大道久久a久久精二百| **欧美大码日韩| 一本大道av一区二区在线播放 | 丝袜亚洲另类欧美| 91.com视频|