Esempio n. 1
0
HRESULT CGraphRender::RecordFile(LPCWSTR lpszFile, WORD nPayloadMask)
{
	HRESULT hr = S_OK;
	this->Stop();
	
	// File
	
	CComPtr<IFileSinkFilter> pFileSink;
	hr = m_pCapGraphBuilder->SetOutputFileName( &MEDIASUBTYPE_Avi, lpszFile, &m_pMultiplexer, &pFileSink );
	
	pFileSink->QueryInterface( IID_IBaseFilter, reinterpret_cast<void **>( &m_pFileSink ) );
	
	// Audio Capture
	
	CComPtr<IBaseFilter> pCapture;
	if ( SUCCEEDED(hr) && (RecordPayload(nPayloadMask) & PayloadMask_Audio) &&
		FAILED(hr = m_pGraphBuilder->FindFilterByName( L"Audio Receiver", &pCapture )) )
	{
		hr = InstallRender( new CRtpReceiverFilter(Payload_Alaw, (WAVEFORMATEX*)0, this), L"Audio Receiver", &pCapture );
	}
	
	CComPtr<IPin> pPinOut;
	if ( SUCCEEDED(hr) && pCapture && SUCCEEDED(
		hr = pCapture->FindPin( L"Capture", &pPinOut )) )
	{
		hr = m_pGraphBuilder->Render( pPinOut );
	}
	
	// Video Capture
	
	pCapture.Release();
	if ( SUCCEEDED(hr) && (RecordPayload(nPayloadMask) & PayloadMask_Video) &&
		FAILED(hr = m_pGraphBuilder->FindFilterByName(L"Video Receiver", &pCapture)) )
	{
		hr = InstallRender( new CRtpReceiverFilter(Payload_H263, (VIDEOINFOHEADER*)0, this), L"Video Receiver", &pCapture );
	}
	
	pPinOut.Release();
	if ( SUCCEEDED(hr) && pCapture && SUCCEEDED(
		hr = pCapture->FindPin( L"Capture", &pPinOut )) )
	{
		hr = m_pGraphBuilder->Render( pPinOut );
	}
	
	// Config Stream
	
	CComPtr<IConfigAviMux> pConfigAviMux;
	if ( SUCCEEDED(hr) ) hr =
	m_pMultiplexer->QueryInterface( IID_IConfigAviMux, (void **)&pConfigAviMux);
	
	if ( SUCCEEDED(hr) )
	{
		hr=pConfigAviMux->SetOutputCompatibilityIndex( TRUE );
		hr=pConfigAviMux->SetMasterStream( 0 );
	}
	
	DbgLog((LOG_TRACE, 0, TEXT("Record[%s]: %ls"), GetNamed(), lpszFile));
	return Run();
}
Esempio n. 2
0
void CMonitorWnd::Apply()
{
	CRegistry pRegistry;
	
	DWORD nPayloadMask = pRegistry.GetInt( "Monitor", "RecMask", RecordPayload(PayloadMask_Audio) );
	pRegistry.SetInt( "Monitor", "RecMask", nPayloadMask );
}
Esempio n. 3
0
void CMonitorWnd::OnMediaRecMask() 
{
	CRegistry pRegistry;
	DWORD nPayloadMask = pRegistry.GetInt( "Monitor", "RecMask" );
	
	pRegistry.SetInt( "Monitor", "RecMask", RecordPayload(nPayloadMask) ^ PayloadMask_Video );
}
Esempio n. 4
0
void CMonitorWnd::OnUpdateMediaRecMask(CCmdUI* pCmdUI)
{
	CRegistry pRegistry;
	DWORD nPayloadMask = pRegistry.GetInt( "Monitor", "RecMask" );
	
	pCmdUI->SetCheck( (RecordPayload(nPayloadMask) & PayloadMask_Video) == PayloadMask_Video );
}
Esempio n. 5
0
size_t URI::get_record_size() const
{
    if (!_uri) {
        return 0;
    }

    return MessageBuilder::compute_record_size(
               Record(
                   RecordType(
                       RecordType::well_known_type,
                       uri_record_type_value
                   ),
                   RecordPayload(_uri, _uri_size),
                   RecordID(),
                   /* chunk */ false,
                   /* last record */ false
               )
           );
}
Esempio n. 6
0
size_t Text::get_record_size() const
{
    if (!_text_record) {
        return 0;
    }

    return MessageBuilder::compute_record_size(
               Record(
                   RecordType(
                       RecordType::well_known_type,
                       text_record_type_value
                   ),
                   RecordPayload(_text_record, _text_record_size),
                   RecordID(),
                   /* chunk */ false,
                   /* last record */ false
               )
           );
}