| 1070 | } |
| 1071 | |
| 1072 | HRESULT CLAVVideo::CompleteConnect(PIN_DIRECTION dir, IPin *pReceivePin) |
| 1073 | { |
| 1074 | DbgLog((LOG_TRACE, 10, L"::CompleteConnect")); |
| 1075 | HRESULT hr = S_OK; |
| 1076 | if (dir == PINDIR_OUTPUT) |
| 1077 | { |
| 1078 | BOOL bFailNonDXVA = false; |
| 1079 | // Fail P010 software connections before Windows 10 Creators Update (presumably it was fixed before Creators |
| 1080 | // already, but this is definitely a safe known condition) |
| 1081 | if (!IsWindows10BuildOrNewer(15063) && (m_pOutput->CurrentMediaType().subtype == MEDIASUBTYPE_P010 || |
| 1082 | m_pOutput->CurrentMediaType().subtype == MEDIASUBTYPE_P016)) |
| 1083 | { |
| 1084 | // Check if we're connecting to EVR |
| 1085 | IBaseFilter *pFilter = GetFilterFromPin(pReceivePin); |
| 1086 | if (pFilter != nullptr) |
| 1087 | { |
| 1088 | CLSID guid; |
| 1089 | if (SUCCEEDED(pFilter->GetClassID(&guid))) |
| 1090 | { |
| 1091 | DbgLog((LOG_TRACE, 10, L"-> Connecting P010/P016 to %s", WStringFromGUID(guid).c_str())); |
| 1092 | bFailNonDXVA = (guid == CLSID_EnhancedVideoRenderer || guid == CLSID_VideoMixingRenderer9 || |
| 1093 | guid == CLSID_VideoMixingRenderer); |
| 1094 | } |
| 1095 | SafeRelease(&pFilter); |
| 1096 | } |
| 1097 | } |
| 1098 | |
| 1099 | hr = m_Decoder.PostConnect(pReceivePin); |
| 1100 | if (SUCCEEDED(hr)) |
| 1101 | { |
| 1102 | if (bFailNonDXVA) |
| 1103 | { |
| 1104 | LAVPixelFormat fmt; |
| 1105 | m_Decoder.GetPixelFormat(&fmt, nullptr, nullptr); |
| 1106 | |
| 1107 | if (fmt != LAVPixFmt_DXVA2) |
| 1108 | { |
| 1109 | DbgLog((LOG_TRACE, 10, L"-> Non-DXVA2 Connection rejected on this renderer and subtype")); |
| 1110 | return VFW_E_TYPE_NOT_ACCEPTED; |
| 1111 | } |
| 1112 | } |
| 1113 | |
| 1114 | CheckDirectMode(); |
| 1115 | } |
| 1116 | } |
| 1117 | else if (dir == PINDIR_INPUT) |
| 1118 | { |
| 1119 | if (m_pInput->CurrentMediaType().subtype == MEDIASUBTYPE_MPEG2_VIDEO && !m_pSubtitleInput && |
| 1120 | (m_dwDecodeFlags & LAV_VIDEO_DEC_FLAG_DVD)) |
| 1121 | { |
| 1122 | m_pSubtitleInput = new CLAVVideoSubtitleInputPin(TEXT("CLAVVideoSubtitleInputPin"), this, &m_csFilter, &hr, |
| 1123 | L"Subtitle Input"); |
| 1124 | ASSERT(SUCCEEDED(hr)); |
| 1125 | m_SubtitleConsumer = new CLAVSubtitleConsumer(this); |
| 1126 | m_SubtitleConsumer->AddRef(); |
| 1127 | m_pSubtitleInput->SetSubtitleConsumer(m_SubtitleConsumer); |
| 1128 | |
| 1129 | BITMAPINFOHEADER *pBIH = nullptr; |
nothing calls this directly
no test coverage detected