当前位置: 首页>>代码示例>>C++>>正文


C++ ComPtr::AddTimeSpan方法代码示例

本文整理汇总了C++中ComPtr::AddTimeSpan方法的典型用法代码示例。如果您正苦于以下问题:C++ ComPtr::AddTimeSpan方法的具体用法?C++ ComPtr::AddTimeSpan怎么用?C++ ComPtr::AddTimeSpan使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ComPtr的用法示例。


在下文中一共展示了ComPtr::AddTimeSpan方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Log_ProcessInput

HRESULT Trace::Log_ProcessInput(ABI::Windows::Foundation::Diagnostics::ILoggingActivity **ppActivity,DWORD dwInputStreamID, IMFSample *pSample, DWORD dwFlags,REFERENCE_TIME presentationTime)
{
    ComPtr<ILoggingFields> fields;
    HRESULT hr = CreateLoggingFields(&fields);
    if (FAILED(hr))
        return hr;
    fields->AddUInt32(HStringReference(L"InputStreamId").Get(), dwInputStreamID);

    if (pSample != nullptr)
    {
        REFERENCE_TIME sampleTime = 0,duration = 0;
        DWORD dwSampleFlags = 0, dwBufferCount = 0;
        pSample->GetSampleTime(&sampleTime);
        pSample->GetSampleDuration(&duration);
        pSample->GetSampleFlags(&dwSampleFlags);
        pSample->GetBufferCount(&dwBufferCount);
        fields->AddTimeSpan(HStringReference(L"Time").Get(), ABI::Windows::Foundation::TimeSpan() = { sampleTime });
        fields->AddTimeSpan(HStringReference(L"Duration").Get(), ABI::Windows::Foundation::TimeSpan() = { duration });
        fields->AddUInt32(HStringReference(L"SampleFlags").Get(), dwSampleFlags);
        fields->AddUInt32(HStringReference(L"BufferCount").Get(), dwBufferCount);
    }
    else
    {
        fields->AddEmpty(HStringReference(L"InputStreamId").Get());
        fields->AddEmpty(HStringReference(L"Time").Get());
        fields->AddEmpty(HStringReference(L"Duration").Get());
        fields->AddEmpty(HStringReference(L"SampleFlags").Get());
    }
    fields->AddTimeSpan(HStringReference(L"PresentationTime").Get(), ABI::Windows::Foundation::TimeSpan() = { presentationTime });
    fields->AddUInt32(HStringReference(L"Flags").Get(), dwFlags);

    hr = g_spLogChannel->StartActivityWithFields(HStringReference(MFT_PROCESS_INPUT).Get(), fields.Get(), ppActivity);
    return hr;
}
开发者ID:clarkezone,项目名称:audiovisualization,代码行数:34,代码来源:Trace.cpp

示例2: Log_FrameFound

HRESULT Trace::Log_FrameFound(REFERENCE_TIME start, REFERENCE_TIME duration)
{
    ComPtr<ILoggingFields> fields;
    HRESULT hr = CreateLoggingFields(&fields);
    if (FAILED(hr))
        return hr;
    fields->AddTimeSpan(HStringReference(L"Time").Get(), ABI::Windows::Foundation::TimeSpan() = { start });
    fields->AddTimeSpan(HStringReference(L"Duration").Get(), ABI::Windows::Foundation::TimeSpan() = { duration });

    return g_spLogChannel->LogEventWithFields(HStringReference(APP_GF_FOUND).Get(), fields.Get());
}
开发者ID:clarkezone,项目名称:audiovisualization,代码行数:11,代码来源:Trace.cpp

示例3: Log_TestFrame

