151{
155
156
158
159 if (*SampleCount == 0 || *SampleCount < 0)
161
162
163 *OutStreamSegment =
NULL;
164
165
167 if (!StreamSegment)
169
170
172
173
175
177 {
178
181 }
182
183
185
186
187 StreamSegment->
StreamSegment.KsDataTypeHandler = KsDataTypeHandler;
188 StreamSegment->
StreamSegment.KsInterfaceHandler = (IKsInterfaceHandler*)
this;
191
192
193
194 ExtendedSize = 0;
195 if (KsDataTypeHandler)
196 {
197
198 KsDataTypeHandler->KsQueryExtendedSize(&ExtendedSize);
199
200 if (ExtendedSize)
201 {
202
203 KsDataTypeHandler->AddRef();
204 }
205 else
206 {
207
209 }
210 }
211
214
215
217
218
221 {
222
224
227
228
230
231
234 }
235
236
238
240
241
243 {
244 if (ExtendedSize)
245 {
246
247 hr = KsDataTypeHandler->KsPrepareIoOperation(SampleList[
Index], (CurStreamHeader + 1), IoOperation);
248
250 }
251
252
256
259 {
260
261
263
264
266 }
267 else
268 {
269
272 hr = SampleList[
Index]->
GetTime(&Properties.tStart, &Properties.tStop);
273
275 assert(Properties.cbBuffer);
276
277 Properties.dwSampleFlags = 0;
278
279 if (SampleList[
Index]->IsDiscontinuity() ==
S_OK)
281
282 if (SampleList[
Index]->IsPreroll() ==
S_OK)
284
285 if (SampleList[
Index]->IsSyncPoint() ==
S_OK)
287 }
288#ifdef KSPROXY_TRACE
290 swprintf(
Buffer,
L"CKsInterfaceHandler::KsProcessMediaSamples PinName %s BufferLength %lu Property Buffer %p ExtendedSize %u lActual %u dwSampleFlags %lx\n",
m_PinName, Properties.cbBuffer, Properties.pbBuffer, ExtendedSize, Properties.lActual, Properties.dwSampleFlags);
292#endif
293
297 CurStreamHeader->
FrameExtent = Properties.cbBuffer;
298 CurStreamHeader->
Data = Properties.pbBuffer;
299
300 if (IoOperation == KsIoOperation_Write)
301 {
302
303 CurStreamHeader->
OptionsFlags = Properties.dwSampleFlags;
304 CurStreamHeader->
DataUsed = Properties.lActual;
305
307 }
308
309
311
312
314 }
315
316
317 m_Pin->KsIncrementPendingIoCount();
318
323 StreamHeaderSize,
326 {
327
330 *OutStreamSegment = (PKSSTREAM_SEGMENT)StreamSegment;
331 }
332 else
333 {
335 {
336 *OutStreamSegment = (PKSSTREAM_SEGMENT)StreamSegment;
338 }
339 }
341}
@ AM_SAMPLE_DATADISCONTINUITY
BOOL WINAPI DeviceIoControl(IN HANDLE hDevice, IN DWORD dwIoControlCode, IN LPVOID lpInBuffer OPTIONAL, IN DWORD nInBufferSize OPTIONAL, OUT LPVOID lpOutBuffer OPTIONAL, IN DWORD nOutBufferSize OPTIONAL, OUT LPDWORD lpBytesReturned OPTIONAL, IN LPOVERLAPPED lpOverlapped OPTIONAL)
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
#define IOCTL_KS_READ_STREAM
#define IOCTL_KS_WRITE_STREAM
static ULONG WINAPI AddRef(IStream *iface)
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)