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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? pa_unix.c

?? 一個(gè)任天堂掌上游戲機(jī)NDS的源代碼
?? C
?? 第 1 頁(yè) / 共 3 頁(yè)
字號(hào):
    if( past->past_NumInputChannels > 0)
    {
        pahsc->pahsc_NativeInputBuffer = (short *) malloc(pahsc->pahsc_BytesPerInputBuffer);
        if( pahsc->pahsc_NativeInputBuffer == NULL )
        {
            result = paInsufficientMemory;
            goto error;
        }
    }
    pahsc->pahsc_BytesPerOutputBuffer = past->past_FramesPerUserBuffer *
                                        past->past_NumOutputChannels * sizeof(short);
    if( past->past_NumOutputChannels > 0)
    {
        pahsc->pahsc_NativeOutputBuffer = (short *) malloc(pahsc->pahsc_BytesPerOutputBuffer);
        if( pahsc->pahsc_NativeOutputBuffer == NULL )
        {
            result = paInsufficientMemory;
            goto error;
        }
    }

    /* DBUG(("PaHost_OpenStream: pahsc_MinFramesPerHostBuffer = %d\n", pahsc->pahsc_MinFramesPerHostBuffer )); */
    minNumBuffers = Pa_GetMinNumBuffers( past->past_FramesPerUserBuffer, past->past_SampleRate );
    past->past_NumUserBuffers = ( minNumBuffers > past->past_NumUserBuffers ) ? minNumBuffers : past->past_NumUserBuffers;

    pahsc->pahsc_InverseMicrosPerBuffer = past->past_SampleRate / (1000000.0 * past->past_FramesPerUserBuffer);
    DBUG(("past_SampleRate = %g\n", past->past_SampleRate ));
    DBUG(("past_FramesPerUserBuffer = %d\n", past->past_FramesPerUserBuffer ));
    DBUG(("pahsc_InverseMicrosPerBuffer = %g\n", pahsc->pahsc_InverseMicrosPerBuffer ));

    /* ------------------------- OPEN DEVICE -----------------------*/

    /* just output */
    if (past->past_OutputDeviceID == past->past_InputDeviceID)
    {

        if ((past->past_NumOutputChannels > 0) && (past->past_NumInputChannels > 0) )
        {
            pad = Pa_GetInternalDevice( past->past_OutputDeviceID );
            DBUG(("PaHost_OpenStream: attempt to open %s for O_RDWR\n", pad->pad_DeviceName ));

            /* dmazzoni: test it first in nonblocking mode to
               make sure the device is not busy */
            pahsc->pahsc_InputHandle = open(pad->pad_DeviceName,O_RDWR|O_NONBLOCK);
            if(pahsc->pahsc_InputHandle==-1)
            {
                ERR_RPT(("PaHost_OpenStream: could not open %s for O_RDWR\n", pad->pad_DeviceName ));
                result = paHostError;
                goto error;
            }
            close(pahsc->pahsc_InputHandle);

            pahsc->pahsc_OutputHandle = pahsc->pahsc_InputHandle =
                                            open(pad->pad_DeviceName,O_RDWR);
            if(pahsc->pahsc_InputHandle==-1)
            {
                ERR_RPT(("PaHost_OpenStream: could not open %s for O_RDWR\n", pad->pad_DeviceName ));
                result = paHostError;
                goto error;
            }
            Pa_SetLatency( pahsc->pahsc_OutputHandle,
                           past->past_NumUserBuffers, past->past_FramesPerUserBuffer,
                           past->past_NumOutputChannels );
            result = Pa_SetupDeviceFormat( pahsc->pahsc_OutputHandle,
                                           past->past_NumOutputChannels, (int)past->past_SampleRate );
        }
    }
    else
    {
        if (past->past_NumOutputChannels > 0)
        {
            pad = Pa_GetInternalDevice( past->past_OutputDeviceID );
            DBUG(("PaHost_OpenStream: attempt to open %s for O_WRONLY\n", pad->pad_DeviceName ));
            /* dmazzoni: test it first in nonblocking mode to
               make sure the device is not busy */
            pahsc->pahsc_OutputHandle = open(pad->pad_DeviceName,O_WRONLY|O_NONBLOCK);
            if(pahsc->pahsc_OutputHandle==-1)
            {
                ERR_RPT(("PaHost_OpenStream: could not open %s for O_WRONLY\n", pad->pad_DeviceName ));
                result = paHostError;
                goto error;
            }
            close(pahsc->pahsc_OutputHandle);

            pahsc->pahsc_OutputHandle = open(pad->pad_DeviceName,O_WRONLY);
            if(pahsc->pahsc_OutputHandle==-1)
            {
                ERR_RPT(("PaHost_OpenStream: could not open %s for O_WRONLY\n", pad->pad_DeviceName ));
                result = paHostError;
                goto error;
            }
            Pa_SetLatency( pahsc->pahsc_OutputHandle,
                           past->past_NumUserBuffers, past->past_FramesPerUserBuffer,
                           past->past_NumOutputChannels );
            result = Pa_SetupOutputDeviceFormat( pahsc->pahsc_OutputHandle,
                                           past->past_NumOutputChannels, (int)past->past_SampleRate );
        }

        if (past->past_NumInputChannels > 0)
        {
            pad = Pa_GetInternalDevice( past->past_InputDeviceID );
            DBUG(("PaHost_OpenStream: attempt to open %s for O_RDONLY\n", pad->pad_DeviceName ));
            /* dmazzoni: test it first in nonblocking mode to
               make sure the device is not busy */
            pahsc->pahsc_InputHandle = open(pad->pad_DeviceName,O_RDONLY|O_NONBLOCK);
            if(pahsc->pahsc_InputHandle==-1)
            {
                ERR_RPT(("PaHost_OpenStream: could not open %s for O_RDONLY\n", pad->pad_DeviceName ));
                result = paHostError;
                goto error;
            }
            close(pahsc->pahsc_InputHandle);

            pahsc->pahsc_InputHandle = open(pad->pad_DeviceName,O_RDONLY);
            if(pahsc->pahsc_InputHandle==-1)
            {
                ERR_RPT(("PaHost_OpenStream: could not open %s for O_RDONLY\n", pad->pad_DeviceName ));
                result = paHostError;
                goto error;
            }
            Pa_SetLatency( pahsc->pahsc_InputHandle, /* DH20010115 - was OutputHandle! */
                           past->past_NumUserBuffers, past->past_FramesPerUserBuffer,
                           past->past_NumInputChannels );
            result = Pa_SetupInputDeviceFormat( pahsc->pahsc_InputHandle,
                                           past->past_NumInputChannels, (int)past->past_SampleRate );
        }
    }


    DBUG(("PaHost_OpenStream: SUCCESS - result = %d\n", result ));
    return result;