HRESULT Trace::Log_TestFrame(REFERENCE_TIME presentationTime, REFERENCE_TIME frameStart, REFERENCE_TIME frameEnd)
{
    ComPtr<ILoggingFields> fields;
    HRESULT hr = CreateLoggingFields(&fields);
    if (FAILED(hr))
        return hr;
    fields->AddTimeSpan(HStringReference(L"Time").Get(), ABI::Windows::Foundation::TimeSpan() = { presentationTime });
    fields->AddTimeSpan(HStringReference(L"Start").Get(), ABI::Windows::Foundation::TimeSpan() = { frameStart });
    fields->AddTimeSpan(HStringReference(L"End").Get(), ABI::Windows::Foundation::TimeSpan() = { frameEnd });

    return g_spLogChannel->LogEventWithFields(HStringReference(APP_GF_TESTFRAME).Get(), fields.Get());
}
开发者ID:clarkezone,项目名称:audiovisualization,代码行数:12,代码来源:Trace.cpp

示例4: Log_ProcessOutput

HRESULT Trace::Log_ProcessOutput(ABI::Windows::Foundation::Diagnostics::ILoggingActivity **ppActivity,DWORD dwFlags, DWORD cOutputBufferCount,MFT_OUTPUT_DATA_BUFFER *pOutBuffer,REFERENCE_TIME presentationTime)
{
    ComPtr<ILoggingFields> fields;
    HRESULT hr = CreateLoggingFields(&fields);
    if (FAILED(hr))
        return hr;
    fields->AddUInt32(HStringReference(L"OutputBufferCount").Get(), cOutputBufferCount);
    fields->AddTimeSpan(HStringReference(L"PresentationTime").Get(), ABI::Windows::Foundation::TimeSpan() = { presentationTime });
    fields->AddUInt32(HStringReference(L"Flags").Get(), dwFlags);
    hr = g_spLogChannel->StartActivityWithFields(HStringReference(MFT_PROCESS_OUTPUT).Get(), fields.Get(), ppActivity);
    return hr;
}
开发者ID:clarkezone,项目名称:audiovisualization,代码行数:12,代码来源:Trace.cpp

示例5: Log_StopAnalyzerStep

HRESULT Trace::Log_StopAnalyzerStep(ABI::Windows::Foundation::Diagnostics::ILoggingActivity * pActivity, REFERENCE_TIME time, HRESULT hResult)
{
    ComPtr<ILoggingFields> fields;
    HRESULT hr = CreateLoggingFields(&fields);
    if (FAILED(hr))
        return hr;

    fields->AddTimeSpan(HStringReference(L"Time").Get(), ABI::Windows::Foundation::TimeSpan() = { time });
    fields->AddUInt32WithFormat(HStringReference(L"Result").Get(), hResult, LoggingFieldFormat::LoggingFieldFormat_HResult);
    ComPtr<ILoggingActivity> spActivity = pActivity;
    ComPtr<ILoggingActivity2> spActivity2;
    spActivity.As(&spActivity2);
    HSTRING hName;
    spActivity->get_Name(&hName);
    return spActivity2->StopActivityWithFields(hName, fields.Get());
}
开发者ID:clarkezone,项目名称:audiovisualization,代码行数:16,代码来源:Trace.cpp

示例6: Log_StartGetFrame

HRESULT Trace::Log_StartGetFrame(ABI::Windows::Foundation::Diagnostics::ILoggingActivity **ppActivity, REFERENCE_TIME presentationTime,const REFERENCE_TIME *pTimes,size_t queueSize)
{
    ComPtr<ILoggingFields> fields;
    HRESULT hr = CreateLoggingFields(&fields);
    if (FAILED(hr))
        return hr;

    fields->AddTimeSpan(HStringReference(L"PresentationTime").Get(), ABI::Windows::Foundation::TimeSpan() = { presentationTime });
    if (queueSize > 0)
        fields->AddTimeSpanArray(HStringReference(L"Queue").Get(), queueSize, (ABI::Windows::Foundation::TimeSpan *) pTimes);
    else
        fields->AddEmpty(HStringReference(L"Queue").Get());

    fields->AddUInt32(HStringReference(L"Queue.size").Get(),queueSize);
    return g_spLogChannel->StartActivityWithFields(HStringReference(APP_GETFRAME).Get(), fields.Get(), ppActivity);
}
开发者ID:clarkezone,项目名称:audiovisualization,代码行数:16,代码来源:Trace.cpp

