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

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

?? pa_mac_core_old.c

?? mediastreamer2是開源的網絡傳輸媒體流的庫
?? C
?? 第 1 頁 / 共 3 頁
字號:
/* * $Id: pa_mac_core_old.c 946 2005-12-24 01:22:52Z bjornroche $ * pa_mac_core.c * Implementation of PortAudio for Mac OS X CoreAudio        *                                                                                          * PortAudio Portable Real-Time Audio Library * Latest Version at: http://www.portaudio.com * * Authors: Ross Bencina and Phil Burk * Copyright (c) 1999-2000 Ross Bencina and 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. * * 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. * * 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. * */#include <CoreAudio/CoreAudio.h>#include <AudioToolbox/AudioToolbox.h>#include <stdio.h>#include <stdlib.h>#include <math.h>#include <assert.h>#include "portaudio.h"#include "pa_trace.h"#include "pa_util.h"#include "pa_allocation.h"#include "pa_hostapi.h"#include "pa_stream.h"#include "pa_cpuload.h"#include "pa_process.h"// =====  constants  =====// =====  structs  =====#pragma mark structs// PaMacCoreHostApiRepresentation - host api datastructure specific to this implementationtypedef struct PaMacCore_HAR{    PaUtilHostApiRepresentation inheritedHostApiRep;    PaUtilStreamInterface callbackStreamInterface;    PaUtilStreamInterface blockingStreamInterface;        PaUtilAllocationGroup *allocations;    AudioDeviceID *macCoreDeviceIds;}PaMacCoreHostApiRepresentation;typedef struct PaMacCore_DI{    PaDeviceInfo inheritedDeviceInfo;}PaMacCoreDeviceInfo;// PaMacCoreStream - a stream data structure specifically for this implementationtypedef struct PaMacCore_S{    PaUtilStreamRepresentation streamRepresentation;    PaUtilCpuLoadMeasurer cpuLoadMeasurer;    PaUtilBufferProcessor bufferProcessor;        int primeStreamUsingCallback;        AudioDeviceID inputDevice;    AudioDeviceID outputDevice;        // Processing thread management --------------//    HANDLE abortEvent;//    HANDLE processingThread;//    DWORD processingThreadId;        char throttleProcessingThreadOnOverload; // 0 -> don't throtte, non-0 -> throttle    int processingThreadPriority;    int highThreadPriority;    int throttledThreadPriority;    unsigned long throttledSleepMsecs;        int isStopped;    volatile int isActive;    volatile int stopProcessing; // stop thread once existing buffers have been returned    volatile int abortProcessing; // stop thread immediately    //    DWORD allBuffersDurationMs; // used to calculate timeouts}PaMacCoreStream;// Data needed by the CoreAudio callback functionstypedef struct PaMacCore_CD{    PaMacCoreStream *stream;    PaStreamCallback *callback;    void *userData;    PaUtilConverter *inputConverter;    PaUtilConverter *outputConverter;    void *inputBuffer;    void *outputBuffer;    int inputChannelCount;    int outputChannelCount;    PaSampleFormat inputSampleFormat;    PaSampleFormat outputSampleFormat;    PaUtilTriangularDitherGenerator *ditherGenerator;}PaMacClientData;// =====  CoreAudio-PortAudio bridge functions =====#pragma mark CoreAudio-PortAudio bridge functions// Maps CoreAudio OSStatus codes to PortAudio PaError codesstatic PaError conv_err(OSStatus error){    PaError result;        switch (error) {        case kAudioHardwareNoError:            result = paNoError; break;        case kAudioHardwareNotRunningError:            result = paInternalError; break;        case kAudioHardwareUnspecifiedError:            result = paInternalError; break;        case kAudioHardwareUnknownPropertyError:            result = paInternalError; break;        case kAudioHardwareBadPropertySizeError:            result = paInternalError; break;        case kAudioHardwareIllegalOperationError:            result = paInternalError; break;        case kAudioHardwareBadDeviceError:            result = paInvalidDevice; break;        case kAudioHardwareBadStreamError:            result = paBadStreamPtr; break;        case kAudioHardwareUnsupportedOperationError:            result = paInternalError; break;        case kAudioDeviceUnsupportedFormatError:            result = paSampleFormatNotSupported; break;        case kAudioDevicePermissionsError:            result = paDeviceUnavailable; break;        default:            result = paInternalError;    }        return result;}/* This function is unusedstatic AudioStreamBasicDescription *InitializeStreamDescription(const PaStreamParameters *parameters, double sampleRate){    struct AudioStreamBasicDescription *streamDescription = PaUtil_AllocateMemory(sizeof(AudioStreamBasicDescription));    streamDescription->mSampleRate = sampleRate;    streamDescription->mFormatID = kAudioFormatLinearPCM;    streamDescription->mFormatFlags = 0;    streamDescription->mFramesPerPacket = 1;        if (parameters->sampleFormat & paNonInterleaved) {        streamDescription->mFormatFlags |= kLinearPCMFormatFlagIsNonInterleaved;        streamDescription->mChannelsPerFrame = 1;        streamDescription->mBytesPerFrame = Pa_GetSampleSize(parameters->sampleFormat);        streamDescription->mBytesPerPacket = Pa_GetSampleSize(parameters->sampleFormat);    }    else {        streamDescription->mChannelsPerFrame = parameters->channelCount;    }        streamDescription->mBytesPerFrame = Pa_GetSampleSize(parameters->sampleFormat) * streamDescription->mChannelsPerFrame;    streamDescription->mBytesPerPacket = streamDescription->mBytesPerFrame * streamDescription->mFramesPerPacket;        if (parameters->sampleFormat & paFloat32) {        streamDescription->mFormatFlags |= kLinearPCMFormatFlagIsFloat;        streamDescription->mBitsPerChannel = 32;    }    else if (parameters->sampleFormat & paInt32) {        streamDescription->mFormatFlags |= kLinearPCMFormatFlagIsSignedInteger;        streamDescription->mBitsPerChannel = 32;    }    else if (parameters->sampleFormat & paInt24) {        streamDescription->mFormatFlags |= kLinearPCMFormatFlagIsSignedInteger;        streamDescription->mBitsPerChannel = 24;    }    else if (parameters->sampleFormat & paInt16) {        streamDescription->mFormatFlags |= kLinearPCMFormatFlagIsSignedInteger;        streamDescription->mBitsPerChannel = 16;    }    else if (parameters->sampleFormat & paInt8) {        streamDescription->mFormatFlags |= kLinearPCMFormatFlagIsSignedInteger;        streamDescription->mBitsPerChannel = 8;    }        else if (parameters->sampleFormat & paInt32) {        streamDescription->mBitsPerChannel = 8;    }        return streamDescription;}*/static PaStreamCallbackTimeInfo *InitializeTimeInfo(const AudioTimeStamp* now, const AudioTimeStamp* inputTime, const AudioTimeStamp* outputTime){    PaStreamCallbackTimeInfo *timeInfo = PaUtil_AllocateMemory(sizeof(PaStreamCallbackTimeInfo));        timeInfo->inputBufferAdcTime = inputTime->mSampleTime;    timeInfo->currentTime = now->mSampleTime;    timeInfo->outputBufferDacTime = outputTime->mSampleTime;        return timeInfo;}// =====  support functions  =====#pragma mark support functionsstatic void CleanUp(PaMacCoreHostApiRepresentation *macCoreHostApi){    if( macCoreHostApi->allocations )    {        PaUtil_FreeAllAllocations( macCoreHostApi->allocations );        PaUtil_DestroyAllocationGroup( macCoreHostApi->allocations );    }        PaUtil_FreeMemory( macCoreHostApi );    }static PaError GetChannelInfo(PaDeviceInfo *deviceInfo, AudioDeviceID macCoreDeviceId, int isInput){    UInt32 propSize;    PaError err = paNoError;    UInt32 i;    int numChannels = 0;    AudioBufferList *buflist;    err = conv_err(AudioDeviceGetPropertyInfo(macCoreDeviceId, 0, isInput, kAudioDevicePropertyStreamConfiguration, &propSize, NULL));    buflist = PaUtil_AllocateMemory(propSize);    err = conv_err(AudioDeviceGetProperty(macCoreDeviceId, 0, isInput, kAudioDevicePropertyStreamConfiguration, &propSize, buflist));    if (!err) {        for (i = 0; i < buflist->mNumberBuffers; ++i) {            numChannels += buflist->mBuffers[i].mNumberChannels;        }				if (isInput)			deviceInfo->maxInputChannels = numChannels;		else			deviceInfo->maxOutputChannels = numChannels;		        int frameLatency;        propSize = sizeof(UInt32);        err = conv_err(AudioDeviceGetProperty(macCoreDeviceId, 0, isInput, kAudioDevicePropertyLatency, &propSize, &frameLatency));        if (!err) {            double secondLatency = frameLatency / deviceInfo->defaultSampleRate;            if (isInput) {                deviceInfo->defaultLowInputLatency = secondLatency;                deviceInfo->defaultHighInputLatency = secondLatency;            }            else {                deviceInfo->defaultLowOutputLatency = secondLatency;                deviceInfo->defaultHighOutputLatency = secondLatency;            }        }    }    PaUtil_FreeMemory(buflist);        return err;}static PaError InitializeDeviceInfo(PaMacCoreDeviceInfo *macCoreDeviceInfo,  AudioDeviceID macCoreDeviceId, PaHostApiIndex hostApiIndex ){    PaDeviceInfo *deviceInfo = &macCoreDeviceInfo->inheritedDeviceInfo;    deviceInfo->structVersion = 2;    deviceInfo->hostApi = hostApiIndex;        PaError err = paNoError;    UInt32 propSize;    err = conv_err(AudioDeviceGetPropertyInfo(macCoreDeviceId, 0, 0, kAudioDevicePropertyDeviceName, &propSize, NULL));    // FIXME: this allocation should be part of the allocations group    char *name = PaUtil_AllocateMemory(propSize);    err = conv_err(AudioDeviceGetProperty(macCoreDeviceId, 0, 0, kAudioDevicePropertyDeviceName, &propSize, name));    if (!err) {        deviceInfo->name = name;    }        Float64 sampleRate;    propSize = sizeof(Float64);    err = conv_err(AudioDeviceGetProperty(macCoreDeviceId, 0, 0, kAudioDevicePropertyNominalSampleRate, &propSize, &sampleRate));    if (!err) {        deviceInfo->defaultSampleRate = sampleRate;    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩欧美中文一区| 国产日韩欧美一区二区三区综合| 亚洲国产欧美另类丝袜| 欧美日韩中文精品| 国产精品影音先锋| 亚洲综合久久久久| 久久众筹精品私拍模特| 91麻豆免费看片| 久久精品国产色蜜蜜麻豆| 中文字幕一区二区在线观看| 欧美日韩卡一卡二| 丰满少妇在线播放bd日韩电影| 亚洲影院理伦片| 久久久欧美精品sm网站| 欧美网站一区二区| 成人性生交大合| 韩国中文字幕2020精品| 亚洲与欧洲av电影| 欧美国产日韩在线观看| 91精品国产手机| 国产一区二区h| 亚洲成人7777| 亚洲理论在线观看| 久久精品亚洲精品国产欧美| 欧美三级中文字| 色综合一个色综合亚洲| 国产精品 欧美精品| 男女激情视频一区| 一区二区三区日韩精品| 中文字幕免费不卡在线| 精品日韩一区二区三区免费视频| 日本韩国欧美一区| 91在线精品一区二区| 国产一区二区三区在线看麻豆 | 精品成人在线观看| 在线观看亚洲精品| 99re亚洲国产精品| 国产超碰在线一区| 国产一区二区导航在线播放| 日本美女一区二区| 亚洲午夜在线电影| 日本一区二区电影| 欧美在线|欧美| 9i在线看片成人免费| 国产精品18久久久久| 久久99精品久久久久| 日韩精品91亚洲二区在线观看| 一区二区三区产品免费精品久久75| 国产精品私人自拍| 国产精品免费久久| 中文字幕成人在线观看| 国产亚洲综合在线| 久久久久综合网| 国产视频一区在线观看| 国产视频一区不卡| 中文字幕第一区| 国产精品国模大尺度视频| 2023国产精品自拍| 精品福利在线导航| 日韩精品自拍偷拍| 日韩精品一区二区三区四区视频| 日韩一级免费观看| 日韩片之四级片| 在线不卡欧美精品一区二区三区| 一本色道综合亚洲| 91亚洲永久精品| 91亚洲午夜精品久久久久久| 91免费看`日韩一区二区| 国产精品一区二区无线| 日本sm残虐另类| 久久精品国产亚洲a| 激情伊人五月天久久综合| 国产精品亚洲成人| 成人精品视频一区二区三区| 成人av在线资源| 91精品福利视频| 91麻豆精品国产91久久久更新时间| 欧美精品777| 26uuu精品一区二区| 亚洲欧洲av另类| 午夜影院久久久| 久久机这里只有精品| 粉嫩高潮美女一区二区三区 | 亚洲福利视频三区| 美国十次综合导航| 成人午夜视频在线观看| 一本色道**综合亚洲精品蜜桃冫 | 亚洲人成网站在线| 日本网站在线观看一区二区三区 | 欧美视频一区二区三区四区| 欧美精品第1页| 欧美国产精品中文字幕| 亚洲一区欧美一区| 麻豆一区二区三| 99精品在线观看视频| 欧美日本在线视频| 国产欧美日韩在线| 亚洲国产精品久久人人爱| 久久99国产精品久久99| 99精品视频中文字幕| 欧美日韩一区二区在线观看视频| 91精品国产综合久久久久久久 | 久久午夜电影网| 亚洲精品国产一区二区精华液| 日韩国产在线观看一区| 99re热视频精品| 欧美电影免费观看高清完整版 | 欧美午夜在线一二页| 久久精品一区二区三区av | 日本特黄久久久高潮| av在线播放成人| 精品国产91亚洲一区二区三区婷婷 | 国产+成+人+亚洲欧洲自线| 欧美日韩中文另类| 国产精品私人影院| 久久精品久久综合| 欧美日韩免费观看一区三区| 欧美激情综合在线| 久久国产精品99精品国产| 色狠狠av一区二区三区| 国产调教视频一区| 免费不卡在线观看| 欧美亚男人的天堂| 国产精品情趣视频| 国产尤物一区二区| 777色狠狠一区二区三区| 日韩理论在线观看| 国产成人丝袜美腿| 欧美zozo另类异族| 日韩1区2区3区| 欧美午夜影院一区| 一区二区成人在线| 91社区在线播放| 国产精品天天看| 成人自拍视频在线观看| 久久综合一区二区| 蜜臀av国产精品久久久久| 97精品国产露脸对白| 久久亚洲精品小早川怜子| 五月婷婷激情综合| 欧洲一区二区av| 中文字幕日韩一区| av午夜一区麻豆| 久久综合久久综合久久| 精品亚洲porn| 精品第一国产综合精品aⅴ| 热久久免费视频| 欧美精品久久久久久久多人混战| 亚洲久本草在线中文字幕| 99精品久久久久久| 亚洲视频一二三区| 91麻豆国产福利在线观看| 一区在线中文字幕| 9久草视频在线视频精品| 最好看的中文字幕久久| 97se亚洲国产综合自在线| 亚洲欧洲日本在线| 99精品视频在线免费观看| 亚洲三级在线看| 色屁屁一区二区| 一区二区三区在线播放| 91官网在线观看| 午夜精品一区二区三区电影天堂 | 青草国产精品久久久久久| 91片在线免费观看| 日韩天堂在线观看| 精品美女被调教视频大全网站| 一区二区三区四区乱视频| 亚洲欧洲日产国码二区| 制服丝袜av成人在线看| 欧美精品色一区二区三区| 欧美视频中文一区二区三区在线观看| 欧美综合亚洲图片综合区| 青青草国产成人av片免费| 中文字幕一区二区三区在线观看| 欧美体内she精高潮| 成人黄色小视频在线观看| 国产精品羞羞答答xxdd| 成人精品一区二区三区四区| 欧美日韩综合一区| 国产一区二区影院| 青娱乐精品视频| 奇米888四色在线精品| 日韩1区2区日韩1区2区| 国产高清精品网站| 欧美一区二区久久久| 中文字幕制服丝袜一区二区三区| 久久久久青草大香线综合精品| 日韩电影在线观看一区| 激情综合色播激情啊| 国产日韩欧美麻豆| 国产精品一二三四区| 中文字幕av一区二区三区高| 丁香婷婷综合网| 国产午夜久久久久| 色综合天天综合在线视频| 亚洲一区二区三区四区不卡| 欧美电视剧在线观看完整版| 国产成人免费av在线| 精品国产伦一区二区三区免费|