error:
    ERR_RPT(("PaHost_OpenStream: ERROR - result = %d\n", result ));
    PaHost_CloseStream( past );
    return result;
}

/*************************************************************************/
PaError PaHost_StartOutput( internalPortAudioStream *past )
{
    past = past; /* unused */
    return paNoError;
}

/*************************************************************************/
PaError PaHost_StartInput( internalPortAudioStream *past )
{
    past = past; /* unused */
    return paNoError;
}

/*************************************************************************/
PaError PaHost_StartEngine( internalPortAudioStream *past )
{
    PaHostSoundControl *pahsc;
    PaError             result = paNoError;
    int                 hres;

    pahsc = (PaHostSoundControl *) past->past_DeviceData;

    past->past_StopSoon = 0;
    past->past_StopNow = 0;
    past->past_IsActive = 1;

    /* Use pthread_create() instead of __clone() because:
     *   - pthread_create also works for other UNIX systems like Solaris,
     *   - the Java HotSpot VM crashes in pthread_setcanceltype() when using __clone()
     */
    hres = pthread_create(&(pahsc->pahsc_AudioThread),
                          NULL /*pthread_attr_t * attr*/,
                          (pthread_function_t)Pa_AudioThreadProc, past);
    if( hres != 0 )
    {
        result = paHostError;
        sPaHostError = hres;
        pahsc->pahsc_IsAudioThreadValid = 0;
        goto error;
    }
    pahsc->pahsc_IsAudioThreadValid = 1;

error:
    return result;
}

