Changeset 368 for dsfilters/demux_mpc/src/mpc_pin.cpp
- Timestamp:
- 12/14/07 00:22:01 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
dsfilters/demux_mpc/src/mpc_pin.cpp
r366 r368 131 131 ev_can_write.Set(); 132 132 ev_abort.Reset(); 133 134 // up to 5 seconds 135 buffer_time_ms = 5000; 133 136 } 134 137 … … 141 144 { 142 145 CheckPointer(ppv, E_POINTER); 143 /*144 146 if (riid == IID_IMediaSeeking) { 145 147 return GetInterface((IMediaSeeking*)this, ppv); 146 148 } else { 147 */148 149 return CBaseOutputPin::NonDelegatingQueryInterface(riid, ppv); 149 //}150 } 150 151 } 151 152 … … 292 293 } 293 294 294 /*295 295 // IMediaSeeking 296 296 STDMETHODIMP CMPCOutputPin::GetCapabilities(DWORD* pCapabilities) { return demux->GetCapabilities(pCapabilities); } … … 315 315 STDMETHODIMP CMPCOutputPin::SetPositions(LONGLONG* pCurrent, DWORD dwCurrentFlags, LONGLONG* pStop, DWORD dwStopFlags) 316 316 { 317 return demux->SetPositionsInternal(stream_index, pCurrent, dwCurrentFlags, pStop, dwStopFlags); 318 } 319 */ 317 return demux->SetPositionsInternal(0, pCurrent, dwCurrentFlags, pStop, dwStopFlags); 318 } 320 319 321 320 int CMPCOutputPin::GetDataPacket(DataPacket **packet) … … 342 341 } 343 342 344 /* 345 // dorucenie packetu 346 HRESULT CMPCOutputPin::DeliverPacket(MP4::Packet &packet) 343 HRESULT CMPCOutputPin::DeliverPacket(CMPCPacket &packet) 347 344 { 348 345 // ziskame novy packet na vystup … … 356 353 357 354 // spocitame casy 358 outp->rtStart = (packet.pts_100mhz / 10) - rtStart;359 outp->rtStop = outp->rtStart + 1;355 outp->rtStart = packet.tStart; 356 outp->rtStop = packet.tStop; 360 357 361 outp->size = packet. size;358 outp->size = packet.packet_size; 362 359 outp->buf = (BYTE*)malloc(outp->size); 363 memcpy(outp->buf, packet.data, packet.size); 364 365 // sync point ? 366 if (packet.flags & PACKET_FLAG_KEYFRAME) { 367 outp->sync_point = TRUE; 368 } else { 369 outp->sync_point = FALSE; 370 } 360 memcpy(outp->buf, packet.packet, packet.packet_size); 361 362 // each packet is sync point 363 outp->sync_point = TRUE; 371 364 372 365 // discontinuity ? … … 379 372 380 373 { 381 // strcime do queue382 MonoBase::AutoLock lck(&lock_queue);374 // insert into queue 375 CAutoLock lck(&lock_queue); 383 376 queue.AddTail(outp); 384 377 ev_can_read.Set(); 385 378 386 // zakazeme dalsie bufferovanie 387 // toto mozeme robit iba pre seekovaci pin 388 if (stream_index == demux->buf_index) { 389 if (GetBufferTime_MS() >= buffer_time_ms) { 390 ev_can_write.Reset(); 391 } 379 // we allow buffering for a few seconds (might be usefull for network playback) 380 if (GetBufferTime_MS() >= buffer_time_ms) { 381 ev_can_write.Reset(); 392 382 } 393 383 } … … 395 385 return NOERROR; 396 386 } 397 */398 387 399 388 HRESULT CMPCOutputPin::DoEndOfStream() … … 441 430 442 431 // we should have enough space in there 443 ASSERT(sample->GetSize() >= packet.size); 432 long lsize = sample->GetSize(); 433 ASSERT(lsize >= packet.size); 444 434 445 435 BYTE *buf;
Note: See TracChangeset
for help on using the changeset viewer.