亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
国产一区二区不卡| 精品国偷自产国产一区| 欧美大胆人体bbbb| 亚洲精品日产精品乱码不卡| 久久福利资源站| 欧美午夜电影网| 中日韩av电影| 精品亚洲免费视频| 在线91免费看| 一区二区三区欧美激情| 高清久久久久久| 亚洲精品一区二区三区福利| 天天影视网天天综合色在线播放| 成人午夜免费视频| 久久天堂av综合合色蜜桃网| 日日欢夜夜爽一区| 欧美性一区二区| 中文字幕亚洲电影| 国产盗摄女厕一区二区三区| 欧美成人女星排名| 日本va欧美va精品| 欧美日韩高清一区二区| 亚洲一区影音先锋| 91精品国产综合久久蜜臀| 亚洲精品视频自拍| av在线不卡电影| 国产亚洲一二三区| 国产精品18久久久久久久久| 欧美大片一区二区| 另类中文字幕网| 日韩情涩欧美日韩视频| 久久精品噜噜噜成人av农村| 538prom精品视频线放| 午夜精彩视频在线观看不卡| 欧美午夜精品一区二区三区| 亚洲一级二级在线| 欧美视频一区在线观看| 日精品一区二区| 日韩午夜精品电影| 精品中文字幕一区二区| 国产亚洲精品aa| 高清不卡一区二区在线| 国产精品午夜在线观看| 99re热这里只有精品视频| 懂色一区二区三区免费观看| 欧美精品一二三四| 免费欧美在线视频| 日韩精品一区二区在线| 国产一区日韩二区欧美三区| 国产三级精品三级| 色综合天天天天做夜夜夜夜做| 亚洲欧美福利一区二区| 欧美唯美清纯偷拍| 美女视频黄 久久| 国产欧美日韩不卡| 在线观看网站黄不卡| 日产国产欧美视频一区精品 | 国产成人精品免费网站| 国产精品入口麻豆九色| 欧美性色黄大片手机版| 韩国三级中文字幕hd久久精品| 久久毛片高清国产| 一本大道综合伊人精品热热| 日韩精品1区2区3区| 亚洲国产精品av| 欧美性感一区二区三区| 欧美四级电影在线观看| 久久综合狠狠综合久久综合88| 国产精品综合av一区二区国产馆| 亚洲国产精品v| 欧美日本一区二区在线观看| 美女视频一区二区三区| 中文字幕一区免费在线观看| 欧美精品免费视频| 国产91清纯白嫩初高中在线观看| 亚洲免费资源在线播放| 欧美成人a在线| 97精品视频在线观看自产线路二| 日韩高清电影一区| 国产精品美女一区二区三区| 在线播放亚洲一区| 99久久综合狠狠综合久久| 奇米一区二区三区| 最新不卡av在线| 精品国产免费人成电影在线观看四季| 97精品国产97久久久久久久久久久久| 麻豆精品在线播放| 亚洲一区中文在线| 国产精品久久久久久户外露出| 制服丝袜亚洲色图| 91麻豆免费在线观看| 国产大陆a不卡| 久久91精品国产91久久小草| 香蕉乱码成人久久天堂爱免费| 国产精品久久久99| 久久久美女毛片| 欧美xxxxxxxxx| 7777精品伊人久久久大香线蕉超级流畅 | 亚洲高清不卡在线| 亚洲人成网站在线| 亚洲欧美影音先锋| 国产嫩草影院久久久久| 欧美本精品男人aⅴ天堂| 在线电影一区二区三区| 国产精品一区二区视频| 精品第一国产综合精品aⅴ| 一区二区三区四区蜜桃| 国产三级欧美三级| 日韩三级视频在线看| 欧美日本在线播放| 欧美日韩一级二级三级| 色综合天天综合给合国产| 99久久婷婷国产综合精品| 丁香桃色午夜亚洲一区二区三区| 精品亚洲成a人在线观看| 日韩不卡免费视频| 奇米色一区二区三区四区| 男人的j进女人的j一区| 免费久久99精品国产| 日韩成人一级片| 蜜臀久久99精品久久久久宅男 | 一区二区三区中文在线观看| 中文字幕在线一区免费| 日韩毛片视频在线看| 亚洲同性gay激情无套| 综合久久久久综合| 一区二区三区中文在线观看| 亚洲国产精品久久人人爱| 亚洲福利视频导航| 日韩黄色一级片| 国内偷窥港台综合视频在线播放| 国模少妇一区二区三区| 高清成人在线观看| 日本韩国欧美在线| 欧美精品一级二级三级| 久久人人爽人人爽| 综合色天天鬼久久鬼色| 天天综合色天天| 国产高清不卡一区二区| 91视视频在线观看入口直接观看www | 亚洲v中文字幕| 免费日韩伦理电影| 国产成人免费视频| 色婷婷av一区二区三区软件| 欧美一区二区三区电影| 国产网站一区二区| 一区二区三区国产精华| 美女一区二区视频| 99在线精品观看| 制服丝袜亚洲精品中文字幕| 欧美国产亚洲另类动漫| 香蕉成人啪国产精品视频综合网| 91免费在线看| 欧美一级片免费看| 久久综合久久久久88| 欧美国产乱子伦| 依依成人综合视频| 国产自产高清不卡| 在线中文字幕一区二区| 精品国免费一区二区三区| 亚洲欧洲精品一区二区精品久久久 | 亚洲乱码国产乱码精品精小说| 秋霞电影网一区二区| 成人18视频日本| 精品久久久久久综合日本欧美| 亚洲美女少妇撒尿| 免费美女久久99| 欧美视频日韩视频在线观看| 国产人妖乱国产精品人妖| 性久久久久久久久久久久| av日韩在线网站| 日韩精品中文字幕一区| 亚洲线精品一区二区三区| 成人动漫在线一区| 美洲天堂一区二卡三卡四卡视频 | 欧美三级电影一区| 中文字幕第一区二区| 免费人成精品欧美精品| 欧美系列一区二区| 亚洲美女偷拍久久| 成人激情图片网| 久久一留热品黄| 久久精品理论片| 91麻豆精品国产| 亚洲成va人在线观看| 99九九99九九九视频精品| 国产日韩欧美电影| 激情五月婷婷综合| 欧美一级理论片| 日韩成人一级大片| 欧美精品1区2区| 亚洲国产欧美在线| 欧美中文字幕一区| 一级女性全黄久久生活片免费| 国产.欧美.日韩| 久久美女艺术照精彩视频福利播放| 理论电影国产精品| 精品久久久久久久久久久久包黑料 | 欧美一区二区三区日韩视频| 中文字幕在线播放不卡一区|