/*************************************************************************/
PaError PaHost_StopEngine( internalPortAudioStream *past, int abort )
{
    int                 hres;
    PaError             result = paNoError;
    PaHostSoundControl *pahsc = (PaHostSoundControl *) past->past_DeviceData;

    if( pahsc == NULL ) return paNoError;

    /* Tell background thread to stop generating more data and to let current data play out. */
    past->past_StopSoon = 1;
    /* If aborting, tell background thread to stop NOW! */
    if( abort ) past->past_StopNow = 1;

    /* Join thread to recover memory resources. */
    if( pahsc->pahsc_IsAudioThreadValid )
    {
        /* This check is needed for GNUSTEP - SB20010904 */
        if ( !pthread_equal( pahsc->pahsc_AudioThread, pthread_self() ) )
        {
            hres = pthread_join( pahsc->pahsc_AudioThread, NULL );
        }
        else
        {
            DBUG(("Play thread was stopped from itself - can't do pthread_join()\n"));
            hres = 0;
        }

        if( hres != 0 )
        {
            result = paHostError;
            sPaHostError = hres;
        }
        pahsc->pahsc_IsAudioThreadValid = 0;
    }

    past->past_IsActive = 0;

    return result;
}

/*************************************************************************/
PaError PaHost_StopInput( internalPortAudioStream *past, int abort )
{
    past = past; /* unused */
    abort = abort; /* unused */
    return paNoError;
}

/*************************************************************************/
PaError PaHost_StopOutput( internalPortAudioStream *past, int abort )
{
    past = past; /* unused */
    abort = abort; /* unused */
    return paNoError;
}

/*******************************************************************/
PaError PaHost_CloseStream( internalPortAudioStream   *past )
{
    PaHostSoundControl *pahsc;

    if( past == NULL ) return paBadStreamPtr;
    pahsc = (PaHostSoundControl *) past->past_DeviceData;
    if( pahsc == NULL ) return paNoError;

    if( pahsc->pahsc_OutputHandle != BAD_DEVICE_ID )
    {
        int err = 0;
        DBUG(("PaHost_CloseStream: attempt to close output device handle = %d\n",
              pahsc->pahsc_OutputHandle ));

        Pa_FlushStream(pahsc->pahsc_OutputHandle);

        err = close(pahsc->pahsc_OutputHandle);
        if( err < 0 )
        {
            ERR_RPT(("PaHost_CloseStream: warning, closing output device failed.\n"));
        }
    }

    if( (pahsc->pahsc_InputHandle != BAD_DEVICE_ID) &&
            (pahsc->pahsc_InputHandle != pahsc->pahsc_OutputHandle) )
    {
        int err = 0;
        DBUG(("PaHost_CloseStream: attempt to close input device handle = %d\n",
              pahsc->pahsc_InputHandle ));

        Pa_FlushStream(pahsc->pahsc_InputHandle);

        err = close(pahsc->pahsc_InputHandle);
        if( err < 0 )
        {
            ERR_RPT(("PaHost_CloseStream: warning, closing input device failed.\n"));
        }
    }
    pahsc->pahsc_OutputHandle = BAD_DEVICE_ID;
    pahsc->pahsc_InputHandle = BAD_DEVICE_ID;

    if( pahsc->pahsc_NativeInputBuffer )
    {
        free( pahsc->pahsc_NativeInputBuffer );
        pahsc->pahsc_NativeInputBuffer = NULL;
    }
    if( pahsc->pahsc_NativeOutputBuffer )
    {
        free( pahsc->pahsc_NativeOutputBuffer );
        pahsc->pahsc_NativeOutputBuffer = NULL;
    }

    free( pahsc );
    past->past_DeviceData = NULL;
    return paNoError;
}

/*************************************************************************/
PaError PaHost_Term( void )
{
    /* Free all of the linked devices. */
    internalPortAudioDevice *pad, *nextPad;
    pad = sDeviceList;
    while( pad != NULL )
    {
        nextPad = pad->pad_Next;
        DBUG(("PaHost_Term: freeing %s\n", pad->pad_DeviceName ));
        PaHost_FreeFastMemory( pad, sizeof(internalPortAudioDevice) );
        pad = nextPad;
    }
    sDeviceList = NULL;
    return 0;
}

