| 483 | } |
| 484 | |
| 485 | STDMETHODIMP_(LPWSTR) CLAVVideo::GetFileExtension() |
| 486 | { |
| 487 | if (m_strExtension.empty()) |
| 488 | { |
| 489 | m_strExtension = L""; |
| 490 | |
| 491 | IFileSourceFilter *pSource = nullptr; |
| 492 | if (SUCCEEDED(FindIntefaceInGraph(m_pInput, IID_IFileSourceFilter, (void **)&pSource))) |
| 493 | { |
| 494 | LPOLESTR pwszFile = nullptr; |
| 495 | if (SUCCEEDED(pSource->GetCurFile(&pwszFile, nullptr)) && pwszFile) |
| 496 | { |
| 497 | LPWSTR pwszExtension = PathFindExtensionW(pwszFile); |
| 498 | m_strExtension = std::wstring(pwszExtension); |
| 499 | CoTaskMemFree(pwszFile); |
| 500 | } |
| 501 | SafeRelease(&pSource); |
| 502 | } |
| 503 | } |
| 504 | |
| 505 | size_t len = m_strExtension.size() + 1; |
| 506 | LPWSTR pszExtension = (LPWSTR)CoTaskMemAlloc(sizeof(WCHAR) * len); |
| 507 | if (!pszExtension) |
| 508 | return nullptr; |
| 509 | |
| 510 | wcscpy_s(pszExtension, len, m_strExtension.c_str()); |
| 511 | return pszExtension; |
| 512 | } |
| 513 | |
| 514 | // CTransformFilter |
| 515 |
nothing calls this directly
no test coverage detected