I’m trying to develop a AVStream driver for an Analog/Digital TV USB device.
When Video Capture Pin’s state changes into KSSTATE_RUN, it will start the
stream’s iso transfer. First, in the stream iso transfer, it will submit two
irp/urb. In the complete routine of an IRP, the routine will resubmits the
urb. The data process will be done in complete routine (copy the stream data
to the pin’s queue). I copy two fields data to one frame buffer in the data
processing. Then advance the leading pointer. After some time delay, the
code will go to the capture pin’s process again, and then point the new
frame’s buffer.
After copying two fields data to one frame buffer, there are some data
behind that belong to the next frame have not been processed. How to deal
with these data?
we pass a IRP with a urb that include a buffer’s address to the USBD. The
buffer’s size just as the size of one field, so when the usb thansfer the
field data to the buffer, whether we can just get a field that the field’s
header mapping at the buffer’ s header. That means whether we can get a
complete field data when in one urb request. We don’t promise more or less
data than a field data.
If we can not get a complete field data, it means that we may get two fields
data
in a field data buffer.
So I don’t know how to deal with the data is this condition?
Re: [ntdev] How to control the TS output rate in BDA?
weilufei wrote:
Thanks Tim,
But as I know that the TS has not an information about frame rate, the
TS frame rate just depend on the physical device output rate.
That’s not right. A transport stream contains elementary streams, and
the header of an elementary stream tells you the frame rate. Each frame
then has an ordinal that tells where it is in the time stream… It’s
part of the MPEG standards.
You just ship the transport stream packets into the filter graph without
timestamps. The MPEG demux will extract the frames from the elementary
streams, and assign timestamps based on the header information. A
transport stream provider is just sending a stream, not a series of
timed frames.
We are developing an usb dongle product and we select bulk endpoint
for transport. If set AvgTimePerFrame zero, how to control the data
input rate?
Are you saying your external device has an adjustable frame rate? Client
apps will tell you the frame rate they want in the AvgTimePerFrame
field, and you can certainly use that value to configure your device.
Many MPEG hardware vendors simply implement their own private API for
setting this, since it is something that is rare changed.
And how to make sure that all TS data from device has been captured?
I don’t understand the question. A transport stream is a continuous
stream; it never stops. When the graph asks you to stop, you’ll stop
reading. Any partial packets in the graph at that point will be discarded.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer