HDC-502E SDK (Windows) IEI Technology Corp. MODEL: HDC-502E SDK (Windows) A SDK software development kit for the HDC-502E Series User Manual Page 1 Rev. 2.
HDC-502E SDK (Windows) Revision Date Version Changes 28 September, 2012 2.00 Updated for V2.00 software version 22 November, 2011 1.
HDC-502E SDK (Windows) Copyright COPYRIGHT NOTICE 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.
HDC-502E SDK (Windows) Table of Contents 1 DRIVER AND SDK INSTALLATION ........................................................................ 6 1.1 OVERVIEW.................................................................................................................. 7 1.2 DRIVER INSTALLATION ............................................................................................... 8 1.2.1 Driver Installation in 64-bit Windows 7 OS..................................................... 12 1.2.
HDC-502E SDK (Windows) A.2 ERROR_MODULE[7:0]........................................................................................ 47 A.3 ERROR_STATUS[23:0] ........................................................................................ 48 A.3.1 IDLE ................................................................................................................ 48 A.3.2 ENC ................................................................................................................. 49 A.3.
HDC-502E SDK (Windows) Chapter 1 1 Driver and SDK Installation Page 6
HDC-502E SDK (Windows) 1.1 Overview A CD is shipped with the video capture card. The CD contains a driver for the video capture controllers on the card. When the video capture card is installed on the system, the driver must be installed. Failure to install the driver means that that video capture card cannot be detected by the system. NOTE: The Found New Hardware Wizard will automatically start when the system detects the video capture card.
HDC-502E SDK (Windows) NOTE: If you cannot open the setup file in the 64-bit Windows 7 operating system, please do the following: Run a Command Prompt as an administrator. Key in the setup file directory, and then launch the setup file from there. 1.2 Driver Installation To install the HDC-502E driver, please follow the steps below: If the HDC-502E driver is already installed, please refer to Section 1.2.2 to uninstall the driver first.
HDC-502E SDK (Windows) Step 3: Locate the “Driverinstaller.bat” file in the driver CD. Double click it. The console window appears and starts to install all drivers. Step 4: The screen in Figure 1-1 appears. Click Install. Figure 1-1: Windows Security Step 5: If the following window appears, click Install this driver software anyway.
HDC-502E SDK (Windows) Step 6: The Device Driver Installation Wizard appears. Click Next to start. Figure 1-3: Device Driver Installation Wizard Step 7: The video capture card driver starts to install and the screen in Figure 1-4 appears. Figure 1-4: Driver Installing Step 8: When the driver installation is complete, the screen in Figure 1-5 appears. Click Finish to exit.
HDC-502E SDK (Windows) Figure 1-5: Driver Installation Complete Step 9: Check the device manager in the Windows control panel to ensure the driver (MB86H55-REB PCI, HDC controller and WinDriver) has been properly installed. See Figure 1-6 for the details.
HDC-502E SDK (Windows) 1.2.1 Driver Installation in 64-bit Windows 7 OS To install the driver in a 64-bit Windows 7 operating system, please do the followings. Step 1: When the system is booting, press F8 to enter the Advanced Boot Options menu. Choose “Disable Driver Signature Enforcement” and press Enter. Figure 1-7: Disable Driver Signature Enforcement Step 2: Make sure to log in the system as the administrator. Step 3: Insert the driver CD.
HDC-502E SDK (Windows) Step 5: In the Command Prompt window, specify the 64-bit driver directory. Then, type DriverInstaller.bat to start the driver installation. Figure 1-8: Command Prompt – Driver Installation Step 6: Follow Step 5 ~ Step 8 in Section 1.2 to complete installing the driver to a 64-bit Windows 7 operating system. Step 7: Check the device manager in the Windows control panel to ensure the driver (MB86H55-REB PCI, DEVICE and WinDriver) has been properly installed.
HDC-502E SDK (Windows) Figure 1-9: Device Manager – 64-bit OS 1.2.2 Uninstall Driver To uninstall the driver, please follow the steps below. Step 1: Make sure to login the system as the administrator. Step 2: Locate the “Driveruninstaller.bat” file in the driver CD. Double click it to uninstall the driver. Step 3: The console window pop-up and all drivers will be uninstalled.
HDC-502E SDK (Windows) 1.3 Software Installation The HDC-502E comes with a video capture application – HDCapture SDK. This section describes how to install the application in Windows environment. 1.3.1 System Requirements The supported OS versions are listed below: Microsoft Windows XP SP2 32-bit Microsoft Windows 7 32-bit Microsoft Windows 7 64-bit After installing the driver, the following programs must be installed in order to use the HDCapture SDK: Microsoft .NET Framework 3.0/3.5/4.
HDC-502E SDK (Windows) 1.3.2 HDCapture SDK Installation To install the HDCapture SDK, please follow the steps below. NOTE: If the User Access Control dialog box appears during installation, click Yes to continue. Step 1: Insert the driver CD. Step 2: Locate the HDCapture_x86_Vxxxx.msi file in the driver CD. Double click the setup file to start the installation. The user can also download the latest setup file from IEI website. Step 3: The HDCapture SDK Setup Wizard welcome window appears.
HDC-502E SDK (Windows) Step 4: Select a folder for HDCapture SDK installation in Figure 1-11. Click Next to continue. Figure 1-11: Select Installation Folder Step 5: The following screen appears. Click Next to confirm the installation. Figure 1-12: Confirm Installation Step 6: The system starts installing the HDCapture SDK.
HDC-502E SDK (Windows) Step 7: When the HDCapture SDK is successfully installed, the following window appears. Click Close to exit. Step 0: Figure 1-13: Installation Complete 1.3.3 Uninstall HDCapture SDK To uninstall the HDCapture SDK, follow the steps below. Step 1: Select Control Panel Æ Programs Æ Programs and Features. Step 2: Select HDCapture SDK and click the Uninstall button to uninstall the HDCapture SDK (Figure 1-14).
HDC-502E SDK (Windows) Figure 1-14: Uninstall HDCapture SDK Page 19
HDC-502E SDK (Windows) Chapter 2 2 HDCapture SDK Page 20
HDC-502E SDK (Windows) 2.1 HDCapture SDK Overview The HDCapture SDK is a video capture tool that allows user to capture video through the SDI input ports in Windows environment. NOTE: If you cannot open the HDCapture SDK in the 64-bit Windows 7 operating system, right-click the HDCapture SDK from the Windows Start menu, and click Run as administrator. 2.2 Video Configuration To configure the HDCapture SDK, follow the steps below.
HDC-502E SDK (Windows) Step 2: Enable and configure the device settings by clicking the Device # (0, 1) buttons. The device number is decided by which port the device is installed. Figure 2-2: HDC-502E Device Ports Step 3: Click the Device # button. The Encoding window appears (Figure 2-3). Choose the video input format which depends on the video device. The available options include: 1920x1080 (60p) (6000kps – 20000kps) 1920x1080 (59.
HDC-502E SDK (Windows) bitrate (must be in the range of video format). When “CBR” is selected, the “Bitrate” text box is displayed. When “VBR” is selected, the “Average bitrate” and “Peak bitrate” text boxes are displayed. Close the window to save the settings. Figure 2-3: Encoding Settings Step 5: Repeat Step 2 ~ Step 4 to configure the connected input device.
HDC-502E SDK (Windows) 2.3 Video Capture To use the HDCapture SDK to capture video, follow the steps below. Step 1: Click Start to start capturing video (Figure 2-4). Figure 2-4: Capturing Video Step 2: Click Stop to stop capture.
HDC-502E SDK (Windows) Chapter 3 3 API Introduction Page 25
HDC-502E SDK (Windows) 3.1 Build Environment The API build environment requirements are listed below. If build environment is not Microsoft Visual Studio 2005 SP1 or latter, you need to install Microsoft Visual C++ 2005 SP1 Redistributable Package (x86). Microsoft Windows XP SP2 32-bit Microsoft Windows 7 32-bit/64-bit DirectX SDK – August 2007 Windows SDK for Windows Vista (6.0.6000) Microsoft .NET Framework 2.0/3.0/3.5/4.
HDC-502E SDK (Windows) 3.2.1 DeviceMan API Introduction There are one enum, one structure and two functions in DeviceMan.dll. The source codes are listed below for reference. typedef struct _CardList_T { // Card category. int iCategory; // UI No, usually is the slot No. int iUINo; // Bus No. int iBusNo; // Device number. int iDeviceNum; // Transmitter number. int iTransmitterNum; // Device No of each device. int iDeviceNo[4]; // Device information of each device.
HDC-502E SDK (Windows) // Unicode to ASCII failed. DEVICE_MAN_RESULT_UTOA_FAILED, DEVICE_MAN_RESULT_INVALID_HANDLE, DEVICE_MAN_RESULT_BUF_ERR_MAXIMUM, DEVICE_MAN_RESULT_BUF_ERR_LENGTH, DEVICE_MAN_RESULT_BUF_ERR_OVER_MAX, // Input parameter error. DEVICE_MAN_RESULT_PARAMETER_ERROR, // Memory allocate failed. DEVICE_MAN_RESULT_MEM_ALLOC_FAILED, // No capture card. DEVICE_MAN_RESULT_NO_CARD, // Get UI No. failed. DEVICE_MAN_RESULT_GET_UI_NO_FAILED, // Get bus No. failed.
HDC-502E SDK (Windows) Parameter: ot_ipCardNum: Integer pointer of card number. ot_ppCardList: Void pointer of card list. Return: An integer, see enum type. 3.2.2 CPLDMan API Introduction The CPLDMan.dll is the same with the DeviceMan.dll. The detail usage can be found in the source code.
HDC-502E SDK (Windows) 1. CPLDManGetVersion(int* ot_ipVerYear,int* ot_ipVerMonth, int* ot_ipVerDay) Description: Get CPLDMan.dll version. Parameter: ot_ipVerYear : Integer pointer of year version. ot_ipVerMonth: Integer pointer of month version. ot_ipVerDay: Integer pointer of day version. Return: An integer, see enum type. 2. CPLDManInitialize(); Description: Initialize CPLD library. Parameter: N/A. Return: An integer, see enum type. 3. CPLDManUninitialize(); Description: Uninitialize CPLD library.
HDC-502E SDK (Windows) Description: Close CPLD. Parameter: in_iBusNo: Bus No. of CPLD. Return: An integer, see enum type. 6. CPLDManCodecVideoSrcGet(int in_iBusNo, int in_iCodecNo, int* ot_ipValue) Description: Get video source of codec. Parameter: iBusNo: Bus No. of CPLD. in_ iCodecNo: Codec No. ot_ipValue: Integer pointer of video source, used in get funcion. Return: An integer, see enum type. 7.
HDC-502E SDK (Windows) An integer, see enum type. 9. CPLDManTXVideoSrcSet(int in_iBusNo, int in_iTXNo, int in_iValue) Description: Set video source of transmitter. Parameter: iBusNo: Bus No. of CPLD. in_ iTXNo: Transmitter No. in_iValue: Video source, used in set function. Return: An integer, see enum type. 10. CPLDMan8051Version(int in_iBusNo, int* ot_ipValue); 11. CPLDManCPLDVersion(int in_iBusNo, int* ot_ipValue); 12.
HDC-502E SDK (Windows) 3.2.3 Mb86H55rebDll API Introduction The Mb86H55rebDll API only has C# version now. The detail usage can be found in the source code. 3.2.4 Role of Mb86H55rebDll API C# Application Layer Mb86H55rebDll API ApCmn.dll ApScenario.dll DumpFile.dll PushFileSource2.dll Capture Card The application can use Mb86H55rebDll API to control capture card. 3.2.5 Using Mb86H55rebDll API Step 1: Put the “ApCmn.dll”, “ApScenario.dll”, “DumpFile.dll”, “Mb86H55rebDll.dll” and “PushFileSource2.
HDC-502E SDK (Windows) Step 3: Declare variable to control MB86H55 as below: Mb86H55reb mb86h55reb = new Mb86H55reb; Step 4: Add the following event handler: protected override void WndProc(ref Message m) { DoMb86h55Events(ref m); base.WndProc(ref m); } private void DoMb86h55Events(ref Message m) { Mb86H55reb.AsyncEventResult result; string comment; result = mb86h55reb.
HDC-502E SDK (Windows) mb86h55reb.Reset(); break; case Mb86H55reb.AsyncEventResult.OperationCancel: break; case Mb86H55reb.AsyncEventResult.Warning: break; case Mb86H55reb.AsyncEventResult.SeriousError: break; case Mb86H55reb.AsyncEventResult.HdmiCableStatusChanged: break; case Mb86H55reb.AsyncEventResult.OperationContinue: break; case Mb86H55reb.AsyncEventResult.AudioStatusChanged: break; default: break; } } void SystemEvents_PowerModeChanged(object sender, Microsoft.Win32.
HDC-502E SDK (Windows) mb86h55reb.SetCanvasHandle(mPnlCanvas.Handle); mb86h55reb.ApplyGpio(); mb86h55reb.RebootFirm(); SetScreenMode(ScreenMode.Processing); mb86h55reb.Reset(); break; } } Step 6: Before using MB86H55REB, it must be initialized: mb86h55reb.Close(); mb86h55reb.DirectShowEnabled(miChipNo, mbDirectShowEnabled); mbIsMb86h55rebOpened = mb86h55reb.Open(miChipNo,this.Handle); mb86h55reb.SetCanvasHandle(mPnlCanvas.Handle); mb86h55reb.ApplyGpio(); mb86h55reb.RebootFirm(); mb86h55reb.
HDC-502E SDK (Windows) 1. FMBVideoFormatEnum h264VideoFormat Video formate. enum FMBVideoFormatEnum { FMBEnmVideoFmt1920x1080, FMBEnmVideoFmt1440x1080, FMBEnmVideoFmt1280x720, FMBEnmVideoFmt720x480, FMBEnmVideoFmt720x576, EnmVideoNumofFmt }; 2. FMBVideoFrameEnum h264VideoFrame Video frame rate. enum FMBVideoFrameEnum { FMBEnmVideoFrm_60p, FMBEnmVideoFrm_5994p, FMBEnmVideoFrm_50p, FMBEnmVideoFrm_60i, FMBEnmVideoFrm_5994i, FMBEnmVideoFrm_50i, EnmVideoNumofFrm }; 3.
HDC-502E SDK (Windows) 4. int h264VideoBitrateCbr Video CBR bitrate value. 5. int h264VideoBitrateAverage Video average bitrate for VBR. 6. int h264VideoBitratePeak Video peak bitrate for VBR. 7. int[] h264Pids = new int[(int)PidTypeEnum.EnmPidNumofPid]; PID value array. enum PidTypeEnum { EnmPidVideo, EnmPidAudio, EnmPidPmt, EnmPidSit, EnmPidPcr, EnmPidNumofPid }; 8. FMBFuncModeEnum operationMode Operation mode. enum FMBFuncModeEnum { FMBEnmFuncModeEnc, FMBEnmFuncModeDec, }; 9.
HDC-502E SDK (Windows) 10. bool isStreamRunning Get is stream runnging. API 1. bool Open(int pciNoArg, IntPtr hWnd) Description: Open device. Parameter: pciNoArg: Device (chip) No. hWnd: Window handle. 2. void Close() Description: Close device. 3. void Encode() Description: The encode is begun. 4. void Decode() Description: The decode is begun. 5. void Stop() Description: The stop is begun. 6. void Reset() Description: The reset is begun. 7.
HDC-502E SDK (Windows) Parameter: m: Value of message comment: Comment form me Return: Value of AsyncEventResult public enum AsyncEventResult { UnknownEvent, OperationContinue, OperationComplete, OperationCompleteStop, OperationCompleteAutoStop, OperationCancel, Warning, SeriousError, HdmiCableStatusChanged, AudioStatusChanged, } 8. bool Equals(ref Mb86H55reb target) Description: Oneself is compared with the argument. Parameter: target: target Return: true:equal, false:not equal. 9.
HDC-502E SDK (Windows) 11. void RebootFirm() Description: Firm is rebooted. 12. void SetChipNo(int in_iChipNo) Description: Set device (chip) No. This function will change the chip ID, use it be carefully. Parameter: in_iChipID: Chip ID. in_iBusNumber: Bus No. in_iDevNumber: Device No. 13. void DirectShowEnabled(int in_iChipNo, bool in_bFlag) Description: Enable / disable DirectShow. Parameter: in_iChipNo: Chip No. in_bFlag: true is enabled, false is disabled.
HDC-502E SDK (Windows) 3.3 DirectShow Graph 3.3.
HDC-502E SDK (Windows) 3.4 Architecture of SDK Chip / codec / device usually means the same thing. HDCapture SDK C# Application DeviceMan.dll CPLDMan.dll Mb86H55rebDll.dll Control CPLD. Get capture card information Ex: Get / Set video source. CPLD OS Control chip / codec / device. Ex: Encode / Decode.
HDC-502E SDK (Windows) Chapter 4 4 FAQ Page 44
HDC-502E SDK (Windows) Q: Capture card, driver, application and input source are ready, but there is no image on the display or the image is displayed incorrectly. A: The proper video codec is needed to display H.264 video image. For example: ffdshow codec. Q: How do I check the current DirectX version? A: In Windows, navigate to Start Æ Run Æ Type ‘dxdiag’ Æ Enter. The current version is displayed in the DirectX Diagnostic Tool window.
HDC-502E SDK (Windows) Appendix A A Error Code Page 46
HDC-502E SDK (Windows) A.1 Error Code Overview Error register (M_ERROR_INFO_H and M_ERROR_INFO_L) Name M_ERROR_INFO_H M_ERROR_INFO_L Bit 15…….…..….8 7…………….0 15…………………………....0 Field ERROR_ MODULE[7:0] ERROR_STATUS[23:0] A.2 ERROR_MODULE[7:0] Module where the error occurred. The table below outlines the relationship between values and modules.
HDC-502E SDK (Windows) A.3 ERROR_STATUS[23:0] Detailed error cause. The relationship between the values and error causes is described in the following sections. A.3.
HDC-502E SDK (Windows) A.3.
HDC-502E SDK (Windows) 0x00_000A 0x00_000B ANOTHER_SMES_ACK_ BEFORE_SMES SMES_ACK_CC_ NOT_CONTINUOUS An acknowledge was received althought no subsequent system message was sent The system command parameter continuity_counter values are not consecutive Before reception of a system 0x00_000C SMES_ACK_NOT_RECIEVED message acknowledge, the next message was generated 0x03 0x00_000D INNER_ERROR ETOP internal error 0x00_000E EVENT_QUEUE_OVERFLOW The event queue overflowed BACKGROUND The value of t
HDC-502E SDK (Windows) A stream buffer overwrite was 0x00_0004 STRM_BUF_OVERWRITTEN 0x00_0005 INVALID_HOST_CMD Invalid HOSTCMD event 0x00_0006 INVALID_EVENT Invalid event 0x00_0007 FIFO_OVERFLOW Some idx_fifo overflowed 0x00_0008 FIFO_EMPTY Some idx_fifo became empty 0x00_0009 INVALID_MUXCMD 0x00_000A INVALID_PARAM 0x00_0001 INVALID_INIT_PARAM detected Invalid command to the multiplexing section Invalid parameter Invalid initialization parameter value There is a problem concerning 0x
HDC-502E SDK (Windows) 0x08 SMUX 0x00_0001 NG Unclassified SUX internal error 0x00_0002 INVALID_HOST_CMD Invalid HOSTCMD event 0x00_0003 INVALID_EVENT Invalid event 0x00_0004 INVALID_EVENT_SOURCE Invalid event issuer 0x00_0005 INVALID_EVENT_PARAM Invalid event parameter 0x00_0006 INVALID_PARAM Invalid parameter 0x00_0007 START_STC STC start processing error 0x00_0008 FIRST_PCR FIRST_PCR processing error 0x00_0009 FIRST_PAT FIRST_PAT processing error INVALID_ VMUX or AMUX state
HDC-502E SDK (Windows) A.3.
HDC-502E SDK (Windows) The system command parameter 0x00_000A SCMD_CC_NOT_CONTINUOUS continuity_counter values are not consecutive 0x00_000B INVALID_VIDEO_CPU_STATE 0x00_000C INVALID_AUDIO_CPU_STATE 0x00_000D 0x00_000E 0x00_000F ERROR_NOTIFIED_ FROM_VIDEO_CPU ERROR_NOTIFIED_ FROM_AUDIO_CPU INNER_ERROR The state of the video section is invalid The state of the audio section is invalid Error notification from the video section (details are displayed in the error register V_ERROR_INFO) Error notifi
HDC-502E SDK (Windows) The initialization dedicated 0x00_0004 INVALID_INIT_PARAM 0x00_0005 INVALID_VIDEO_OUT_STATE 0x00_0006 INVALID_AUDIO_OUT_STATE parameter register V is invalid The state of the video output hardware is invalid The state of the audio output hardware is invalid INVALID_ The STC state of the video output VIDEO_OUT_STC_STATE hardware is invalid INVALID The STC state of the audio output _AUDIO_OUT_STC+STATE hardware is invalid 0x00_0009 INNER_ERROR VPLAY module internal err
HDC-502E SDK (Windows) The initialization dedicated 0x00_0002 0x00_0003 0x00_0004 0x00_0005 0x00_0006 Invalid HOSTCMD event HOSTCMD_EVENT UNACCEPTABLE_ AUDIO_OUT_CONTROL_EVENT Invalid AUDIO_ OUTPUT_ CONTROL event UNACCEPTABLE_ Invalid AUDIO_ AUDIO_OUT_DONE_EVNET OUTPUT_DONE event INVALID_AUDIO_OUT_STATE The state of the audio output hardware is invalid AUDIO_OUT_STC_STATE hardware is invalid 0x00_0008 INVALID_MUTE_CONTROL Invalid mute control was used 0x00_0009 NEXT_AFRAME_IDX_CONFLICT
HDC-502E SDK (Windows) 0x0D SDMX 0x00_0005 INNER_ERROR 0x00_0006 DEMUX_INNER_ERROR 0x00_0001 FIFO_OVERFLOW An FIFO overflow occurred 0x00_0002 INVALID_PARAM Invalid argument 0x00_0003 INVALID_INIT_PARAM 0x00_0004 INVALID_DEMUX_STATE 0x00_0005 SEQ_NUM_UNCNAHGED 0x00_0006 0x00_0007 0x00_0008 0x0E SAPI Stream splitting hardware internal error The initialization dedicated parameter register M is invalid The state of the stream splitting hardware is invalid seq_num is the same as the valu