MCPcopy Create free account
hub / github.com/Nevcairiel/LAVFilters / Receive

Method Receive

common/baseclasses/amfilter.cpp:2959–3042  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2957*/
2958
2959STDMETHODIMP
2960CBaseInputPin::Receive(IMediaSample *pSample)
2961{
2962 CheckPointer(pSample, E_POINTER);
2963 ValidateReadPtr(pSample, sizeof(IMediaSample));
2964 ASSERT(pSample);
2965
2966 HRESULT hr = CheckStreaming();
2967 if (S_OK != hr)
2968 {
2969 return hr;
2970 }
2971
2972#ifdef DXMPERF
2973 PERFLOG_RECEIVE(m_pName ? m_pName : L"CBaseInputPin", (IPin *)m_Connected, (IPin *)this, pSample, &m_mt);
2974#endif // DXMPERF
2975
2976 /* Check for IMediaSample2 */
2977 IMediaSample2 *pSample2;
2978 if (SUCCEEDED(pSample->QueryInterface(IID_IMediaSample2, (void **)&pSample2)))
2979 {
2980 hr = pSample2->GetProperties(sizeof(m_SampleProps), (PBYTE)&m_SampleProps);
2981 pSample2->Release();
2982 if (FAILED(hr))
2983 {
2984 return hr;
2985 }
2986 }
2987 else
2988 {
2989 /* Get the properties the hard way */
2990 m_SampleProps.cbData = sizeof(m_SampleProps);
2991 m_SampleProps.dwTypeSpecificFlags = 0;
2992 m_SampleProps.dwStreamId = AM_STREAM_MEDIA;
2993 m_SampleProps.dwSampleFlags = 0;
2994 if (S_OK == pSample->IsDiscontinuity())
2995 {
2996 m_SampleProps.dwSampleFlags |= AM_SAMPLE_DATADISCONTINUITY;
2997 }
2998 if (S_OK == pSample->IsPreroll())
2999 {
3000 m_SampleProps.dwSampleFlags |= AM_SAMPLE_PREROLL;
3001 }
3002 if (S_OK == pSample->IsSyncPoint())
3003 {
3004 m_SampleProps.dwSampleFlags |= AM_SAMPLE_SPLICEPOINT;
3005 }
3006 if (SUCCEEDED(pSample->GetTime(&m_SampleProps.tStart, &m_SampleProps.tStop)))
3007 {
3008 m_SampleProps.dwSampleFlags |= AM_SAMPLE_TIMEVALID | AM_SAMPLE_STOPVALID;
3009 }
3010 if (S_OK == pSample->GetMediaType(&m_SampleProps.pMediaType))
3011 {
3012 m_SampleProps.dwSampleFlags |= AM_SAMPLE_TYPECHANGED;
3013 }
3014 pSample->GetPointer(&m_SampleProps.pbBuffer);
3015 m_SampleProps.lActual = pSample->GetActualDataLength();
3016 m_SampleProps.cbBuffer = pSample->GetSize();

Callers 1

DeliverMethod · 0.45

Calls 13

SUCCEEDEDFunction · 0.85
GetPropertiesMethod · 0.80
NotifyEventMethod · 0.80
QueryInterfaceMethod · 0.45
ReleaseMethod · 0.45
IsDiscontinuityMethod · 0.45
IsPrerollMethod · 0.45
IsSyncPointMethod · 0.45
GetTimeMethod · 0.45
GetMediaTypeMethod · 0.45
GetPointerMethod · 0.45
GetActualDataLengthMethod · 0.45

Tested by

no test coverage detected