Re: AVStream: DMA & Process() QUEUEing
From: WDD (anonymous_at_microsoft.com)
Date: 05/26/04
- Previous message: JaffaLink: "Re: Developing NDIS driver for XP, starting help"
- In reply to: Max Paklin: "Re: AVStream: DMA & Process() QUEUEing"
- Next in thread: Max Paklin: "Re: AVStream: DMA & Process() QUEUEing"
- Reply: Max Paklin: "Re: AVStream: DMA & Process() QUEUEing"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 26 May 2004 16:48:24 -0400
Max Paklin wrote:
> It hurts your brain does it? They (MS) should've found a simple way to
> describe what they do.
> All those queues. In some cases I wish they gave me a way to NOT use their
> queueing at all. Otherwise what I end up doing is creating my own queue
> anyway (I need it!) and doing a lot of dancing around KS queue, which does
> not good but annoys me.
>
> This is how I understand KS queueing mechanism.
> KS has a queue per pin. The queue can be in two states - empty or not empty.
>
> You can tell KS to call your Process() dispatch entry point
>
> 1. when a frame is about to be queued and the queue is empty (default
> behavior)
ie.
KSPIN_FLAG_GENERATE_MAPPINGS |
KSPIN_FLAG_PROCESS_IN_RUN_STATE_ONLY,
but my code executes as follows,
CALL-1
========================================================
+++ CPin::My_AVStrMiniPinProcess
+++ CDevice::SetupDMA
DMAInProgress -> TRUE
--- CDevice::SetupDMA
--- CPin::My_AVStrMiniPinProcess
========================================================
CALL-2
========================================================
+++ CPin::My_AVStrMiniPinProcess
IsDMAPending() = TRUE
--- CPin::My_AVStrMiniPinProcess
========================================================
========================================================
+++ CDevice::InterruptService
--- CDevice::InterruptService
========================================================
========================================================
+++ CDevice::DpcForIsr
+++ CPin::CompleteDma
--- CPin::CompleteDma
DMAInProgress -> FALSE
--- CDevice::DpcForIsr
========================================================
Since my DMA is not complete and I have a clone on the frame sent in the
previous call, wouldn't the QUEUE be "FULL" as opposed to "EMPTY"?
If so WHY am I being called with a second Process().
> 2. when a frame is about to be queued and the queue in NOT empty
> (KSPIN_FLAG_INITIATE_PROCESSING_ON_EVERY_ARRIVAL)
ie.
KSPIN_FLAG_GENERATE_MAPPINGS |
KSPIN_FLAG_PROCESS_IN_RUN_STATE_ONLY |
KSPIN_FLAG_INITIATE_PROCESSING_ON_EVERY_ARRIVAL,
But Code executes same as above,
> 3. never _automatically_ call your Process().
> This is a special case when you don't want to see any processing unless you
> specifically ask for it by calling KsPinAttemptProcessing(). Then - and only
> then - your Process() will be called.
> Use KSPIN_FLAG_DO_NOT_INITIATE_PROCESSING for that.
>
> -- Max.
>
>
>
> "WDD" <anonymous@microsoft.com> wrote in message
> news:u0qP%23c1QEHA.2876@TK2MSFTNGP09.phx.gbl...
>
>>"Without specifying this flag of KSPIN_FLAG_DO_NOT_INITIATE_PROCESSING,
>>the process dispatch is only called when data arrives into a previously
>>empty queue."
>>
>>
>>Does this not mean???
>>
>>If you do NOT specify the flag
>>KSPIN_FLAG_DO_NOT_INITIATE_PROCESSING,(which I do NOT) the process
>>dispatch is only called when data arrives into a previously empty queue.
>>
>>
>>
>>
>>Max Paklin wrote:
>>
>>>>What I was getting at was that the Flag
>>>>(KSPIN_FLAG_INITIATE_PROCESSING_ON_EVERY_ARRIVAL) states that the
>>>>process dispatch is only called when data arrives into a previously
>>>>empty queue.
>>>
>>>
>>>Which DDK are you reading?
>>>Mine says
>>>"Indicates that processing should occur every time a data frame arrives
>
> into
>
>>>the queue. Without specifying this flag of
>>>KSPIN_FLAG_DO_NOT_INITIATE_PROCESSING, the process dispatch is only
>
> called
>
>>>when data arrives into a previously empty queue."
>>>
>>>When you specify KSPIN_FLAG_INITIATE_PROCESSING_ON_EVERY_ARRIVAL
>
> processing
>
>>>takes places every time a frame is queued.
>>>
>>>
>>>
>>>
>>>
>>>>How can the QUEUE be empty when I have cloned stream pointers on a
>
> Frames?
>
>>>>Cloning increases the reference count of the Frame thus not allowing the
>>>>frame to be cancelled, thus ensuring that the QUEUE is not empty.
>>>
>>>
>>>It is NOT empty.
>>>You misinterpreted KSPIN_FLAG_INITIATE_PROCESSING_ON_EVERY_ARRIVAL flag.
>>>To get what you want you have to __NOT__ specify
>>>KSPIN_FLAG_INITIATE_PROCESSING_ON_EVERY_ARRIVAL and __NOT__ specify
>>>KSPIN_FLAG_DO_NOT_INITIATE_PROCESSING on your pin.
>>>
>>>
>>>
>>>
>>>
>>>>Put in what you mentioned to return STATUS_PENDING but just wondering
>>>>why I get the second call to Process().
>>>
>>>
>>>Because you asked for it. You get notified each time a frame is inserted
>
> in
>
>>>the queue.
>>>
>>>-- Max.
>>>
>>>
>
>
>
- Previous message: JaffaLink: "Re: Developing NDIS driver for XP, starting help"
- In reply to: Max Paklin: "Re: AVStream: DMA & Process() QUEUEing"
- Next in thread: Max Paklin: "Re: AVStream: DMA & Process() QUEUEing"
- Reply: Max Paklin: "Re: AVStream: DMA & Process() QUEUEing"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|