示例7: Log_SA_Start_AppendInput

HRESULT Trace::Log_SA_Start_AppendInput(ABI::Windows::Foundation::Diagnostics::ILoggingActivity **ppActivity, 
    REFERENCE_TIME sampleTime, size_t sampleCount,size_t samplesInBuffer, void *pWritePtr, void *pReadPtr, long inputSampleOffset, long expectedOffset)
{
    ComPtr<ILoggingFields> fields;
    HRESULT hr = CreateLoggingFields(&fields);
    if (FAILED(hr))
        return hr;

    fields->AddTimeSpan(HStringReference(L"Time").Get(), ABI::Windows::Foundation::TimeSpan() = { sampleTime });
    fields->AddUInt32(HStringReference(L"SampleSize").Get(), sampleCount);
    fields->AddUInt32(HStringReference(L"BufferSize").Get(), samplesInBuffer);
    fields->AddUInt32WithFormat(HStringReference(L"pWrite").Get(), (UINT32)pWritePtr, LoggingFieldFormat::LoggingFieldFormat_Hexadecimal);
    fields->AddUInt32WithFormat(HStringReference(L"pRead").Get(), (UINT32)pReadPtr, LoggingFieldFormat::LoggingFieldFormat_Hexadecimal);
    fields->AddInt64(HStringReference(L"Offset").Get(), inputSampleOffset);
    fields->AddInt64(HStringReference(L"BufferOffset").Get(), expectedOffset);
    return g_spLogChannel->StartActivityWithFields(HStringReference(ANALYZER_APPEND_INPUT).Get(), fields.Get(), ppActivity);

}
开发者ID:clarkezone,项目名称:audiovisualization,代码行数:18,代码来源:Trace.cpp

示例8: Log_SA_Stop_AppendInput

HRESULT Trace::Log_SA_Stop_AppendInput(ABI::Windows::Foundation::Diagnostics::ILoggingActivity *pActivity, 
    REFERENCE_TIME sampleTime, size_t sampleSize, size_t samplesInBuffer, void *pWritePtr, void *pReadPtr, long expectedOffset)
{
    ComPtr<ILoggingFields> fields;
    HRESULT hr = CreateLoggingFields(&fields);
    if (FAILED(hr))
        return hr;

    fields->AddTimeSpan(HStringReference(L"Time").Get(), ABI::Windows::Foundation::TimeSpan() = { sampleTime });
    fields->AddUInt32(HStringReference(L"SampleLength").Get(), sampleSize);
    fields->AddUInt32(HStringReference(L"BufferSize").Get(), samplesInBuffer);
    fields->AddUInt32WithFormat(HStringReference(L"pWrite").Get(), (UINT32)pWritePtr, LoggingFieldFormat::LoggingFieldFormat_Hexadecimal);
    fields->AddUInt32WithFormat(HStringReference(L"pRead").Get(), (UINT32)pReadPtr, LoggingFieldFormat::LoggingFieldFormat_Hexadecimal);
    fields->AddInt64(HStringReference(L"BufferOffset").Get(), expectedOffset);

    ComPtr<ILoggingActivity> spActivity = pActivity;
    ComPtr<ILoggingActivity2> spActivity2;
    spActivity.As(&spActivity2);
    HSTRING hName;
    spActivity->get_Name(&hName);
    return spActivity2->StopActivityWithFields(hName, fields.Get());
}
开发者ID:clarkezone,项目名称:audiovisualization,代码行数:22,代码来源:Trace.cpp


注:本文中的ComPtr::AddTimeSpan方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。