IPin* pInputPin = nullptr; HRESULT hr = pFilter->FindPin(L"Input", &pInputPin); if (FAILED(hr) || pInputPin == nullptr) { // Handle error } IPin* pOutputPin = nullptr; hr = pFilter->FindPin(L"Output", &pOutputPin); if (FAILED(hr) || pOutputPin == nullptr) { // Handle error } hr = pGraphBuilder->Connect(pOutputPin, pInputPin); if (FAILED(hr)) { // Handle error }
HRESULT hr = pInputPin->QueryAccept(&pMediaType); if (FAILED(hr)) { // Handle error } if (pMediaType == nullptr) { // Pin doesn't accept any media types } else { // Pin accepts one or more media types }In this example, we are querying the input pin to see if it accepts any media types. If it does, we can use the `pMediaType` pointer to access and configure the specific media types it accepts. Package/library: DirectShow Base Classes (strmiids.lib)