/*************************************************************************
 * Sleep for the requested number of milliseconds.
 */
void Pa_Sleep( long msec )
{
#if 0
    struct timeval timeout;
    timeout.tv_sec = msec / 1000;
    timeout.tv_usec = (msec % 1000) * 1000;
    select( 0, NULL, NULL, NULL, &timeout );
#else
    long usecs = msec * 1000;
    usleep( usecs );
#endif
}

/*************************************************************************
 * Allocate memory that can be accessed in real-time.
 * This may need to be held in physical memory so that it is not
 * paged to virtual memory.
 * This call MUST be balanced with a call to PaHost_FreeFastMemory().
 */
void *PaHost_AllocateFastMemory( long numBytes )
{
    void *addr = malloc( numBytes ); /* FIXME - do we need physical, wired, non-virtual memory? */
    if( addr != NULL ) memset( addr, 0, numBytes );
    return addr;
}

/*************************************************************************
 * Free memory that could be accessed in real-time.
 * This call MUST be balanced with a call to PaHost_AllocateFastMemory().
 */
void PaHost_FreeFastMemory( void *addr, long numBytes )
{
    numBytes = numBytes; /* unused */
    if( addr != NULL ) free( addr );
}


/***********************************************************************/
PaError PaHost_StreamActive( internalPortAudioStream   *past )
{
    PaHostSoundControl *pahsc;
    if( past == NULL ) return paBadStreamPtr;
    pahsc = (PaHostSoundControl *) past->past_DeviceData;
    if( pahsc == NULL ) return paInternalError;
    return (PaError) (past->past_IsActive != 0);
}

