| 1138 | } |
| 1139 | |
| 1140 | HRESULT CLAVVideo::StartStreaming() |
| 1141 | { |
| 1142 | CAutoLock cAutoLock(&m_csReceive); |
| 1143 | |
| 1144 | if (m_pSubtitleInput) |
| 1145 | { |
| 1146 | bool bFoundConsumer = false; |
| 1147 | ISubRenderConsumer *pSubConsumer = nullptr; |
| 1148 | if (SUCCEEDED(FindIntefaceInGraph(m_pOutput, __uuidof(ISubRenderConsumer), (void **)&pSubConsumer))) |
| 1149 | { |
| 1150 | int nc = 0; |
| 1151 | LPWSTR strName = nullptr, strVersion = nullptr; |
| 1152 | pSubConsumer->GetString("name", &strName, &nc); |
| 1153 | pSubConsumer->GetString("version", &strVersion, &nc); |
| 1154 | DbgLog((LOG_TRACE, 10, L"CLAVVideo::StartStreaming():: Found ISubRenderConsumer (%s %s)", strName, |
| 1155 | strVersion)); |
| 1156 | |
| 1157 | // only support madVR for now, and only recent versions (anything before 0.89.10 crashes) |
| 1158 | if (strName && strVersion) |
| 1159 | { |
| 1160 | if (wcscmp(strName, L"madVR") == 0) |
| 1161 | { |
| 1162 | int major, minor, build, rev; |
| 1163 | if (swscanf_s(strVersion, L"%d.%d.%d.%d", &major, &minor, &build, &rev) == 4) |
| 1164 | { |
| 1165 | if (major > 0 || (major == 0 && (minor > 89 || (minor == 89 && build >= 10)))) |
| 1166 | bFoundConsumer = true; |
| 1167 | } |
| 1168 | } |
| 1169 | else if (wcscmp(strName, L"JRVR") == 0) |
| 1170 | { |
| 1171 | bFoundConsumer = true; |
| 1172 | } |
| 1173 | } |
| 1174 | |
| 1175 | if (bFoundConsumer) |
| 1176 | { |
| 1177 | m_pSubtitleInput->SetSubtitleConsumer(pSubConsumer); |
| 1178 | SafeRelease(&m_SubtitleConsumer); |
| 1179 | } |
| 1180 | |
| 1181 | SafeRelease(&pSubConsumer); |
| 1182 | } |
| 1183 | |
| 1184 | if (bFoundConsumer == false) |
| 1185 | { |
| 1186 | if (m_SubtitleConsumer == nullptr) |
| 1187 | { |
| 1188 | m_SubtitleConsumer = new CLAVSubtitleConsumer(this); |
| 1189 | m_SubtitleConsumer->AddRef(); |
| 1190 | |
| 1191 | BITMAPINFOHEADER *pBIH = nullptr; |
| 1192 | videoFormatTypeHandler(m_pInput->CurrentMediaType(), &pBIH); |
| 1193 | if (pBIH) |
| 1194 | { |
| 1195 | m_SubtitleConsumer->SetVideoSize(pBIH->biWidth, pBIH->biHeight); |
| 1196 | } |
| 1197 | } |
nothing calls this directly
no test coverage detected