PCI-MPG24 4-CH MPEG4 Hardware Video Compression Card User’s Manual Manual Rev. 2.01 Revision Date: March 21, 2005 Part No: 50-15035-100 Advance Technologies; Automate the World.
Copyright 2005 ADLINK TECHNOLOGY INC. All Rights Reserved. The information in this document is subject to change without prior notice in order to improve reliability, design, and function and does not represent a commitment on the part of the manufacturer. In no event will the manufacturer be liable for direct, indirect, special, incidental, or consequential damages arising out of the use or inability to use the product or documentation, even if advised of the possibility of such damages.
Getting Service from ADLINK Customer Satisfaction is top priority for ADLINK Technology Inc. Please contact us should you require any service or assistance. ADLINK TECHNOLOGY INC. Web Site: http://www.adlinktech.com Sales & Service: Service@adlinktech.com TEL: +886-2-82265877 FAX: +886-2-82265717 Address: 9F, No. 166, Jian Yi Road, Chungho City, Taipei, 235 Taiwan Please email or FAX this completed service form for prompt and satisfactory service.
Table of Contents 1 Introduction ........................................................................ 1 1.1 1.2 1.3 1.4 Features............................................................................... 1 Real-time MPEG4 Hardware Video Encoding ................ 1 Adjustable Video Quality ................................................. 2 Real-time Raw Data Preview .......................................... 2 Video Decoding ..............................................................
5 Programming Guide ......................................................... 41 5.1 5.2 5.3 5.4 DirectShow Application Programming Introduction........... 41 Descriptions of Filters ........................................................ 42 Source Filter ................................................................. 42 Video Renderer Filter .................................................... 44 MPEG4 AVI Mux Filter .................................................. 45 MPEG4 File Writer ............
Know Limitations ......................................................... 139 OSD Data Structure .................................................... 141 Appendix A: Glossary ...................................................... 133 Brightness: .................................................................. 133 CCIR: .......................................................................... 133 Composite Video: ....................................................... 133 CIF: ...........................
List of Tables Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table iv 1-1: 1-2: 1-3: 1-4: 1-5: 1-6: 1-7: 1-8: 1-9: 2-1: 2-2: 2-3: 2-4: 2-5: 2-6: 5-1: 5-2: 5-3: 5-4: 5-5: 5-6: 6-1: 6-2: 6-3: 6-4: 6-5: 6-6: 6-7: 6-8: 6-9: 6-10: 6-11: Number of Frames .................................................... 1 Configuration 1 – NTSC, CIF (320 x 240) .................
List of Figures Figure 1-1: Figure 1-2: Figure 1-3: Figure 2-1: Figure 2-2: Figure 2-3: Figure 2-4: Figure 2-5: Figure 4-1: Figure 5-1: List of Figures Real-time Raw Data Preview - single channel .......... 2 Real-time Raw Data Preview - four channels........... 3 AVI video file format .................................................. 4 PCI-MPG24 ............................................................. 19 Watchdog reset cable.............................................. 19 BNG Interface cable .....
1 Introduction The PCI-MPG24 is a MPEG4 hardware video compression card that provides four channels of real-time full D1 size MEGP4 video encoding and decoding with a preview function for digital video surveillance applications. This 32-bit, 33MHz PCI bus frame grabber simultaneously captures and encodes four video analog streams in real time. It accepts standard composite color (PAL, NTSC) or monochrome video formats (CCIR, EIA) cameras inputs. Each PCI-MPG24 card has a unique hardware ID number.
Adjustable Video Quality Bit and frame rates are adjustable to fit variable bandwidths, as seen in remote Internet applications. I, IP, IBP, and IBBP GOP structures are programmable for enhanced video quality. Real-time Raw Data Preview X Single channel: real-time preview and display by VGA resolution. Figure 1-1: Real-time Raw Data Preview - single channel X 2 Four channels: real-time preview and display by quad format simultaneously.
Figure 1-2: Real-time Raw Data Preview - four channels Video Decoding Smart software video decoding for playback or remote client monitoring and NO need to plug-in PCI-MPG24 card. Save File The video can be saved to AVI video file format. Users can playback AVI file by Microsoft Media Player.
Figure 1-3: AVI video file format I/O Lines The PCI-MPG24 is fitted with TTL compatible I/O lines protected against overloads and electrostatic discharges. Each line may be configured as an input or output. They can be used to trigger acquisition or report alarm signals. Watchdog Timer A hardware watchdog is available on the PCI-MPG24 that is able to monitor PC application operation and will automatically reset the PC after a programmable inactivity time-out.
Supported software X Support Microsoft DirectX X Support Visual Studio .net, VC++, and C++ Builder programming language X Support Windows 2000 and Windows XP. X Sample programs X ‘ViewCreator for DirectX’ utility for assistance in the initial test and functional evaluation. 1.
requests of more than two channels, full D1 size real-time decode to specifications below: Z X Pentium 4, 2.4GHz CPU, 256MB DDR RAM above. Please refer to 1.4 PCI-MPG24 Benchmark for performance limitations. 1.
Configuration 1 – NTSC, CIF (320 x 240), 30 sec.
Configuration 2 – NTSC, Full (640 x 480), 30 sec.
Configuration 3 – PAL, CIF (352 x 288), 30 sec.
Configuration 4 – PAL, Full (768 x 576), 30 sec.
PCI-X Platform X SBC: ADLINK NuPRO850 X CPU: Intel Pentium 4, 3.
Configuration 1 – NTSC, CIF (320 x 240), 30 sec.
Configuration 2 – NTSC, Full (640 x 480), 30 sec.
Configuration 3 – PAL, CIF (352 x 288), 30 sec.
Configuration 4 – PAL, Full (768 x 576), 30 sec.
16 Introduction
2 Hardware Reference 2.1 PCI-MPG24 Specification Video Input X Four composite video color digitizers. X Video input interface: DB15 pin female connector X Support PAL/NTSC/CCIR/EIA standard cameras.
Watch Dog Timer X For monitoring the PC’s application operation and will reset the PC after a programmable inactivity time-out. X Interface: 2-pin header User EEPROM X Support 1K bit EEPROM for user defined purposes Form Factor X 32bit/ 33MHz PCI bus half size board. Power Consumption 18 X 3.3V @ 2.8A max X 5V @ 0.8A max X +12V @ 0.1A max X -12V @ 0.
PCI-MPG24 Appearance Figure 2-1: PCI-MPG24 PCI-MPG24 Standard accessories Figure 2-2: Watchdog reset cable Hardware Reference 19
Figure 2-3: BNG Interface cable Figure 2-4: All in One CD 20 Hardware Reference
PCI-MPG24 Interface Figure 2-5: Outline Drawing Connectors & Pin Definitions Video Inputs: CN3 Pin Type Function Pin Type Function 1 IN Video Port 0 9 -- GND 2 IN Video Port 1 10 -- GND 3 IN Video Port 2 11 -- GND 4 IN Video Port 3 12 -- GND 5 -- -- 13 -- GND 6 -- -- 14 -- -- 7 -- -- 15 -- -- 8 -- -- Table 2-2: Video Inputs - CN3 Hardware Reference 21
GPIO: CN2 Pin Type Function 1 IN GPIO IN 1 2 IN GPIO IN 2 3 IN GPIO IN 3 4 IN GPIO IN 4 5 G GND 6 OUT GPIO OUT 1 7 OUT GPIO OUT 2 8 OUT GPIO OUT 3 9 OUT GPIO OUT 4 10 G GND 11 G GND 12 G GND 13 G GND 14 G GND 15 P +5V power output Table 2-3: GPIO - CN2 Watchdog Timer Reset 1 2 JP Pin Function 1 System reset 2 GND Table 2-4: Watchdog Timer Reset 22 Hardware Reference
DIP switch & Setting S1: Card ID setting & NTSC/PAL mode setting S1 Pin Function ON OFF (Default) 1 Card ID BIT 0 1 0 2 Card ID BIT 1 1 0 3 Card ID BIT 2 1 0 4 NTSC / PAL PAL NTSC Table 2-5: S1 Card ID setting & NTSC/PAL mode setting Maximum support for 8 PCI-MPG24 cards in a single system Card ID S1 Pin3 S1 Pin2 S1 Pin1 0 OFF OFF OFF 1 OFF OFF ON 2 OFF ON OFF 3 OFF ON ON 4 ON OFF OFF 5 ON OFF ON 6 ON ON OFF 7 ON ON ON Table 2-6: Pin setting for 8 PCI
24 Hardware Reference
3 Installation Guide 3.1 Software Driver Installation Software Environment 1. Operating Systems Supported X Windows 2000 Professional with SP4 X Windows XP Professional with SP2 2. Other necessary software packages X Microsoft DirectX 9.0 Note: X Install DirectX SDK before installing the PCIMPG24 driver onto your system X Do not plug the hardware before installing the software driver Driver Installation 1. Double click SETUP.exe in the PCI-MPG24 setup disk. The driver will begin installing.
2. Click Next until the driver is installed completely.
3. Click Finish to restart the system.
4. After restarting the system, power off the system and insert the PCI-MPG24 card into your system. Power on the computer. 5. Windows should detect the new card and start Found New Hardware wizard. Click Next to start installation.
6. At the Install Hardware Device Drivers dialog box, select Search for a suitable driver for my device (recommended), click Next to continue.
7. In the Locate Driver Files dialog box, select Specify a location and click Next to continue.
8. At the next dialog box, select the location of the PCIMPG24 driver files and click OK to continue. The default installation folder for the PCI-MPG24 Driver is C:\Program Files\ADLINK\PCI-MPG24\ Driver. 9. At the Driver Files Search Results dialog box, click Next to continue. 10.In the Digital Signature Not Found dialog box, click Yes to continue.
11. Click Finish in the Found New Hardware Wizard.
12.For other types of new device, follow steps 2 to 11. 13.After installing all the devices, go to system control panel and select multimedia devices. There should be one ADLINK Bt878 DirectX Audio Capture, one ADLINK Bt878 DirectX Video Capture, four USB Audio Devices, four ADLINK Hardware MPEG4 Devices, and one NetMos PCI Serial Port as shown below.
3.2 Hardware Installation To install the PCI-MPG24 board onto the PCI bus: 1. Remove the computer cover using instructions from the computer manual. 2. Check that there is an empty PCI (32-bit) slot to accommodate the board. If there are no empty slots, remove a PCI board from the computer to make room for the PCIMPG24 board and note down the chosen slot number. 3. Remove the blank metal plate located at the back of the selected slot (if any).
4 ViewCreator Utility Once hardware installation is complete, ensure that they are configured correctly before running the ViewCreator utility. This chapter outlines how to establish a vision system and how to manually control PCI_MPG24 cards to verify correct operation. ViewCreator provides a simple yet powerful means to setup, configure, test, and debug the vision system.
4.2 Component Description Figure 4-1: Component Description Tree Browser The Tree Browser window lists the PCI-MPG24 cards and video ports available at the local computer. Image View The Image View window displays Full, CIF, and QCIF size images and image effects. Playback is displayed in an individual window. Toolbar The toolbar simplify user’s operation. Full functions can be found on the menu.
4.3 Operation Theory ViewCreator provides many functions for the PCI-MPG24 card as described below: Preview Single channel display Click on the video Port icon in the Tree Browser window. A video frame will appear in the Image View window. 2x2 channels (Quad mode) Click on the card icon in the Tree Browser window. All video ports in that card will appear in the Image View window. You also can click Single/Quad Image on the toolbar to toggle between single channel display and 2x2 channels display.
stream to a file. The path of the file can be set in the Set Recording command of menu Record. Configurations Record Execute the Record Filter command of menu Configuration to open a setting menu. Click OK or Apply to apply these settings. This command can only be used in the single channel display mode (select a video Port icon in the Tree Browser window). Preview Execute the Preview Filter command of menu Configuration to open a setting menu.
EEPROM Execute EEPROM command in the menu Tools to bring up the EEPROM dialog box. Enter the offset and output values, and then click the Write button to write the value into the EEPROM. Enter the offset value and click the Read button to read the value from the EEPROM. Valid offset values are between 0-127. Valid output values are in the range of 0 and 255. The value in the EEPROM will not be erased when the system is powered off.
40 ViewCreator Utility
5 Programming Guide 5.1 DirectShow Application Programming Introduction A complete documentation on DirectShow application programming can be found at http://msdn.microsoft.com/library/ default.asp?url=/library/en-us/directx9_c/directX/htm/introductiontodirectshow.asp. If a DirectX 9.0 is installed, this documentation is also available from DirectX SDK Help.
5.2 Descriptions of Filters This chapter lists filters needed to build a filter graph for capturing MPEG4 video stream and previewing video stream. Source Filter ADLink Bt878 Video Capture ADLink Bt878 Video Capture Filter belongs to the family of WDM Streaming Capture Devices. It is a kernel-mode KsProxy plug-in, where an application can treat it simply as a filter. Use the System Device Enumerator to add this filter to a filter graph.
MEDIATYPE_Video Subtypes: Video Preview Pin Supported Media Types Merit X MEDIASUBTYPE_YUY2 X MEDIASUBTYPE_YVU9 X MEDIASUBTYPE_UYVY X MEDIASUBTYPE_YV12 X MEDIASUBTYPE_I420 X MEDIASUBTYPE_Y41P X MEDIASUBTYPE_RGB24 X MEDIASUBTYPE_RBG32 X MEDIASUBTYPE_RBG565 X MEDIASUBTYPE_RBG555 MERIT_DO_NOT_USE Table 5-1: ADLink Bt878 Video Capture ADLINK Hardware MPEG4 Device ADLINK Hardware MPEG4 Device belongs to the family of WDM Streaming Capture Devices.
Video Preview Pin Supported Media Types DIVX_MPEG4, MICROSOFT_MPEG4, MPEG2, MPEG1, H.263, MJPG (For detailed definition of each media type, please refer to Reference Manual chapter 6.
MPEG4 AVI Mux Filter Filter Name AVI Mux Filter CLSID CLSID_AviDest Filter Category Name DirectShow Filters Filter Category CLSID CLSID_LegacyAmFilterCategory Any major type that corresponds to an old-style FOURCC, or MEDIATYPE_AUXLine21Data. Input Pin Media Types X If the major type is MEDIATYPE_Audio, the format must be FORMAT_WaveFormatEx. X If the major type is MEDIATYPE_Video, the format must be FORMAT_VideoInfo or FORMAT_DvInfo.
CrossBar Filter If the device is a capture board, a CrossBar filter is needed for switching video source. Filter Name ADLink Bt878 CrossBar Filter Category Name WDM_Streaming Crossbar Devices Table 5-6: CrossBar Filter 5.3 Example Graphs Microsoft DirectX SDK provides a very useful debugging utility GraphEdit, which can be used to simulate graph building. From the Graph menu of the GraphEdit application, click Insert Filters… and choose the filters required. Filters are organized by categories.
ADLink Bt878 Video Capture filter Video Decoder: Video Proc Amp: Programming Guide 47
ADLink Bt878 Crossbar filter Select video input before or during video previewing.
Video Proc Amp: Video Decoder Programming Guide 49
Preview Capture 50 Programming Guide
5.4 Controlling Driver Preview ADLINK Bt878 Video Capture The ADLINK Bt878 Video Capture Filter provides property pages and exposes COM interfaces to control video. Hence, an application has two ways to control video configurations: via property pages or via the COM interfaces. Use Property Pages There are two embedded property pages in the driver. To show these property pages, use Windows API: OleCreatePropertyFrame.
OleCreatePropertyFrame( NULL, // Parent window 0, // x (Reserved) 0, // y (Reserved) FilterInfo.achName, dialog box // Caption for the 1, // Number of filters (IUnknown **)&m_pFilter, // Pointer to the filter caGUID.cElems, pages // Number of property caGUID.pElems, page CLSIDs // Pointer to property 0, // Locale identifier 0, // Reserved NULL // Reserved ); CoTaskMemFree(caGUID.
Monitor Quad mode video 0: Video Composite In Monitor Single channel video 0: Video Decoder Out 1: Video Composite In ADLink Bt878 Crossbar 2: Video Composite In 1: Audio Decoder Out 3: Video Composite In Figure 5-1: ADLink Bt878 Crossbar For single video port selection please refer to the Bt878 GPIO pin definition in chapter 6.1. Capture ADLINK Hardware MPEG4 Device The ADLINK Hardware MPEG4 Device Filter provides property pages and exposes COM interfaces to control video.
Use COM interfaces It is standard practice to use the standard DirectShow interfaces defined for A/V capture filter and output pin to retrieve and set video configurations. However, due to a known issue in the ADLINK Hardware MPEG4 device driver, the programmer has to use a proprietary interface, IGOChip in addition to the standard interfaces. Details about the IGOChip interface and a sample code are provided in the Reference Manual.
6 Reference Manual 6.1 Preview GPIO Access The GPIO provides a method to read board information, select input channel, and control digital inputs/digital outputs.
rc.dwFromBit = bit; rc.dwToBit = bit; rc.dwValue = value; rc.
{ ZeroMemory(&rc,sizeof(rc)); rc.dwOperation = BT848_CUSTPROP_GPIO_GETGPDATABITS; rc.dwFromBit = bit; rc.dwToBit = bit; rc.dwOffset =0; hr = pKs->Get( PROPSETID_CUSTOMBT848,//idetificador del driver KSPROPERTY_CUSTOMBT848_GPIO, INSTANCE_DATA_OF_PROPERTY_PTR(&rc), INSTANCE_DATA_OF_PROPERTY_SIZE(rc), &rc,// variable a rellenar con los datos sizeof(rc), &ret); ReturnValue = rc.
Bt878 GPIO PIN Definition Pin Type GPIO0 Output Function -Set watchdog timer enable / disable Set “1” => disable (default), set ”0” => enable GPIO1 Output GPIO2 Output GPIO3 Output GPIO4 Input Card ID bit 0 (setting by dip switch) GPIO5 Input Card ID bit 1 (setting by dip switch) GPIO6 Input Card ID bit 2 (setting by dip switch) GPIO7 Input -- GPIO8 Input Port 1 DI Control the watch dog timer count down time GPIO9 Input Port 2 DI GPIO10 Input Port 3 DI GPIO11 Input Port 4
Channel 0 Channel 1 Channel 2 Channel 3 Quad Mode Table 6-2: Function Table EEPROM Access ADLink Bt878 Video Capture provides a method for accessing the I2C register. The interface can store a few data, for example, board identification.
if((hr=pFilter->QueryInterface(IID_IKsPropertySet, (void **)&pKs)) == S_OK) { hr = pKs>QuerySupported(PROPSETID_CUSTOMBT848,KSPROPERTY _CUSTOMBT848_I2C,&TypeSupport); if(TypeSupport & KSPROPERTY_SUPPORT_GET) { uAddress = 0xa0; ZeroMemory(&I2C,sizeof(I2C)); I2C.bDontWaitACK = true; I2C.dwOperation = BT848_CUSTPROP_I2C_SETFREQ; I2C.
sizeof(I2C), &ret); } pKs->Release(); } return I2C.
6.
For Microsoft DirectShow interfaces, follow the links for online reference. Alternatively, please visit http://msdn.microsoft.com/ library/ and from the left panel navigation, select Graphics and Multimedia -> DirectX -> SDK Documentation -> DirectX 9.0 (C++) -> DirectShow -> DirectShow Reference -> Interfaces for a complete list of Microsoft DirectShow filter interfaces references.
MPEG1 Major type MEDIATYPE_Video Subtype MEDIASUBTYPE_MPEG1Payload Format Type FORMAT_MPEGVideo Table 6-7: MPEG1 H263 Major type MEDIATYPE_Video Subtype ‘W’, ‘M’, ‘P’, 0x3, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 Format Type FORMAT_Videoinfo Table 6-8: H263 MJPG Major type MEDIATYPE_Video Subtype ‘M’, ‘J’, ‘P’, ‘G’, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 Format Type FORMAT_Videoinfo Table 6-9: MJPG Data Structures TCFG_HEADER Structure The TCF
unsigned long flags; unsigned long size; } TCFG_HEADER; Members name The name of the configuration. It uses a string less than MAX_NAME (64) characters included in quotes. For example: “MPEG2, IPB” for a stream setting and “4M” for a bitrate setting. desc The description of the configuration. Use a string of less than MAX_DESC (256) characters included in quotes. flags The flags member provides information on what fields are provided in the structure where the TCFG_HEADER is located.
TCFGSYSTEM Structure The TCFGSYSTEM structure describes settings of the sensor (image sensor or video decoder) being used to capture video and some general settings of the MPEG4 chip.
Members header Header information about the structure. tv_standard tv_standard can only be set as TVStandard_NTSC_Mask or TVStandard_PAL_Mask. framerate The real frame rate will be the value of frame rate divided by 1001. For example: if frame rate = 30000, then the real frame rate = 30000 / 1001 = 29.97. sensor_h The horizontal resolution of the sensor source input, in pixels. sensor_v The vertical resolution of the sensor source input, in pixels. sensor_h and sensor_v constitute the source video size.
pformat Sensor pixel format. Valid only if format is RGB Bayer. X 2: RGB-Bayer in GB-format X 3: RGB-Bayer in GR-format X 4: RGB-Bayer in BG-format X 5: RGB-Bayer in RG-format sensor_656_mode Specifies if the sensor input is in 656 mode. X 0: The sensor is not in 656 mode X 1: The sensor is in 656 mode valid_enable If valid_enable is set, then input image data is valid only if valid signal is active. X 0: Disable valid signal. X 1: Enable valid signal.
vref_polar Specifies the polarity of the vertical reference signal provided by the sensor or emulator. Only valid in non-656 mode. X 0: V reference polarity will be active-high X 1: V reference polarity will be active-low field_id_polar Specifies the polarity of the field ID. X 0: Top field ID = 0; Bottom field ID = 1 X 1: Top field ID = 1; Bottom field ID = 0 sensor_bit_width The bit width of the image data provided by sensor or emulator.
TCFGSTREAM Structure The TCFGSTREAM structure describes settings of the output video stream of the MPEG4 chip.
X MPEG1: 0x00 X MPEG2: 0x01 X H263: 0x03 X MPEG4: 0x04 X MOTIONJPEG: 0x08 sequence The sequence mode of the encoding stream. There are three types of frames used in a stream sequence: Intra frames (I), Predictive frames (P), and Bi-directional frames (B). This member indicates the types of frames being used in a stream sequence. Refer to Enumeration: ESequenceMode for details.
mpeg4_mode MPEG4 stream mode. Valid only when compress_mode is four. Refer to Enumeration: MPEG4_MODE for details. X WIS_MPEG4: X DIVX_MPEG4: 1 X MICROSOFT_MPEG4: 2 X XVID_MPEG4: 3 X RCC_MPEG4: 4 0 DVD_compliant Specifies if the stream is to be DVD compliant. Valid only when the compression mode is MPEG2.
enabling the GOP head. X 0: Disable GOP head X 1: Enable GOP head seq_head_enable Only encoding Microsoft format MPEG4 stream requires disabling the sequence head. All other format streams require enabling sequence head. X 0: Disable sequence head X 1: Enable sequence head aspect_ratio The ratio between the width and the height of the picture. This information is included in the sequence header. X 1: 1:1 X 2: 4:3 X 3: 16:9 reserved Reserved for future use.
TV_STANDARD tv_standard; unsigned longframe_rate; unsigned long unsigned charivtc_enable; long drop_frame; reserved; } TCFGFRAMERATE; Members header Header information about the structure tv_standard tv_standard can only be set as TVStandard_NTSC_Mask or TVStandard_PAL_Mask. frame_rate Output frame rate drop_frame X 0: Keep original frame rate.
reserved Reserved for future use TCFGRESOLUTION Structure The TCFGRESOLUTION structure describes the resolution of an encoded stream.
Members header Header information about the structure. tv_standard tv_standard can only be set as TVStandard_NTSC_Mask or TVStandard_PAL_Mask. width The desired output stream resolution: horizontal size. height The desired output stream resolution: vertical size. h_sub_window Specify if performing sub-window (cropping) in the horizontal direction. X 0: Disable sub-window X 1: Enable sub-window v_sub_window Specify if performing sub-window (cropping) in the vertical direction.
v_sub_offset If v_sub_window is performed, this parameter specifies a relative offset between the topmost pixel of the output stream and the topmost pixel of the source stream, in pixels. h_scale_enb Specify if it will perform ½ scaling in the horizontal direction. X 0: Disable scaling X 1: Enable scaling v_scale_enb Specify if it will perform ½ scaling in the vertical direction. X 0: Disable scaling X 1: Enable scaling sub_sample Specify if it is performing sub_sampling.
min_bitrate The minimum bit rate allowed for this resolution. reserved Reserved for future use. TCFGBRCTRL Structure The TCFGBRCTRL structure describes the bit-rate control setting of encoded stream.
Members header Header information about the structure. target_bitrate The desired average target bit rate of the encoded stream, in bits per second (bps). X 0: If Q>0, apply the variable bitrate control (VBR) using the value of Q. If Q=0, no bitrate control algorithm is applied. Bitrate will be determined by values of IQ, PQ, and BQ provided by the user. X >0: Apply constant bitrate control (CBR) using the value of target_bitrate.
lambda The factor determining stream quality. Its value range is [0, 100]. The larger the value, the smoother the stream however, the quality of each frame decreases. This is inversely true for smaller values. However, due to frame drops, the entire video stream would appear “jumpy”. Q Initial quantizer. This value is divided by four. X 0: If target_bitrate>0, apply constant bitrate control. The initial quantizer value is calculated. If target_bitrate=0, no bitrate control algorithm is applied.
reserved Reserved for future use. TCFGMISC Structure The TCFGSTREAM structure describes miscellaneous settings of the output video stream of MPEG4 chip.
Members Header Header information about the structure. av_sync_enable X 0: Disable WIS Audio/Video Synchronization algorithm X 1: Enable WIS Audio/Video Synchronization algorithm iip_enable Specifies if enabling Input Image Processing. Only valid when sensor pixel format is RGB Bayer. X 0: Disable IIP X 1: Enable IIP vbi_enable X 0: Disable VBI X 1: Enable VBI four_channel_enable If four_channel_enable is set, each frame of the encoded stream will be divided into four quadrants.
encoding X 2: Linear filter applied in the horizontal direction before encoding v_filter_mode The mode of pre-filtering in a vertical direction. X 0: No pre-filtering in the vertical direction before encoding X 1: Median filter applied in the vertical direction before encoding X 2: Linear filter applied in the vertical direction before encoding filter_nAX filter_nBX filter_nCX The coefficients of linear filter in horizontal direction. Valid only if the h_filter_mode equals to two.
v_filter_mode is 2. filter_nAY, filter_nBY and filter_nCY correspond to precedent pixel, current pixel, and following pixel respectively. These three coefficients are all 5-bit values. filter_nBY is an unsigned value. filter_nAY and filter_nCY are signed values, with the highest bit indicating the sign and the remaining four bits indicating the absolute value. Typically, if filter_nAY and filter_nCY are positive, the filter will be a low-pass filter.
Members misccfg A TCFGMISC structure for miscellaneous settings. strcfg A TCFGSTREAM structure for stream settings. rescfg A TCFGRESOLUTION structure for resolution settings. fpscfg A TCFGFRAMERATE structure for frame rate settings. ctlcfg A TCFGBRCTRL structure for bitrate control settings. TCFGVIDEOEX Structure The TCFGVIDEOEX structure describes both system and video settings.
TCFGBRCTRL ctlcfg; } TCFGVIDEOEX; Members syscfg A TCFGSYSTEM structure for system settings. misccfg A TCFGMISC structure for miscellaneous settings. strcfg A TCFGSTREAM structure for stream settings. rescfg A TCFGRESOLUTION structure for resolution settings. fpscfg A TCFGFRAMERATE structure for frame rate settings. ctlcfg A TCFGBRCTRL structure for bit rate control settings. TCFG_FORMAT_EXTENSION Structure An extension to be appended to format information that will be set to video pin.
{ TCFGSTREAM strcfg; TCFGFRAMERATE fpscfg; TCFGRESOLUTION rescfg; TCFGBRCTRL ctlcfg; } TCFG_FORMAT_EXTENSION; Members strcfg A TCFGSTREAM structure for stream settings. fpscfg A TCFGFRAMERATE structure for frame rate settings. rescfg A TCFGRESOLUTION structure for resolution settings. ctlcfg A TCFGBRCTRL structure for bitrate control settings.
unsigned long _num_of_resolution_configs; TCFGRESOLUTION _resolution_configs[MAX_RESOLUTION_CONFIG]; unsigned long _num_of_framerate_configs; TCFGFRAMERATE _framerate_configs[MAX_FRAMERATE_CONFIG]; unsigned long _num_of_associations; TCFGASSOCIATION unsigned long TVCFG_ENTRY* _associations[MAX_ASSOCIATION]; _num_of_configurations; _configurations; } _VIDEO_CAPABILITIES; Members _num_of_system_configs The count of all system configurations.
_num_of_resolution_configs The count of all resolution configurations. _resolution_configs An array of TCFGRESOLUTION structures to hold all resolution configurations. _num_of_framerate_configs The count of all frame rate configurations. _framerate_configs An array of TCFGFRAMERATE structures to hold all frame rate configurations. _num_of_associations The count of all associations. _associations An array of TCFGASSOCIATION structures to hold all associations.
TCFGASSOCIATION Structure The TCFGASSOCIATION structure allows users to define relationship between any two types of settings from system setting, stream setting, resolution setting, frame rate setting, and bitrate control setting, if any. Syntax typedef struct { Enum ASSOCIATION_TYPE_master_type; unsigned long _master_id; Enum ASSOCIATION_TYPE_slave_type; unsigned long _slave_id; unsigned char _associate_type; } TCFGASSOCIATION; Members _master_type Type of master video setting.
_associate_type Type of this association. ASSOCIATION_TYPE. Refer to the Enumeration: TVCFG_ENTRY Structure The TVCFG_ENTRY structure describes one entry for video configuration. Syntax typedef struct { unsigned long stream_index; unsigned long resolution_index; unsigned long framerate_index; } TVCFG_ENTRY; Members stream_index Index of stream configuration. resolution_index Index of resolution configuration. framerate_index Index of frame rate configuration.
AUDIO_CONFIG Structure Syntax typedef struct _AUDIO_CONFIG { unsigned long Format; unsigned long SampleRate; unsigned long Channels; unsigned long SampleBits; unsigned short BlockAlign; unsigned long AvgBytesPerSec; unsigned short SamplesPerBlock; unsigned short ExtSize; } AUDIO_CONFIG; Members sormat Audio format. Possible values are included in the Enumeration: AUDIO_FORMAT. sampleRate Audio sample rate, in byte. Possible values are 44100, 48000, etc for PCM, 48000 for ADPCM. channels Audio channels.
STATISTIC Structure Syntax typedef struct _STATISTIC { UINT32 VideoByte; UINT32 FrameCount; } STATISTIC; Members VideoByte Total video bytes obtained since starting capturing. FrameCount Total video frames obtained since starting capturing.
Members DriverMajor Major revision number of driver. DriverMinor Minor revision number of driver. BoardRevision Revision number of reference board. BoardName Name of reference board. BoardCapability An integer with each bit representing one kind of capability of board, using values in Enumeration: BOARD_CAP. MaxBandWidth Reserved for future use. SourceWidth Width of source video. SourceHeight Height of source video.
Enumerations EVideoFormat Enumeration Syntax typedef enum { MPEG1 = 0x00, MPEG2 = 0x01, H261 = 0x02, H263 = 0x03, MPEG4 = 0x04, MPEG4XGO = 0x05, MPEG2X4 = 0x06, MOTIONJPEG = 0x08, DV = 0x09, H26L = 0x20, GO = 0x40 } EVideoFormat; ESequenceMode Enumeration Syntax typedef enum { IONLY = 1, IPONLY = 2, IPB = 3, IPBDROP = 4 } ESequenceMode; Reference Manual 95
TV_STANDARD Enumeration Syntax typedef enum { TVStandard_None= 0x00000000, TVStandard_NTSC_M= 0x00000001, TVStandard_NTSC_M_J= 0x00000002, TVStandard_NTSC_433= 0x00000004, TVStandard_PAL_B= 0x00000010, TVStandard_PAL_D= 0x00000020, TVStandard_PAL_G= 0x00000040, TVStandard_PAL_H= 0x00000080, TVStandard_PAL_I= 0x00000100, TVStandard_PAL_M= 0x00000200, TVStandard_PAL_N= 0x00000400, TVStandard_PAL_60= 0x00000800, TVStandard_SECAM_B= 0x00001000, TVStandard_SECAM_D= 0x00002000, TVStandard_SECAM_G= 0x00004000,
FilterMode Enumeration Syntax typedef enum { GO7007SB_MIDIAN= 1, GO7007SB_LOWPASS= 2, GO7007SB_NOFILTER= 0 } FilterMode; MPEG4_MODE Enumeration Syntax enum MPEG4_MODE { WIS_MPEG4= 0, DIVX_MPEG4= 1, MICROSOFT_MPEG4= 2, XVID_MPEG4= 3, RCC_MPEG4= 4 }; FLAGS_STREAM Enumeration Syntax enum FLAGS_STREAM { FLAGS_STREAM_COMPRESS_MODE= 0x00000001, FLAGS_STREAM_SEQUENCE_MODE= 0x00000002, FLAGS_STREAM_GOP_MODE= 0x00000004, FLAGS_STREAM_GOP_SIZE= 0x00000008, FLAGS_STREAM_MPEG4_MODE= 0x00000010, Reference Manual 97
FLAGS_STREAM_DEINTERLACE_MODE= 0x00000020, FLAGS_STREAM_SEARCH_RANGE= 0x00000040, FLAGS_STREAM_GOPHEAD_ENABLE= 0x00000080, FLAGS_STREAM_SEQHEAD_ENABLE= 0x00000100, FLAGS_STREAM_ASPECT_RATIO= 0x00000200, FLAGS_STREAM_DVD_COMPLIANT= 0x00000400, FLAGS_STREAM_MPEG4_MANDETORY= FLAGS_STREAM_COMPRESS_MODE + FLAGS_STREAM_MPEG4_MODE, }; FLAGS_FRAMERATE Enumeration Syntax enum FLAGS_FRAMERATE { FLAGS_FRAMERATE_FRAMERATE = 0x00000001, FLAGS_FRAMERATE_IVTC_ENABLE = 0x00000002, FLAGS_FRAMERATE_DROP_FRAME = 0x00000004,
FLAGS_RESOLUTION Enumeration Syntax enum FLAGS_RESOLUTION { FLAGS_RESOLUTION_WIDTH=0x00000001, FLAGS_RESOLUTION_HEIGHT=0x00000002, FLAGS_RESOLUTION_H_SUBWINDOW=0x00000004, FLAGS_RESOLUTION_V_SUBWINDOW=0x00000008, FLAGS_RESOLUTION_SCALE_OFFSET=0x00000010, FLAGS_RESOLUTION_SUBSAMPLE=0x00000100, FLAGS_RESOLUTION_TVSTANDARD=0x00000200, FLAGS_RESOLUTION_MAX_BITRATE=0x00000400, FLAGS_RESOLUTION_MIN_BITRATE=0x00000800, FLAGS_RESOLUTION_H_SUBOFFSET=0x00001000, // used only in parser FLAGS_RESOLUTION_V_SUBOFFSET=0x0
FLAGS_BITRATE Enumeration Syntax enum FLAGS_BITRATE { FLAGS_BITRATE_TARGET= 0x00000004, FLAGS_BITRATE_PEAK= 0x00000008, FLAGS_BITRATE_VBV_BUFFER= 0x00000010, FLAGS_BITRATE_CONVERGE_SPEED= 0x00000020, FLAGS_BITRATE_LAMBDA= 0x00000040, FLAGS_BITRATE_Q= 0x00000080, FLAGS_BITRATE_IPBQ= 0x00000100, FLAGS_BITRATE_IQ= 0x00000200, // used only in parser FLAGS_BITRATE_PQ= 0x00000400, // used only in parser FLAGS_BITRATE_BQ= 0x00000800, // used only in parser FLAGS_BITRATE_MANDETORY= FLAGS_BITRATE_TARGET + FLAGS_BIT
FLAGS_MISC_FILTER= 0x00000010, FLAGS_MISC_MANDETORY= 0 }; SENSOR_CAPABILITIES Enumeration Syntax enum SENSOR_CAPABILITIES { CAP_SENSOR_VIDEO_SOURCE= 0x00000001, CAP_SENSOR_VIDEO_BRIGHTNESS= 0x00000004, CAP_SENSOR_VIDEO_BRIGHTNESS_AUTO= 0x00000008, CAP_SENSOR_VIDEO_CONTRAST= 0x00000010, CAP_SENSOR_VIDEO_CONTRAST_AUTO= 0x00000020, CAP_SENSOR_VIDEO_HUE= 0x00000040, CAP_SENSOR_VIDEO_HUE_AUTO= 0x00000080, CAP_SENSOR_VIDEO_SATURATION= 0x00000100, CAP_SENSOR_VIDEO_SATURATION_AUTO= 0x00000200, CAP_SENSOR_VID
CAP_SENSOR_VIDEO_WHITEBALANCE_AUTO= 0x00008000, CAP_SENSOR_VIDEO_BACKLIGHT_COMPENSATION= 0x00010000, CAP_SENSOR_VIDEO_BACKLIGHT_COMPENSATION_AUTO = 0x00020000, CAP_SENSOR_VIDEO_COLORENABLE= 0x00040000, }; Remark A DWORD with each bit represents one kind of sensor capability.
CAP_AUDIO_SAMPLERATE_48K= 0x00004000, CAP_AUDIO_CHANNEL_MONO= 0x00010000, CAP_AUDIO_CHANNEL_STEREO= 0x00020000, CAP_AUDIO_SAMPLE_8BIT= 0x00040000, CAP_AUDIO_SAMPLE_16BIT= 0x00080000, }; Remark A DWORD with each bit represents one kind of audio capability. AUDIO_FORMAT Enumeration Syntax enum AUDIO_FORMAT { AUDIO_FORMAT_PCM=1, AUDIO_FORMAT_ADPCM_MS=2, AUDIO_FORMAT_ADPCM_IMA=11, AUDIO_FORMAT_ALAW, AUDIO_FORMAT_ULAW, AUDIO_FORMAT_MP3=0x55 }; Remark This enumeration lists various kinds of audio formats.
ASSOCIATION_TYPE Enumeration Syntax enum ASSOCIATION_TYPE { TYPE_SYSTEM_CONFIG, TYPE_STREAM_CONFIG, TYPE_RESOLUTION_CONFIG, TYPE_BITRATE_CONFIG, TYPE_FRAMERATE_CONFIG }; BOARD_CAP Enumeration Syntax typedef enum { BC_VIDEO= 0x00000001, BC_AUDIO= 0x00000002, BC_TVTUNER= 0x00000004, BC_XBAR= 0x00000008, BC_VBI= 0x00000010, } BOARD_CAP; Filter Interfaces Included in this chapter are descriptions of the interfaces exposed by the WDM streaming capture filter (ADLINK Hardware MPEG4 Device filter).
ISpecifyPropertyPages. Alternatively, visit http://msdn.microsoft.com/library/ and from the left panel navigation, select Graphics and Multimedia -> DirectX -> SDK Documentation -> DirectX 9.0 (C++) -> DirectShow -> DirectShow Reference -> Interfaces for a complete list of standard DirectShow filter interfaces references. The ADLINK Hardware MPEG4 Device private interfaces are described in this chapter. IGOChip Interface IGOChip::SetVideoConfig The SetVideoConfig method sets the video configurations.
exposed by both video and audio pins of WIS driver. The video and audio capabilities of the driver, the mean time, and the default format of these capabilities can be retrieved by using this interface. It is common to have multiple capabilities for both audio and video. Follow the instructions below to configurate: Inspect all capabilities to check which capability is the one you want to set, using IAMStreamConfig::GetStreamCaps. The default format for this capability can be modified as needed.
Sample Code void CVideoControlPropertyPage::SetPinFormat(IAMStrea mConfig* stream_config, TCFGVIDEOEX* video_config) { AM_MEDIA_TYPE* pmt; VIDEO_STREAM_CONFIG_CAPS caps; if ( stream_config == NULL ) return; int caps_count = 0, caps_size = 0; stream_config>GetNumberOfCapabilities(&caps_count, &caps_size); char szDebugInfo[1000]; for ( int i = 0 ; i < caps_count ; i ++ ) { HRESULT hr = stream_config>GetStreamCaps(i, &pmt, (BYTE*)&caps); if ( FAILED(hr) ) { OutputDebugString("[wisproxy]: GetSteamCaps Faile
if ( pmt->formattype != FORMAT_MPEGVideo ) goto next_stream_caps; MPEG1VIDEOINFO* format = (MPEG1VIDEOINFO*)pmt>pbFormat; if ( format->hdr.bmiHeader.biWidth != (int)video_config->rescfg.width ) goto next_stream_caps; if ( format->hdr.bmiHeader.biHeight != (int)video_config->rescfg.height ) goto next_stream_caps; normal_format_size = SIZE_MPEG1VIDEOINFO(format); format->hdr.AvgTimePerFrame = (ULONGLONG)(10010000000) / video_config>fpscfg.frame_rate; format->hdr.bmiHeader.biWidth = video_config>rescfg.
extension->_framerate = video_config->fpscfg; extension->_resolution = video_config->rescfg; extension->_bitrate = video_config->ctlcfg; } sprintf(szDebugInfo, "MPEG1 width: %d height: %d fps: %d bps: %d", format->hdr.bmiHeader.biWidth, format->hdr.bmiHeader.biHeight, long(format->hdr.AvgTimePerFrame), format->hdr.
(ULONGLONG)(10010000000) / video_config>fpscfg.frame_rate; format->hdr.bmiHeader.biWidth = video_config->rescfg.width; format->hdr.bmiHeader.biHeight = video_config->rescfg.height; format->hdr.bmiHeader.biSizeImage = video_config->rescfg.width * video_config>rescfg.height * 3 / 2; format->hdr.dwBitRate = video_config>ctlcfg.target_bitrate; format->hdr.dwPictAspectRatioX = video_config->rescfg.width; format->hdr.dwPictAspectRatioY = video_config->rescfg.
format->hdr.bmiHeader.biWidth, format->hdr.bmiHeader.biHeight, long(format->hdr.AvgTimePerFrame), format->hdr.dwBitRate); OutputDebugString(szDebugInfo); break; } case MPEG4: case H263: case MOTIONJPEG: { if ( pmt->formattype != FORMAT_VideoInfo ) goto next_stream_caps; VIDEOINFOHEADER* format = (VIDEOINFOHEADER*)pmt->pbFormat; if ( format->bmiHeader.biWidth != (int)video_config->rescfg.width ) goto next_stream_caps; if ( format->bmiHeader.biHeight != (int)video_config->rescfg.
case MICROSOFT_MPEG4: if ( format->bmiHeader.biCompression != FCC_FORMAT_MICROSOFT_MPEG4 ) goto next_stream_caps; break; case WIS_MPEG4: if ( format->bmiHeader.biCompression != FCC_FORMAT_WIS_MPEG4 ) goto next_stream_caps; break; default: assert(false); } } else if ( video_config->strcfg.compress_mode == H263 ) { if ( format->bmiHeader.biCompression != FCC_FORMAT_H263 ) goto next_stream_caps; } else if ( video_config->strcfg.compress_mode == MOTIONJPEG ) { if ( format->bmiHeader.
(ULONGLONG)(10010000000) / video_config>fpscfg.frame_rate; format->bmiHeader.biWidth = video_config>rescfg.width; format->bmiHeader.biHeight = video_config->rescfg.height; format->bmiHeader.biSizeImage = video_config->rescfg.width * video_config>rescfg.height * 3 / 2; format->dwBitRate = video_config>ctlcfg.
memcpy( pmt->pbFormat + normal_format_size - seq_length, seq_header, seq_length); } if ( m_pIGOChipConfig ) // patch { IGOChip* pIGOChip; m_pIGOChipConfig>QueryInterface(IID_IGOChip, reinterpret_cast(&pIGOChip)); unsigned int error; pIGOChip>SetVideoConfig(extension, &error); pIGOChip->Release(); } } sprintf(szDebugInfo, "videoinfo width: %d height: %d fps: %d bps: %d", format->bmiHeader.biWidth, format->bmiHeader.
AM_MEDIA_TYPE* pmt1; hr = stream_config->GetFormat(&pmt1); DeleteMediaType(pmt1); hr = stream_config->SetFormat(pmt); if ( FAILED(hr) ) { OutputDebugString("wisproxy: set pin format failed"); }; DeleteMediaType(pmt); hr = stream_config->GetFormat(&pmt); DeleteMediaType(pmt); return; next_stream_caps: DeleteMediaType(pmt); } } IGOChipConfig Interface Note: This interface has now been phased out.
1. IGOChipConfig::GetVideoConfig The GetVideoConfig method retrieves the video configurations. Syntax HRESULT GetVideoConfig( TCFGVIDEOEX *pVal ); Parameters pVal: [Out] Pointer to a structure TVIDEOCFGEX to receive video configurations. Return Value HRESULT Related Items IGOChip::SetVideoConfig() 2. IGOChipConfig::GetVideoSource The GetVideoSource method retrieves the video source that is in use.
Return Value HRESULT 3. IGOChipConfig::SetVideoSource The SetVideoSource method sets the video source as either Svideo or composite. Syntax HRESULT SetVideoSource( unsigned int newVal ); Parameters newVal: [In]Specifies what kind of video source is in use. 0 represents S-video and 1 represents composite. Return Value HRESULT 4. IGOChipConfig::GetSensorCapability The GetSensorCapability method retrieves the sensor capabilities.
Parameters pVal: [Out] Pointer to an unsigned integer that is Enumeration: SENSOR_CAPABILITIES. Return Value HRESULT 5. IGOChipConfig::GetStatisticInfo The GetStatisticInfo method retrieves the statistical information about video bytes and frames obtained since starting the capture. Syntax HRESULT GetStatisticInfo( STATISTIC *pVal ); Parameters pVal: [Out] Pointer to a STATISTIC structure to receive statistic info. Return Value HRESULT 6.
Parameters pCaps: [Out] Pointer to a _VIDEO_CAPABILITIES structure to receive video capabilities. Return Value HRESULT 7. IGOChipConfig::GetAudioConfig The GetAudioConfig method retrieves the audio configurations. Syntax HRESULT GetAudioConfig( AUDIO_CONFIG *pConfig ); Parameters pConfig: [Out] Pointer to a structure AUDIO_CONFIG to receive audio configurations. Return Value HRESULT Related Items IGOChipConfig::SetAudioConfig() 8.
Parameters pConfig: [Out] Pointer to a structure AUDIO_CONFIG that contains audio configurations. Return Value HRESULT Related Items IGOChipConfig::GetAudioConfig() 9. IGOChipConfig::GetAudioCapability The GetAudioCapability method retrieves the audio capabilities. Syntax HRESULT GetAudioCapability( unsigned int *pAudioCap ); Parameters pAudioCap: [Out] Pointer to an unsigned integer that is Enumeration: AUDIO_CAPS. Return Value HRESULT IGOInfo Interface 1.
Syntax HRESULT GetRevisionInfo( REVISION_INFO *pRevInfo ); Parameters pRevInfo: [In] A pointer to REVISION_INFO structure to hold driver and board revision information. Return Value HRESULT 2. IGOInfo::GetMacrovision The GetMacrovision method ascertains whether the video stream is protected by Macrovision. Syntax HRESULT GetMacrovision( int *pMacrovision ); Parameters pMacrovision: [In] 1 indicates the stream is protected. 0 indicates the stream is not protected.
GPIO. 1. IAccessFunc::I2C_WriteRegister The I2C_WriteRegister method writes a single I2C register. Syntax HRESULT I2C_WriteRegister( unsigned char DevAddr, int AddrWidth, unsigned short RegAddr, unsigned char RegValue, int I2CMode ); Parameters DevAddr: [In] Device address. AddrWidth: [In] Length of register address, in bits. Typical values can either be 8 or 16. RegAddr: [In] Register address.
2. IAccessFunc::I2C_ReadRegister The I2C_ReadRegister method reads a single I2C register. Syntax HRESULT I2C_ReadRegister( Unsigned char DevAddr, int AddrWidth, unsigned short RegAddr, unsigned char *pRegValue, int I2CMode ); Parameters DevAddr: [In] Device address. AddrWidth: [In] Length of register address, in bits. Typical values can be either 8 or 16. RegAddr: [In] Register address. If its higher byte is 0, the register is considered to have an 8-bit address; otherwise, the address length is 16 bits.
3. IAccessFunc::I2C_BurstWriteRegister The I2C_BurstWriteRegister method writes multiple continuous I2C registers (burst mode). Syntax HRESULT I2C_BurstWriteRegister( unsigned char DevAddr, int AddrWidth, unsigned short StartRegAddr, int RegNum, unsigned char *pRegValue, int I2CMode ); Parameters DevAddr: [In] Device address. AddrWidth: [In] Length of register address, in bits. Typical values can be either 8 or 16. StartRegAddr: [In] Address of the first register.
Return Value HRESULT 4. IAccessFunc::I2C_BurstReadRegister The I2C_BurstReadRegister method reads multiple continuous I2C registers (burst mode). Syntax HRESULT I2C_BurstReadRegister( unsigned char DevAddr, int AddrWidth, unsigned short StartRegAddr, int RegNum, unsigned char *pRegValue, int I2CMode ); Parameters DevAddr: [In] Device address. AddrWidth: [In] Length of register address, in bits. Typical values can either be 8 or 16. StartRegAddr: [In] Address of the first register.
I2CMode: [In] I2C mode. The value can be set at: X 0x0000:Use I2C protocol via on chip I2C controller. X 0x0001:Use SCCB protocol via on chip I2C controller. X 0x8000:Use I2C protocol via Cypress I2C controller. Return Value HRESULT 5. IAccessFunc::SPI_WriteRegister The SPI_WriteRegister method writes a single SPI register.
DataLen: [In] Length of data, in bits. The typical range is 0 - 16. RegData: [In] Value to be written to the SPI register. SPI_mode: [In] SPI mode, a 16-bit data. Refer to the following table for definitions for each bit.
Bit Name 2 1:0 Type bst_rw spi_mode RW RW Default Value Description 1’b0 1 = burst R/W mode (burst R for 3-wire device is not supported, the read data of 3-wire device is half spi clock cycle later than that of spi device); 0 = single R/W mode; 2’h0 2’h0 = spi mode 0; 2’h1 = spi mode 1; 2’h2 = spi mode 2; 2’h3 = spi mode 3; Note: for 3-wire, mode 0 should be used. Table 6-10: SPI Control Register Definition Return Value HRESULT 6.
Parameters OpLen: [In] Operation code length, in bits. The typical range is 1 - 8. OpCode: [In] Operation code. AddrLen: [In] Length of register address, in bits. The typical range is 1 - 16. RegAddr: [In] Register address. DataLen: Length of data, in bits. The typical range is 0 – 16. pRegData: [Out] Value to be written to the SPI register. SPIMode: [In] SPI mode, a 16-bit data. Refer to Table 1 SPI Control Register Definition for definitions of each bit. Return Value HRESULT 7.
Value: [In] The signal written to the GPIO pins. The value must be either 0 or 1. Mode: [In] 0: On chip GPIO controller; 1: Cypress GPIO controller. Return Value HRESULT 8. IAccessFunc::GPIO_ReadPins The GPIO_ReadPins method reads the signal on one or multiple GPIO pins. Syntax HRESULT GPIO_ReadPins( int ReadNum, int *Index, int *Value, int Mode ); Parameters ReadNum: [In] Number of pins to read. Index: [In] Indexes of GPIO pins. Value: [In] The signal read from the GPIO pins.
ADLINK Hardware MPEG4 Device GPIO Pin Definition PIN Type FUNCTION GPIO0 Input Channel ID bit 0 GPIO1 Input Channel ID bit 1 GPIO2 Input Card ID bit 0 (setting by dip switch) GPIO3 Input Card ID bit 1 (setting by dip switch) GPIO4 Input Card ID bit 2 (setting by dip switch) Table 6-11: ADLINK Hardware MPEG4 Device GPIO Pinout IAdvanced Interface This interface provides advanced access to CBUS registers and HPI registers.
2. IAdvanced::WriteCBusRegFW The WriteCBusRegFW method writes a single CBus register. Syntax HRESULT WriteCBusRegFW( unsigned short Addr, unsigned short Data, ); Parameters Addr: [In] CBus register address. Data: [In] CBus register value. Return Value HRESULT IOSD Interfaces ADLINK Hardware MPEG4 Device supports up to 94 Unicode character On Screen Display (OSD).
Parameters info: [In] structure contains OSD output information. X OSDTextoutInfo structure: typedef struct { unsigned short TotalLength; unsigned short text[MAX_OSDSTRING_LEN]; } OSDTextoutInfo; Description: TotalLength: Describes the length of OSD frame contained in text[]. Text[]: OSD frame in word, refer to OSD programming chapter for OSD frame structure. Return Value HRESULT 2. IOSD::Show The Show method sends the firmware the command to start OSD.
Pin Interfaces The pins of ADLINK Hardware MPEG4 Device filter expose Microsoft DirectShow interfaces: IAMBufferNegotiation, IAMStreamConfig, IAMStreamControl, IKsPin, IKsPropertySet, IStreamBuilder, IMediaSeeking, IPin, and IQualityControl. Follow the links of the interfaces for further detail. Alternatively, please visit http://msdn.microsoft.com/library/ and from the left panel navigation, select Graphics and Multimedia -> DirectX -> SDK Documentation -> DirectX 9.
Context OSD Font Bitmaps All OSD font bitmaps are stored in the off-chip DRAM. The address is from 0xA0100 to 0xAF8FF (if 8M SDRAM and IP_ONLY), or from 0x140100 to 0x14F8FF (if 8M SDRAM and IPB). Each font occupies 32 consecutive DWORD, supporting up to 1984 font bitmaps. After downloading to DRAM, the bitmaps are never changed. OSD Fonts Display There is a 192-WORD font index buffer in the on-chip SRAM.
OSD Frame An OSD frame is made up with at least one OSD string and one OSD_EOF. An OSD string starts with a ST_CD which is followed by a series of font base addresses, and ends with an OSD_EOS. An example is shown as follows: ST_CD ADDR0 ADDR1 … ADDRn OSD_EOS ST_CD ADDR0 … OSD_EOS OSD_EOF ST_CD: 16-bit, as the macroblock coordinate (x, y) for the first font of this string. ST_CD[15:8] = y, ST_CD[7:0] = x. Example: Preview window is 720*480, max value of X is 720/ 16-1=44, max value of Y is 480/16-1 = 29.
Bitmap Stored in SDRAM For every pixel in the bitmap, 4 bit data will be used to describe OSD behavior of the pixel. Format of BITMAP in SDRAM is: bit 0 bit 31 dword 0 P(0,0) P(0,1) P(0,2) P(0,3) P(0,4) P(0,5) P(0,6) P(0,7) . P(1,0) P(1,1) P(1,2) P(1,3) P(1,4) P(1,5) P(1,6) P(1,7) . … … … … … … … … . P(15,0) P(15,1) P(15,2) P(15,3) P(15,4) P(15,5) P(15,6) P(15,7) . P(0,8) P(0,9) P(0,10) P(0,11) P(0,12) P(0,13) P(0,14) P(0,15) .
In the previous equations, Xs is the source data (Y or U or V), Xd is the result (Y or U or V), α is the alpha blending level which is defined in bit 2 to bit 0. C0 is the background color and C1 is the foreground color. As there are three channels (YUV), C0 and C1 could be programmable from C-Bus for every channel. So there are two ways to change the OSD color: 1. Change the YUV value in Fix_setting.txt // osd setting osdcfg.DoOSD = 1 osdcfg.OSDyc0 = 0 osdcfg.OSDyc1 = 255 osdcfg.OSDuc0 = 0 osdcfg.
Or Know Limitations 1. Each OSD frame can only contain up to 90 fonts in the single OSD string case. 2. Font size can only be 16*16, which is macro block based. How to display customer defined size bitmap The firmware only can display 16*16 OSD bitmaps. However, customers can still show bigger bitmaps by proper software programming skills.
2 OSD string frame X1, Y1, address1, address 2, 0x0000, X3, Y3, address 3, address 4, 0x0000, 0xAAAA 4 OSD string frame X1, Y1, address1, 0x0000, X2, Y2, address 2, X3, Y3, address 3, X4, Y4, address 4, 0x0000, 0xAAAA Notes: X Xn, Yn means the 1, 2, 3, 4 sub bitmap’s X,Y position, for example, sub bitmap 1’s X/Y is (0,0), sub bitmap 3’s X/Y is (0,1) X Address[n] means 1,2,3,4 sub bitmap’s address in firmware, this address is decided when bitmap is downloaded.
boarder) X X Basic font bitmap display Z 16*16 bitmap size, customer defined font style and size Z Customer defined alpha blending level and YUV (Can be converted to RGB) color Z Single OSD string in OSD frame Advanced font bitmap display Z 32*32 bitmap size, customer defined font style and size, which is simulated by software, to display the 4 sub-bitmaps for composing 32*32 bitmap. Z Multiple OSD strings in OSD frame Z Hollow font with different colors between font boarder and body.
142 Reference Manual
Appendix Appendix A: Glossary Brightness: Attribute of a visual sensation according to which an area appears to exhibit more or less light CCIR: Committee Consulat International Radiotelegraphique. This is a standards committee of the International Telecommunications Union, which made the technical recommendation for European 625 line standard for video signals.
Frame: One frame (two fields) of video contains the full vertical interlaced information content of the picture. For NTSC this consists of 525 lines and PAL a frame is consisted of 625 lines. Gamma: Cathode ray tubes (CRTs) do not have a linear relationship between brightness and the input voltage applied. To compensate for this non-linearity, a pre distortion or gamma correction is applied, generally at the camera source. A value of gamma equal to 2.2 is typical, but can vary for different CRT phosphors.
Ireland) and PAL M (hybrid standard, having the same resolution as NTSC, but uses PAL transmission and color coding technology). Saturation: A characteristic describing color amplitude or intensity. A color of a given hue may consist of low or high saturation value, which relates to the vividness of color. AGC Abbreviation for automatic gain control. On a TV or VCR, AGC is a circuit that automatically adjusts the incoming signal to the proper levels for display or recording.
Appendix B: Standard Compliance Notice for USA Compliance Information Statement (Declaration of Conformity Procedure) DoC FCC Part 15 This equipment has been tested and found to comply with the limits for a Class A digital device, pursuant to Part 15 of the FCC Rules. These limits are designed to provide reasonable protection against harmful interference in a residential installation or when the equipment is operated in a commercial environment.
Notice for Europe This product is in conformity with the Council Directive 89/336/EEC amended by 92/31/EEC and 93/ 68/EEC This equipment has been tested and found to comply with EN55022/CISPR22 and EN55024/CISPR24. To meet EC requirements, shielded cables must be used to connect a peripheral to the card. This product has been tested in a typical class B compliant host system. It is assumed that this product will also achieve compliance in any class A compliant unit.
138 Appendix
Warranty Policy Thank you for choosing ADLINK. To understand your rights and enjoy all the after-sales services we offer, please read the following carefully. 1. Before using ADLINK’s products please read the user manual and follow the instructions exactly. When sending in damaged products for repair, please attach an RMA application form which can be downloaded from: http:// rma.adlinktech.com/policy/. 2.
3. Our repair service is not covered by ADLINK's two-year guarantee in the following situations: X Damage caused by not following instructions in the user's manual. X Damage caused by carelessness on the user's part during product transportation. X Damage caused by fire, earthquakes, floods, lightening, pollution, other acts of God, and/or incorrect usage of voltage transformers. X Damage caused by unsuitable storage environments (i.e. high temperatures, high humidity, or volatile chemicals).