/***********************************************************************/
long Pa_GetHostError( void )
{
    return (long) sPaHostError;
}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩免费电影| 亚洲电影第三页| 欧美精品一区二区蜜臀亚洲| 91精品国产综合久久精品| 欧美日韩一区精品| 在线观看亚洲一区| 欧美日韩高清影院| 欧美一区二区视频网站| 3d成人h动漫网站入口| 欧美日精品一区视频| 欧美视频一区二区三区四区| 精品视频一区二区不卡| 欧美日韩高清一区| 日韩一区二区三区四区五区六区| 在线综合视频播放| 欧美大度的电影原声| 久久综合99re88久久爱| 国产日产亚洲精品系列| 国产精品国产精品国产专区不蜜| 免费成人av资源网| 韩国成人在线视频| 成人国产精品免费网站| 91麻豆蜜桃一区二区三区| 在线精品视频一区二区| 欧美欧美欧美欧美| 久久一日本道色综合| 国产精品水嫩水嫩| 一区二区高清免费观看影视大全| 亚洲二区视频在线| 久久国产精品区| 国产91色综合久久免费分享| 91首页免费视频| 欧美电影在线免费观看| 26uuu亚洲综合色欧美| 国产精品五月天| 亚洲国产wwwccc36天堂| 精品一区二区三区影院在线午夜| 国产精品一区二区三区四区| 色呦呦国产精品| 日韩亚洲欧美在线| 中文无字幕一区二区三区| 一区二区三区欧美日韩| 免费看欧美美女黄的网站| 风间由美一区二区三区在线观看 | 亚洲色欲色欲www在线观看| 亚洲一区二区三区三| 久久国产剧场电影| 一本色道亚洲精品aⅴ| 精品国偷自产国产一区| 亚洲男人电影天堂| 久久aⅴ国产欧美74aaa| 99久久99久久精品国产片果冻| 91麻豆精品国产| 国产精品每日更新| 美日韩一区二区| 91麻豆视频网站| 久久久蜜桃精品| 偷偷要91色婷婷| 91亚洲男人天堂| 精品久久一二三区| 亚洲午夜一二三区视频| 国产精一区二区三区| 欧美日韩高清影院| 亚洲欧美日韩在线不卡| 国内偷窥港台综合视频在线播放| 欧美影院一区二区| 国产精品欧美综合在线| 精品综合久久久久久8888| 欧美在线视频不卡| 日韩一区日韩二区| 狠狠色丁香婷综合久久| 欧美日韩免费观看一区三区| 一区在线中文字幕| 国产裸体歌舞团一区二区| 91精品国产91综合久久蜜臀| 亚洲激情综合网| 高清shemale亚洲人妖| 欧美一个色资源| 午夜在线成人av| 在线中文字幕一区二区| 日韩理论电影院| 成人午夜在线视频| 国产色产综合色产在线视频| 美女在线观看视频一区二区| 欧美人xxxx| 夜夜精品浪潮av一区二区三区| 成人动漫av在线| 日本一区二区免费在线观看视频 | 韩国精品一区二区| 日韩欧美激情一区| 日韩二区三区四区| 欧美日韩国产综合视频在线观看| 亚洲婷婷国产精品电影人久久| 大白屁股一区二区视频| 久久久美女艺术照精彩视频福利播放| 日本色综合中文字幕| 欧美精品一级二级| 日韩经典中文字幕一区| 欧美精品三级日韩久久| 天天综合天天综合色| 欧美日韩精品一区二区三区蜜桃| 亚洲国产乱码最新视频 | 欧美日本一道本在线视频| 亚洲综合精品久久| 91福利视频网站| 午夜久久久久久久久久一区二区| 欧洲亚洲精品在线| 亚洲电影一级黄| 欧美精品丝袜久久久中文字幕| 日韩av电影免费观看高清完整版 | 国产日韩精品久久久| 丁香五精品蜜臀久久久久99网站 | 国产欧美日韩亚州综合| 成人精品视频一区二区三区尤物| 中文字幕国产精品一区二区| 成人亚洲一区二区一| 国产精品久久久久一区| 91视频在线观看| 亚洲一区二区欧美| 欧美一区二区观看视频| 精一区二区三区| 国产蜜臀97一区二区三区 | 久久在线免费观看| 国产99精品视频| 中文字幕在线不卡| 色屁屁一区二区| 偷拍一区二区三区| 欧美tickling挠脚心丨vk| 成人深夜视频在线观看| 国产偷国产偷亚洲高清人白洁| 国产成人欧美日韩在线电影| 亚洲手机成人高清视频| 欧美二区三区91| 国产不卡在线视频| 亚洲精品国产一区二区精华液| 欧美久久一二三四区| 韩国女主播一区二区三区| 日韩毛片在线免费观看| 欧美一区二区大片| 成人精品免费看| 亚洲国产精品久久不卡毛片| 精品国产一二三| 91在线视频免费观看| 三级亚洲高清视频| 久久久av毛片精品| 欧美天堂一区二区三区| 老司机午夜精品| 中文字幕亚洲在| 欧美一区二区美女| 91浏览器打开| 久久99国产精品久久| 亚洲欧洲日产国码二区| 日韩欧美精品三级| 色综合激情久久| 理论电影国产精品| 一区二区理论电影在线观看| 久久久精品tv| 制服丝袜一区二区三区| 成人h精品动漫一区二区三区| 五月天激情综合网| 最新成人av在线| 久久网站最新地址| 欧美日韩一区二区欧美激情| 国产成人精品亚洲777人妖| 午夜精品一区在线观看| 国产精品国产三级国产三级人妇 | 亚洲欧美日韩一区二区 | 自拍偷拍国产亚洲| 26uuu久久综合| 欧美日韩午夜影院| av成人免费在线观看| 国产一区二区三区高清播放| 亚洲成av人**亚洲成av**| 国产精品大尺度| 久久久久久毛片| 日韩一区二区三区免费看| 色狠狠综合天天综合综合| 国产69精品久久久久毛片| 精品在线播放午夜| 婷婷综合另类小说色区| 一区二区三区在线不卡| 国产欧美精品区一区二区三区| 精品日韩一区二区| 777奇米成人网| 在线观看免费一区| 91视视频在线观看入口直接观看www | 亚洲精品高清在线观看| 中国av一区二区三区| 精品91自产拍在线观看一区| 欧美精品vⅰdeose4hd| 91国偷自产一区二区开放时间| 国产suv精品一区二区883| 国产一区二区福利视频| 久久成人av少妇免费| 日本免费在线视频不卡一不卡二| 一区二区三区四区精品在线视频 | 亚洲自拍都市欧美小说| 亚洲欧美自拍偷拍色图| 中文字幕欧美激情一区| 久久精品一区蜜桃臀影院|