Exemple #1
0
HRESULT CBaseSplitterFilter::CompleteConnect(PIN_DIRECTION dir, CBasePin* pPin)
{
    CheckPointer(pPin, E_POINTER);

    if (dir == PINDIR_INPUT) {
        CBaseSplitterInputPin* pIn = static_cast<CBaseSplitterInputPin*>(pPin);

        HRESULT hr;

        CComPtr<IAsyncReader> pAsyncReader;
        if (FAILED(hr = pIn->GetAsyncReader(&pAsyncReader))
                || FAILED(hr = DeleteOutputs())
                || FAILED(hr = CreateOutputs(pAsyncReader))) {
            return hr;
        }

        ChapSort();

        m_pSyncReader = pAsyncReader;
    } else if (dir == PINDIR_OUTPUT) {
        m_pRetiredOutputs.RemoveAll();
    } else {
        return E_UNEXPECTED;
    }

    return S_OK;
}
Exemple #2
0
STDMETHODIMP CBaseSplitterFilter::Load(LPCOLESTR pszFileName, const AM_MEDIA_TYPE* pmt)
{
	CheckPointer(pszFileName, E_POINTER);

	m_fn = pszFileName;
	HRESULT hr = E_FAIL;
	CComPtr<IAsyncReader> pAsyncReader;
	CAtlList<CHdmvClipInfo::PlaylistItem> Items;
	if (BuildPlaylist (pszFileName, Items)) {
		pAsyncReader = (IAsyncReader*)DNew CAsyncFileReader(Items, hr);
	} else {
		pAsyncReader = (IAsyncReader*)DNew CAsyncFileReader(CString(pszFileName), hr);
	}
	if(FAILED(hr)
			|| FAILED(hr = DeleteOutputs())
			|| FAILED(hr = CreateOutputs(pAsyncReader))) {
		m_fn = "";
		return hr;
	}

	ChapSort();

	m_pSyncReader = pAsyncReader;

	return S_OK;
}
Exemple #3
0
STDMETHODIMP_(long) IDSMChapterBagImpl::ChapLookup(REFERENCE_TIME* prt, BSTR* ppName)
{
	CheckPointer(prt, -1);

	ChapSort();

	int i = range_bsearch(m_chapters, *prt);
	if(i < 0) return -1;

	*prt = m_chapters[i].rt;
	if(ppName) *ppName = m_chapters[i].name.AllocSysString();

	return i;
}
Exemple #4
0
STDMETHODIMP CBaseSplitterFilter::Load(LPCOLESTR pszFileName, const AM_MEDIA_TYPE* pmt)
{
	CheckPointer(pszFileName, E_POINTER);

	m_fn = pszFileName;
	HRESULT hr = E_FAIL;
	CComPtr<IAsyncReader> pAsyncReader;
	CHdmvClipInfo::CPlaylistChapter Chapters;

	if (BuildPlaylist(pszFileName, m_Items)) {
		pAsyncReader = (IAsyncReader*)DNew CAsyncFileReader(m_Items, hr);
	} else {
		pAsyncReader = (IAsyncReader*)DNew CAsyncFileReader(CString(pszFileName), hr);
	}

	if (FAILED(hr)
			|| FAILED(hr = DeleteOutputs())
			|| FAILED(hr = CreateOutputs(pAsyncReader))) {
		m_fn = "";
		return hr;
	}

	SortOutputPin();

	if (BuildChapters(pszFileName, m_Items, Chapters)) {
		POSITION pos	= Chapters.GetHeadPosition();
		int	i			= 1;
		while (pos) {
			CString str;
			CHdmvClipInfo::PlaylistChapter& chap = Chapters.GetNext(pos);
			if (chap.m_nMarkType == CHdmvClipInfo::EntryMark) {
				str.Format (_T("Chapter %d"), i);
				ChapAppend (chap.m_rtTimestamp, str);
				i++;
			}
		}
	}

	ChapSort();

	m_pSyncReader = pAsyncReader;

	return S_OK;
}
Exemple #5
0
STDMETHODIMP CBaseSplitterFilter::Load(LPCOLESTR pszFileName, const AM_MEDIA_TYPE* pmt)
{
	CheckPointer(pszFileName, E_POINTER);

	m_fn = pszFileName;
	HRESULT hr = E_FAIL;
	CComPtr<IAsyncReader> pAsyncReader = (IAsyncReader*)new CAsyncFileReader(CString(pszFileName), hr);
	if(FAILED(hr)
	|| FAILED(hr = DeleteOutputs())
	|| FAILED(hr = CreateOutputs(pAsyncReader)))
	{
		m_fn = "";
		return hr;
	}

	ChapSort();

	m_pSyncReader = pAsyncReader;

	return S_OK;
}