-
公开(公告)号:US06496873B1
公开(公告)日:2002-12-17
申请号:US09316760
申请日:1999-05-21
IPC分类号: G06F954
CPC分类号: G06F3/16
摘要: A method and apparatus for interfacing a device driver in real time applications are provided. On input, the device driver is probed to determine a data sample block size supported by the device driver. The device driver delivers data samples to a buffer at each interrupt. The buffer is accessed to determine the presence of data in at least one buffer entry, or block. At each such access, a first counter is incremented to point to a next buffer entry to be accessed. One or more buffer entries are filled at each interrupt, with any data samples not sufficient to fill an entry held by the device driver until a subsequent interrupt. A second counter is incremented by the number of entries filled by the device driver. The size of each block in the buffer is incremented until the number of data samples held by the device driver between each interrupt corresponds to the size of the block, wherein each of the first and second counters increment by one, on each access to the buffer. On output, a display cursor is synchronized with an audio signal being played by storing, in a buffer, a frame number associated with each block of data samples sent to the device driver. A head pointer tracks each entry in the buffer as the frame number is stored. As each corresponding frame is played a tail pointer is incremented to point to the buffer entry containing the frame number of a next set of data samples to be played. If the position of the display cursor corresponds to a frame earlier than the position of the last frame output by the device driver, the position of the cursor is repeatedly updated until the cursor position coincides with the position of the last frame output by the device driver.
摘要翻译: 提供了一种用于在实时应用中连接设备驱动程序的方法和装置。 在输入时,将探测设备驱动程序以确定设备驱动程序支持的数据样本块大小。 每个中断时,设备驱动程序将数据采样传送到缓冲区。 访问缓冲区以确定至少一个缓冲区条目或块中是否存在数据。 在每个这样的访问中,第一个计数器递增,以指向要被访问的下一个缓冲器条目。 每个中断都会填充一个或多个缓冲区条目,任何数据样本都不足以填充设备驱动程序持续的条目,直到后续中断。 第二个计数器由设备驱动程序填充的条目数增加。 缓冲器中的每个块的大小增加,直到由每个中断之间的设备驱动器保持的数据样本的数量对应于块的大小,其中第一和第二计数器中的每一个在每次访问缓冲器时增加1 。 在输出时,通过在缓冲器中存储与发送到设备驱动器的每个数据样本块相关联的帧号,将显示光标与正在播放的音频信号同步。 当存储帧号时,头指针跟踪缓冲区中的每个条目。 当每个对应的帧被播放时,尾部指针被递增以指向包含要播放的下一组数据样本的帧号的缓冲器条目。 如果显示光标的位置对应于比设备驱动器输出的最后帧的位置更早的帧,则光标的位置被重复地更新,直到光标位置与由设备驱动器输出的最后一帧的位置重合为止 。