none
record Video to a File ,why cost a long time RRS feed

  • General discussion

  • //------------------- set filename HRESULT hResult; CComPtr<IFileSinkFilter> pFileSinkFilter; m_pMediaControl->Stop(); m_pMediaControl->Run(); CHK(m_pASFMultiplexer->QueryInterface(&pFileSinkFilter));

    CHK(pFileSinkFilter->SetFileName(L"\\windows\\sample.asf",NULL));//

    pFileSinkFilter.Release(); //------------------start record LONGLONG dwStart = 0, dwEnd = 0; WORD wStartCookie = 1, wEndCookie = 2; HRESULT hResult = 0; if( m_pCaptureGraphBuilder == NULL ) { return FALSE; } // dwStart=0; dwEnd=MAXLONGLONG; hResult = m_pCaptureGraphBuilder->ControlStream( &PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video, m_pVideoCaptureFilter, &dwStart, &dwEnd, wStartCookie, wEndCookie ); Sleep(60000);//1 minute //------------------stop record HRESULT hResult = S_OK; LONGLONG dwStart = 0, dwEnd = 0; WORD wStartCookie = 1, wEndCookie = 2; LONG lEventCode = 0; LONG lParam1 = 0; LONG lParam2 = 0; if( m_pCaptureGraphBuilder == NULL ) { return FALSE; } // dwStart = 0; hResult = m_pMediaSeeking->GetCurrentPosition( &dwEnd ); hResult = m_pCaptureGraphBuilder->ControlStream( &PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video, m_pVideoCaptureFilter, &dwStart, &dwEnd, wStartCookie, wEndCookie ); // while (true) { m_pMediaEvent->GetEvent( &lEventCode, &lParam1, &lParam2, INFINITE ); m_pMediaEvent->FreeEventParams( lEventCode, lParam1, lParam2 ); if( lEventCode == EC_STREAM_CONTROL_STOPPED ) { TRACE(L"Record stop\n"); break; } Sleep(100); NKDbgPrintfW(L"lEventCode = %d dwEnd = %d\n",lEventCode,dwEnd); }

    CPU is 624MHz(ARM920T-PAX310),RAM is 72MB,

    capture video use 1 mintue  ,almost 10 minute record time,i set breakpoint ,find it cost long time,see this code

    m_pMediaEvent->GetEvent( &lEventCode, &lParam1, &lParam2, INFINITE );
    m_pMediaEvent
    ->FreeEventParams( lEventCode, lParam1, lParam2 );
    if( lEventCode == EC_STREAM_CONTROL_STOPPED ) {
    TRACE
    (L"Record stop\n");
    break;
    }

    why???,i find file's size increase continous from "start record ",how cost long time for "stop record",what to do in "stop record"???

    Monday, December 31, 2012 12:41 AM

All replies

  • Sorry, but this is not the appropriate forum since it is not a driver development question

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Monday, December 31, 2012 1:30 AM