コード例 #1
0
extern void WPInit( void )
/************************/
{
    char        *rover;
    bint        do_report;
    char        buff[256];

#ifdef TRMEM
    TRMemOpen();
    TRMemRedirect( STDOUT_FILENO );
#endif
    SamplePath[0] = 0;
    InitPaths();
    rover = getenv( "WPROF" );
    if( rover != NULL ) {
        procCmd( rover );
    }
    getcmd( buff );
    do_report = procCmd( buff );
    WndInit( "Open Watcom Profiler" );
    WPWndInitDone = P_TRUE;
    InitMADInfo();
    WPDipInit();
    if( do_report ) {
        if( GetSampleInfo() ) {
            ReportSampleInfo();
        }
        exit( 0 );
    }
}
コード例 #2
0
HRESULT CASFManager::SendAudioSampleToDecoder(
    IMFSample* pSample,
    const MFTIME& hnsTestSampleEndTime,
    BOOL bReverse,
    BOOL *pbComplete,
    SAMPLE_INFO* pSampleInfo,
    void (*FuncPtrToDisplaySampleInfo)(SAMPLE_INFO*))
{
    if (!pSample)
    {
        return E_INVALIDARG;
    }
    
    HRESULT hr = S_OK;
    
    MFTIME hnsCurrentSampleTime = 0;
    BOOL   bShouldDecode = FALSE;

    // Get the time stamp on the sample.
    CHECK_HR(hr = pSample->GetSampleTime(&hnsCurrentSampleTime));

    if (bReverse)
    {
        bShouldDecode = (hnsCurrentSampleTime > hnsTestSampleEndTime);
    }
    else
    {
        bShouldDecode = (hnsCurrentSampleTime < hnsTestSampleEndTime);
    }

    if (bShouldDecode)
    {

        // If the decoder is not streaming, start it.
        if ( m_pDecoder->GetDecoderStatus() != STREAMING)
        {
            CHECK_HR (hr =  m_pDecoder->StartDecoding());
        }

        CHECK_HR (hr =  m_pDecoder->ProcessAudio (pSample));
        
        //Get sample information
        (void)GetSampleInfo(pSample, pSampleInfo);

        //Send it to callback to display
        FuncPtrToDisplaySampleInfo(pSampleInfo);

    }
    else
    {
        //all samples have been decoded. Inform the decoder.
        CHECK_HR (hr =  m_pDecoder->StopDecoding());
    }

    *pbComplete = !bShouldDecode;

done:
    return hr;
}
コード例 #3
0
ファイル: CreateYieldTable.C プロジェクト: kelleyrw/DrellYan
std::string GetLatex
(
    const dy::Sample::value_type sample,
    const dy::YieldVector&  yields,
    const bool data = false
)
{
    return GetLatex(GetSampleInfo(sample).latex, yields.at(sample), data);
}
コード例 #4
0
HRESULT CASFManager::SendKeyFrameToDecoder(
    IMFSample* pSample,
    const MFTIME& hnsSeekTime,
    BOOL bReverse,
    BOOL* fDecodedKeyFrame,
    SAMPLE_INFO* pSampleInfo,
    void (*FuncPtrToDisplaySampleInfo)(SAMPLE_INFO*))
{
    if (!pSample)
    {
        return E_INVALIDARG;
    }
    
    HRESULT hr = S_OK;
    
    MFTIME hnsCurrentSampleTime =0;

    BOOL   fShouldDecode = FALSE;
    UINT32 fIsKeyFrame = 0;

    IMFSample* pKeyFrameSample = NULL;

    // Get the time stamp on the sample
    CHECK_HR (hr = pSample->GetSampleTime (&hnsCurrentSampleTime));

    if ((UINT64)hnsCurrentSampleTime > m_fileinfo->cbPreroll)
    {
        hnsCurrentSampleTime -= m_fileinfo->cbPreroll;
    }

    // Check if the key-frame attribute is set on the sample
    fIsKeyFrame = MFGetAttributeUINT32(pSample, MFSampleExtension_CleanPoint, FALSE);

    if (!fIsKeyFrame)
    {
        return hr;
    }

    // Should we decode this sample?
    if (bReverse)
    {
        // Reverse playback: 
        // Is the sample *prior* to the seek time, and a key frame?
        fShouldDecode = (hnsCurrentSampleTime <= hnsSeekTime) ;
    }
    else
    {
        // Forward playback:
        // Is the sample *after* the seek time, and a key frame?
        fShouldDecode = (hnsCurrentSampleTime >= hnsSeekTime);
    }

    if (fShouldDecode)
    {
        // We found the key frame closest to the seek time.
        // Start the decoder if not already started.
        if ( m_pDecoder->GetDecoderStatus() != STREAMING)
        {
            CHECK_HR (hr =  m_pDecoder->StartDecoding());
        }

        // Set the discontinity attribute.
        CHECK_HR (hr = pSample->SetUINT32(MFSampleExtension_Discontinuity, TRUE)); 

        //Send the sample to the decoder.
        CHECK_HR (hr =  m_pDecoder->ProcessVideo(pSample));

        *fDecodedKeyFrame = TRUE;
        
        //Get sample information
        (void)GetSampleInfo(pSample, pSampleInfo);
        pSampleInfo->fSeekedKeyFrame = *fDecodedKeyFrame;

        //Send it to callback to display
        FuncPtrToDisplaySampleInfo(pSampleInfo);
            
        CHECK_HR (hr =  m_pDecoder->StopDecoding());
    }


done:
    return hr;
}