2009年8月25日 星期二

USB Video Class study

Rec. 601 luma versus Rec. 709 luma coefficients

For digital formats following CCIR 601 (i.e. most digital standard definition formats), luma is calculated with the formula Y' = 0.299 R' + 0.587 G' + 0.114 B'. Formats following ITU-R Recommendation BT. 709 use the formula Y' = 0.2126 R' + 0.7152 G' + 0.0722 B'. Modern HDTV systems use the 709 coefficients, while transitional 1035i HDTV formats may use the SMPTE 240M coefficients (Y' = 0.212 R' + 0.701 G' + 0.087 B'). These coefficients correspond to the SMPTE RP 145 primaries (also known as "SMPTE C") in use at the time the standard was created.


Table in USB Video FAQ

Table 2-6 Matrix of Color Standards and Scenarios
Color Primary
Transfer Function
Luma Matrix
Example Scenario
709
709
709
DVB HDTV Standard Rec.
709
709
601
Typical webcam
240
709
601
NTSC tuner/video capture device
709
709
601
PAL tuner/video capture device
709
240
240
HDTV(1035/60)
170
170
170
DVB 30Hz SDTV
470
*
*
DVD’s
240
470(M)
601
NTSC SDTV
Revision 1.1 June 1, 2005 27
USB Device Class Definition for Video Devices - FAQ
709
470(B,G)
601
PAL SDTV
709
709
709
ATSC (1920/60)
Question:

USB Driver Study

USBDeviceAttach USBInstallDriver USBUnInstallDriver

先说USBInstallDriver,这个函数在驱动程序DLL被加载的时候会被调用,但是不是任何情况下加载驱动都会调用这个函数入口,前面提到过USB驱动的注册表键值,当系统能够根据注册表定位到驱动程序dll并且成功加载的话,这个函数就不会被调用了。反之,当不能够找到匹配的驱动或者不能够成功加载驱动的时候,系统会弹出一个对话框,让用户输入一个驱动程序名称,这个时候,系统就会加载用户输入的这个驱动程序文件,并调用其中的 USBInstallDriver函数了。USBUnInstallDriver函数呢,我很迷惑,《WindowCE驱动开发指南》有一句话说 WinCE永远不会调用它,我也不明白,但是就我测试的结果来看,确实没发现这个函数被调用过。
USBInstallDriver函数里面作什么的呢?说白了,就是写注册表,让系统下次能够通过注册表信息匹配到这个驱动程序文件。其他文章都说了,怎么写注册表,就是用USBD.dll中的RegisterClientDriverID和RegisterClientSettings两个函数,少不了 LoadLibrary,GetProcAddress,FreeLibrary。网上看到过一个问题,问驱动程序不是被USBD进程加载的么?为什么不能直接用这个两个函数,还要LoadLibrary和GetProcAddress来调用这些函数呢?我不知道怎么去解答这个问题,只觉得即使在一个进程里面,似乎不这样你也得不到这两个函数的地址吧。至于到处都说USBInstallDriver里面不要用Reg的API函数去操作注册表,却没有个所以然,这个应该是因为这些注册表主键可能会根据操作系统的变更而变更的,而不论你是哪个操作系统,RegisterClientDriverID和RegisterClientSettings都会找到对应的正确的注册表主键去添加值,所以建议不要用regAPI来操作,换句话说你用了RegAPI去操作注册表,写入信息,也不会有什么问题,除非你的 wince系统中那些驱动信息不应该写在那几个主键下了。


本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/Riklin/archive/2008/11/27/3393100.aspx


Installing, Attaching, and Detaching USB Drivers

The HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients key must be set up correctly so that the USB driver module can load the appropriate driver for a device when a device is attached to the bus. Each installed USB device driver must have a subkey within the LoadClients key for the USB driver module to load it.

If you supply a USB device driver, you should configure the hardware platform's LoadClients key in the registry to include subkeys for the driver. For third-party peripherals, the driver does not have appropriate subkeys when it is first connected to the hardware platform. In this case, the USB driver module fails to locate an appropriate USB device driver when the peripheral is attached to the bus. The USB driver module instead displays a dialog box prompting a user to enter the name of the appropriate USB device driver DLL. The USB driver then loads the specified driver to control the peripheral and calls the driver's USBInstallDriver function.

The USB device driver's USBInstallDriver function sets up the driver's subkey correctly within the LoadClients key so that the USB driver module can load the driver the next time that the peripheral is attached to the bus.



2009年8月20日 星期四

iPhone 3G S vs HTC Hero

只列出差異

1. 電池可換性

iPhone -- No Hero -- Yes

2. 耳機插孔

iPhone -- No Hero -- Yes

3. 電源線

iPhone -- Hero -- 標準 micro USB

4. 支援 Flash

iPhone -- Hero -- Yes

5. 造型



6. AP


7. 流暢度, CPU Power
iPhone 3G S > HTC Hero

8. micro SDHC

iPhone -- No HTC Hero -- Yes

9. Multitasking


10. Camera Sensor

3 M pixel vs 5M pixel

2009年8月18日 星期二

Network Problem & NDIS

NDIS 相關心得

Smsc9211 NDIS miniport driver

CheckForHangHandler 每2秒call 一次
拔線或插線是 用 NdisMIndicateStatus
Network Utilities 中 ethman 是小tray icon 顯示狀態
它用 WSAIoctl, SIO_ADDRESS_LIST_CHANGE


connmc
lanconninfo.cpp

IOCTL_NDIS_REBIND_ADAPTER

AdapterIPProperties


2009年8月2日 星期日

Ping problem: transmit error code 11010

It may be IP_REQ_TIMED_OUT, not WSA_QOS_ADMISSION_FAILURE.

winerror.h:
#define WSA_QOS_ADMISSION_FAILURE 11010L

ipexport.h:
#define IP_STATUS_BASE 11000
#define IP_REQ_TIMED_OUT (IP_STATUS_BASE + 10)


Is DHCP enabled on the host machine?