equal
deleted
inserted
replaced
138 |
138 |
139 m_source->setAllocator(*ppActual); |
139 m_source->setAllocator(*ppActual); |
140 |
140 |
141 return S_OK; |
141 return S_OK; |
142 } else { |
142 } else { |
143 *ppActual = com_new<IMemAllocator>(CLSID_MemoryAllocator); |
143 *ppActual = com_new<IMemAllocator>(CLSID_MemoryAllocator, IID_IMemAllocator); |
144 |
144 |
145 if (*ppActual) { |
145 if (*ppActual) { |
146 if ((*ppActual)->SetProperties(pProps, &actualProperties) != S_OK) { |
146 if ((*ppActual)->SetProperties(pProps, &actualProperties) != S_OK) { |
147 (*ppActual)->Release(); |
147 (*ppActual)->Release(); |
148 } else { |
148 } else { |
174 if (pSample->GetTime(&startTime, &endTime) != S_OK |
174 if (pSample->GetTime(&startTime, &endTime) != S_OK |
175 || pSample->GetPointer(&buffer) != S_OK) { |
175 || pSample->GetPointer(&buffer) != S_OK) { |
176 return VFW_E_SAMPLE_TIME_NOT_SET; |
176 return VFW_E_SAMPLE_TIME_NOT_SET; |
177 } else { |
177 } else { |
178 LONGLONG position = startTime / 10000000; |
178 LONGLONG position = startTime / 10000000; |
179 LONG length = ((endTime - startTime) / 10000000) + 1; |
179 LONG length = (endTime - startTime) / 10000000; |
180 |
180 |
181 DirectShowSampleRequest *request = new DirectShowSampleRequest( |
181 DirectShowSampleRequest *request = new DirectShowSampleRequest( |
182 pSample, dwUser, position, length, buffer); |
182 pSample, dwUser, position, length, buffer); |
183 |
183 |
184 if (m_pendingTail) { |
184 if (m_pendingTail) { |
246 if (pSample->GetTime(&startTime, &endTime) != S_OK |
246 if (pSample->GetTime(&startTime, &endTime) != S_OK |
247 || pSample->GetPointer(&buffer) != S_OK) { |
247 || pSample->GetPointer(&buffer) != S_OK) { |
248 return VFW_E_SAMPLE_TIME_NOT_SET; |
248 return VFW_E_SAMPLE_TIME_NOT_SET; |
249 } else { |
249 } else { |
250 LONGLONG position = startTime / 10000000; |
250 LONGLONG position = startTime / 10000000; |
251 LONG length = ((endTime - startTime) / 10000000) + 1; |
251 LONG length = (endTime - startTime) / 10000000; |
252 |
252 |
253 QMutexLocker locker(&m_mutex); |
253 QMutexLocker locker(&m_mutex); |
254 |
254 |
255 if (thread() == QThread::currentThread()) { |
255 if (thread() == QThread::currentThread()) { |
256 qint64 bytesRead = 0; |
256 qint64 bytesRead = 0; |