in src/cubeb_wasapi.cpp [673:692]
HRESULT GetDataFlow(LPCWSTR device_id, EDataFlow * flow)
{
com_ptr<IMMDevice> device;
com_ptr<IMMEndpoint> endpoint;
HRESULT hr = cubeb_context->device_collection_enumerator->GetDevice(
device_id, device.receive());
if (FAILED(hr)) {
LOG("collection: Could not get device: %lx", hr);
return hr;
}
hr = device->QueryInterface(IID_PPV_ARGS(endpoint.receive()));
if (FAILED(hr)) {
LOG("collection: Could not get endpoint: %lx", hr);
return hr;
}
return endpoint->GetDataFlow(flow);
}