Lines Matching defs:pDSoundStrmIn
597 static LPCGUID dsoundCaptureSelectDevice(PDRVHOSTDSOUND pThis, PDSOUNDSTREAMIN pDSoundStrmIn)
605 switch (pDSoundStrmIn->enmRecSource)
625 drvAudioRecSourceToString(pDSoundStrmIn->enmRecSource), pDev->pszName));
634 static void dsoundCaptureInterfaceRelease(PDSOUNDSTREAMIN pDSoundStrmIn)
636 if (pDSoundStrmIn->pDSC)
638 IDirectSoundCapture_Release(pDSoundStrmIn->pDSC);
639 pDSoundStrmIn->pDSC = NULL;
643 static int dsoundCaptureInterfaceCreate(PDRVHOSTDSOUND pThis, PDSOUNDSTREAMIN pDSoundStrmIn)
645 if (pDSoundStrmIn->pDSC != NULL)
652 IID_IDirectSoundCapture, (void **)&pDSoundStrmIn->pDSC);
659 LPCGUID pGUID = dsoundCaptureSelectDevice(pThis, pDSoundStrmIn);
660 hr = IDirectSoundCapture_Initialize(pDSoundStrmIn->pDSC, pGUID);
671 dsoundCaptureInterfaceRelease(pDSoundStrmIn);
678 static void dsoundCaptureClose(PDSOUNDSTREAMIN pDSoundStrmIn)
680 DSLOG(("DSound: capture close %p buffer %p\n", pDSoundStrmIn, pDSoundStrmIn->pDSCB));
682 if (pDSoundStrmIn->pDSCB)
684 HRESULT hr = IDirectSoundCaptureBuffer_Stop(pDSoundStrmIn->pDSCB);
690 IDirectSoundCaptureBuffer_Release(pDSoundStrmIn->pDSCB);
691 pDSoundStrmIn->pDSCB = NULL;
694 dsoundCaptureInterfaceRelease(pDSoundStrmIn);
697 static int dsoundCaptureOpen(PDRVHOSTDSOUND pThis, PDSOUNDSTREAMIN pDSoundStrmIn)
700 pDSoundStrmIn,
702 pDSoundStrmIn->hw.Props.uHz,
703 pDSoundStrmIn->hw.Props.cChannels,
704 pDSoundStrmIn->hw.Props.cBits,
705 pDSoundStrmIn->hw.Props.fSigned));
707 if (pDSoundStrmIn->pDSCB != NULL)
711 dsoundCaptureClose(pDSoundStrmIn);
715 int rc = dsoundWaveFmtFromCfg(&pDSoundStrmIn->streamCfg, &wfx);
719 rc = dsoundCaptureInterfaceCreate(pThis, pDSoundStrmIn);
732 hr = IDirectSoundCapture_CreateCaptureBuffer(pDSoundStrmIn->pDSC,
733 &bd, &pDSoundStrmIn->pDSCB, NULL);
738 pDSoundStrmIn->pDSCB = NULL;
745 hr = IDirectSoundCaptureBuffer_GetCurrentPosition(pDSoundStrmIn->pDSCB, NULL, &cbReadPos);
753 hr = IDirectSoundCaptureBuffer_GetFormat(pDSoundStrmIn->pDSCB, &wfx, sizeof(wfx), NULL);
763 hr = IDirectSoundCaptureBuffer_GetCaps(pDSoundStrmIn->pDSCB, &bc);
787 if (bc.dwBufferBytes & pDSoundStrmIn->hw.Props.uAlign)
790 bc.dwBufferBytes, pDSoundStrmIn->hw.Props.uAlign + 1));
800 pDSoundStrmIn->csCaptureReadPos = cbReadPos >> pDSoundStrmIn->hw.Props.cShift;
801 pDSoundStrmIn->csCaptureBufferSize = bc.dwBufferBytes >> pDSoundStrmIn->hw.Props.cShift;
803 pDSoundStrmIn->csCaptureReadPos, pDSoundStrmIn->csCaptureBufferSize));
805 pDSoundStrmIn->hrLastCaptureIn = S_OK;
811 dsoundCaptureClose(pDSoundStrmIn);
815 static void dsoundCaptureStop(PDSOUNDSTREAMIN pDSoundStrmIn)
817 if (pDSoundStrmIn->pDSCB)
821 HRESULT hr = IDirectSoundCaptureBuffer_Stop(pDSoundStrmIn->pDSCB);
829 static int dsoundCaptureStart(PDRVHOSTDSOUND pThis, PDSOUNDSTREAMIN pDSoundStrmIn)
833 if (pDSoundStrmIn->pDSCB != NULL)
836 hr = IDirectSoundCaptureBuffer_GetStatus(pDSoundStrmIn->pDSCB, &dwStatus);
851 hr = IDirectSoundCaptureBuffer_Start(pDSoundStrmIn->pDSCB, DSCBSTART_LOOPING);
1225 PDSOUNDSTREAMIN pDSoundStrmIn = (PDSOUNDSTREAMIN)pHstStrmIn;
1230 pDSoundStrmIn->streamCfg = *pCfg;
1231 pDSoundStrmIn->streamCfg.enmEndianness = PDMAUDIOHOSTENDIANNESS;
1234 int rc = drvAudioStreamCfgToProps(&pDSoundStrmIn->streamCfg, &pHstStrmIn->Props);
1238 pDSoundStrmIn->csCaptureReadPos = 0;
1239 pDSoundStrmIn->csCaptureBufferSize = 0;
1240 pDSoundStrmIn->pDSC = NULL;
1241 pDSoundStrmIn->pDSCB = NULL;
1242 pDSoundStrmIn->enmRecSource = enmRecSource;
1243 pDSoundStrmIn->hrLastCaptureIn = S_OK;
1249 dsoundCaptureOpen(pThis, pDSoundStrmIn);
1253 RT_ZERO(pDSoundStrmIn->streamCfg);
1269 PDSOUNDSTREAMIN pDSoundStrmIn = (PDSOUNDSTREAMIN)pHstStrmIn;
1278 rc = dsoundCaptureStart(pThis, pDSoundStrmIn);
1281 dsoundCaptureClose(pDSoundStrmIn);
1282 dsoundCaptureOpen(pThis, pDSoundStrmIn);
1284 rc = dsoundCaptureStart(pThis, pDSoundStrmIn);
1290 dsoundCaptureStop(pDSoundStrmIn);
1307 PDSOUNDSTREAMIN pDSoundStrmIn = (PDSOUNDSTREAMIN)pHstStrmIn;
1308 LPDIRECTSOUNDCAPTUREBUFFER pDSCB = pDSoundStrmIn->pDSCB;
1324 if (hr != pDSoundStrmIn->hrLastCaptureIn)
1327 pDSoundStrmIn->hrLastCaptureIn = hr;
1334 pDSoundStrmIn->hrLastCaptureIn = hr;
1345 DWORD csCaptured = dsoundRingDistance(csReadPos, pDSoundStrmIn->csCaptureReadPos, pDSoundStrmIn->csCaptureBufferSize);
1367 csMixFree, csReadPos, pDSoundStrmIn->csCaptureReadPos, csCaptured));
1376 pDSoundStrmIn->csCaptureReadPos << pHstStrmIn->Props.cShift,
1422 pDSoundStrmIn->csCaptureReadPos = (pDSoundStrmIn->csCaptureReadPos + csProcessed) % pDSoundStrmIn->csCaptureBufferSize;
1436 PDSOUNDSTREAMIN pDSoundStrmIn = (PDSOUNDSTREAMIN)pHstStrmIn;
1438 dsoundCaptureClose(pDSoundStrmIn);
1440 pDSoundStrmIn->csCaptureReadPos = 0;
1441 pDSoundStrmIn->csCaptureBufferSize = 0;
1442 RT_ZERO(pDSoundStrmIn->streamCfg);