| 102 | // This returns the IMediaPosition and IMediaSeeking interfaces |
| 103 | |
| 104 | HRESULT CBaseRenderer::GetMediaPositionInterface(REFIID riid, __deref_out void **ppv) |
| 105 | { |
| 106 | CAutoLock cObjectCreationLock(&m_ObjectCreationLock); |
| 107 | if (m_pPosition) |
| 108 | { |
| 109 | return m_pPosition->NonDelegatingQueryInterface(riid, ppv); |
| 110 | } |
| 111 | |
| 112 | CBasePin *pPin = GetPin(0); |
| 113 | if (NULL == pPin) |
| 114 | { |
| 115 | return E_OUTOFMEMORY; |
| 116 | } |
| 117 | |
| 118 | HRESULT hr = NOERROR; |
| 119 | |
| 120 | // Create implementation of this dynamically since sometimes we may |
| 121 | // never try and do a seek. The helper object implements a position |
| 122 | // control interface (IMediaPosition) which in fact simply takes the |
| 123 | // calls normally from the filter graph and passes them upstream |
| 124 | |
| 125 | m_pPosition = |
| 126 | new CRendererPosPassThru(NAME("Renderer CPosPassThru"), CBaseFilter::GetOwner(), (HRESULT *)&hr, pPin); |
| 127 | if (m_pPosition == NULL) |
| 128 | { |
| 129 | return E_OUTOFMEMORY; |
| 130 | } |
| 131 | |
| 132 | if (FAILED(hr)) |
| 133 | { |
| 134 | delete m_pPosition; |
| 135 | m_pPosition = NULL; |
| 136 | return E_NOINTERFACE; |
| 137 | } |
| 138 | return GetMediaPositionInterface(riid, ppv); |
| 139 | } |
| 140 | |
| 141 | // Overriden to say what interfaces we support and where |
| 142 |
nothing calls this directly
no test coverage detected