Time wrote (Re: [ntdev] How to control the TS output rate in BDA?
2008-4-29)
If you have additional data after shipping off a frame, then just grab the
next >cloned pointer from the leading edge and start copying. In virtually
every case, >you will have at least 2 or 3 empty buffers waiting to be
filled. If you find >that there are no more buffers, then it seems you have
little choice other than >to drop the frame. Be sure to note the
discontinuity in the frame header.
I have asked the question that how to copy the data to the pin’s buffers
some days ago. You told me to do like that. So I asked the question how to
queue
up the buffers as the europa example done in last week. But I still don’t
know
what’s the time and how to queue up the buffer? If I can not queue up the
buffers at the start time, then the process will rolling. So when I want to
get the next
clone pointer, it maybe not exist.
For example :
I specify 5 buffers of the queue. After the program returns from the
SetState, the process maybe only be called 2 times, and only two buffers be
queued up(This will always possible). At this time, I will to copy the data
to the buffers(3 buffers I need in one time). I can’t get the third clone
pointer!
How should I to do?
weilufei wrote:
I have asked the question that how to copy the data to the pin’s buffers
some days ago. You told me to do like that. So I asked the question how to
queue up the buffers as the europa example done in last week. But I still don’t
know what’s the time and how to queue up the buffer? If I can not queue up the
buffers at the start time, then the process will rolling. So when I want to
get the next clone pointer, it maybe not exist.
For example :
I specify 5 buffers of the queue. After the program returns from the
SetState, the process maybe only be called 2 times, and only two buffers be
queued up(This will always possible). At this time, I will to copy the data
to the buffers(3 buffers I need in one time). I can’t get the third clone
pointer!
You aren’t getting three frames at once from USB. Why do you think you
need to copy data to three buffers?
Typically, each completed USB request gets one frame, or part of one
frame. You copy the data, and if the frame is complete, you delete the
clone, sending the frame on. The next time you need to copy data,
you’ll need a new clone.
Assuming everything is healthy, by the time you need that new clone, the
graph will have finished with a buffer and sent the empty back to your
Process handler. Your processing will just continue like that,
asynchronously. You have one process filling and sending filled clones,
and you have another process receiving empty clones.
If you should happen to get to a point where you have new data and there
is no clone available, then you have to throw away the new data. You
drop the frame. There is no other choice. This is an abnormal
situation; it might mean that your CPU isn’t powerful enough to keep up
with the frames.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.