USB transfer sizes 限制

用Bulk传输VBI信息时,发现字幕经常出现拼写错误的问题,查了一下,原来是bulk pipe 的transfer sizes设置错误,超出了大小限制。

USB transfer sizes有如下限制:
在Windows 2000, Windows XP and Windows 2003 Server中,Transfer Sizes 的最大值:
控制管道: 
4,000 bytes
块、中断管道:
256,000 bytes
同步管道:
全速设备:256帧, 高速设备:1024 帧
驱动可以设置USBD_PIPE_INFORMATION结构的成员变量MaximumTransferSize,但是一定要小于Transfer Sizes 的最大值。

DDK参考: MaximumTransferSize
Specifies the maximum size, in bytes, for a transfer request on this pipe. In Windows Server 2003, Windows XP and later operating systems, this member is not used and does not contain valid data.
The following table lists the maximum transfer sizes for each type of pipe for the major versions of Windows:

 

 

Version of WindowsType of PipeMaximum Transfer Size
Windows 2000Control pipe endpoint 04 kilobytes
 Control pipe64 kilobytes
 Interrupt or bulk pipeTheoretically unlimited
Windows XPControl pipe endpoint 04 kilobytes
 Control pipe64 kilobytes
 Interrupt pipeTheoretically unlimited
 Bulk pipe256 kilobytes
Windows VistaControl pipe endpoint 04 kilobytes
 Control pipe64 kilobytes
 Interrupt or bulk pipeUnlimited transfers.

具体来说: 

VOID 
  UsbBuildInterruptOrBulkTransferRequest(
    IN OUT PURB  Urb,
    IN USHORT  Length,
    IN USBD_PIPE_HANDLE  PipeHandle,
    IN PVOID  TransferBuffer  OPTIONAL,
    IN PMDL  TransferBufferMDL  OPTIONAL,
    IN ULONG  TransferBufferLength, ----注意要小于上面提到的限制
    IN ULONG  TransferFlags,
    IN PURB  Link
    );

 在Bulk传输VBI信息时:
TransferBufferLength 越小,字幕显示越实时,越大则显示越延迟。但是TransferBufferLength 过于小的话,会增加I/O操作,增加系统负担;TransferBufferLength 大于256000时,部分VBI数据会丢失,因此字幕会不正确
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值