MCPcopy Create free account
hub / github.com/AgoraIO/API-Examples / GetPinByName

Method GetPinByName

windows/APIExample/APIExample/DirectShow/DShowHelper.cpp:155–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

153}
154
155bool CDShowHelper::GetPinByName(IBaseFilter *filter, PIN_DIRECTION dir, const wchar_t *name,
156 IPin **pin)
157{
158 CComPtr<IPin> curPin = nullptr;
159 CComPtr<IEnumPins> pinsEnum = nullptr;
160 ULONG num = 0;
161
162 if (!filter)
163 return false;
164 if (FAILED(filter->EnumPins(&pinsEnum)))
165 return false;
166
167 while (pinsEnum->Next(1, &curPin, &num) == S_OK) {
168
169 if (PinIsDirection(curPin, dir) && PinNameIs(curPin, name)) {
170 *pin = curPin.Detach();
171 return true;
172 }
173 }
174
175 return false;
176}
177
178
179

Callers

nothing calls this directly

Calls 2

EnumPinsMethod · 0.80
NextMethod · 0.80

Tested by

no test coverage detected