MCPcopy Create free account
hub / github.com/Nevcairiel/LAVFilters / CompleteInputConnection

Method CompleteInputConnection

demuxer/LAVSplitter/LAVSplitter.cpp:514–570  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

512}
513
514STDMETHODIMP CLAVSplitter::CompleteInputConnection()
515{
516 HRESULT hr = S_OK;
517 BOOL bFileInput = FALSE;
518
519 // Check if blacklisted
520 if (!m_bRuntimeConfig && CheckApplicationBlackList(LAVF_REGISTRY_KEY L"\\Blacklist"))
521 return E_FAIL;
522
523 SAFE_DELETE(m_pDemuxer);
524
525 AVIOContext *pContext = nullptr;
526
527 if (FAILED(hr = m_pInput->GetAVIOContext(&pContext)))
528 {
529 return hr;
530 }
531
532 LPOLESTR pszFileName = nullptr;
533
534 PIN_INFO info;
535 hr = m_pInput->GetConnected()->QueryPinInfo(&info);
536 if (SUCCEEDED(hr) && info.pFilter)
537 {
538 IFileSourceFilter *pSource = nullptr;
539 if (SUCCEEDED(info.pFilter->QueryInterface(&pSource)) && pSource)
540 {
541 pSource->GetCurFile(&pszFileName, nullptr);
542 SafeRelease(&pSource);
543 }
544 CLSID inputCLSID;
545 if (SUCCEEDED(info.pFilter->GetClassID(&inputCLSID)))
546 {
547 bFileInput = (inputCLSID == CLSID_AsyncReader);
548 }
549 SafeRelease(&info.pFilter);
550 }
551
552 const char *format = nullptr;
553 if (m_pInput->CurrentMediaType().subtype == MEDIASUBTYPE_MPEG2_TRANSPORT)
554 {
555 format = "mpegts";
556 }
557
558 CLAVFDemuxer *pDemux = new CLAVFDemuxer(this, this);
559 if (FAILED(hr = pDemux->OpenInputStream(pContext, pszFileName, format, FALSE, bFileInput)))
560 {
561 SAFE_DELETE(pDemux);
562 return hr;
563 }
564 m_pDemuxer = pDemux;
565 m_pDemuxer->AddRef();
566
567 SAFE_CO_FREE(pszFileName);
568
569 return InitDemuxer();
570}
571

Callers 1

CompleteConnectMethod · 0.80

Calls 10

SUCCEEDEDFunction · 0.85
SafeReleaseFunction · 0.85
GetAVIOContextMethod · 0.80
QueryPinInfoMethod · 0.80
GetCurFileMethod · 0.80
OpenInputStreamMethod · 0.80
QueryInterfaceMethod · 0.45
GetClassIDMethod · 0.45
AddRefMethod · 0.45

Tested by

no test coverage detected