IEI Integration HDC-4x-SDK User Manual

IEI Technology Corp.
User Manual
HDC-4x Series SDK (Windows)
MODEL:
HDC-4x Series SDK (Windows)
A SDK software development kit for the HDC-4x Series
Rev. 2.00 – 3 October, 2012
Page 1
Date Version Changes
3 October, 2012 2.00 Updated for software version v2.00
21 June, 2011 1.00 Initial release
HDC-4x Series SDK (Windows)
Revision
Page 2
HDC-4x Series SDK (Windows)
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.
This document contains proprietary information protected by copyright. All rights are
Copyright
reserved. No part of this manual may be reproduced by any mechanical, electronic, or other means in any form without prior written permission of the manufacturer.
TRADEMARKS
All registered trademarks and product names mentioned herein are used for identification purposes only and may be trademarks and/or registered trademarks of their respective owners.
Page 3
HDC-4x Series SDK (Windows)
Table of Contents
1 DRIVER AND SDK INSTALLATION........................................................................ 6
1.1 OVERVIEW.................................................................................................................. 7
1.2 DRIVER INSTALLATION............................................................................................... 8
1.2.1 Uninstall Driver................................................................................................11
1.3 SOFTWARE INSTALLATION .........................................................................................11
1.3.1 System Requirements.........................................................................................11
1.3.2 HDCapture SDK Installation........................................................................... 12
1.3.3 Uninstall HDCapture SDK..............................................................................15
2 HDCAPTURE SDK APPLICATION.........................................................................17
2.1 HDCAPTURE SDK OVERVIEW................................................................................. 18
2.2 VIDEO CAPTURE....................................................................................................... 18
2.3 VIDEO DECODING .................................................................................................... 21
2.4 VIDEO BYPASS ......................................................................................................... 22
3 API INTRODUCTION................................................................................................ 24
3.1 BUILD ENVIRONMENT.............................................................................................. 25
3.2 API INTRODUCTION.................................................................................................. 25
3.2.1 DeviceMan API Introduction........................................................................... 26
3.2.2 CPLDMan API Introduction............................................................................ 28
3.2.3 Mb86H55rebDll API Introduction................................................................... 32
3.2.4 Role of Mb86H55rebDll API ...........................................................................32
3.2.5 Using Mb86H55rebDll API............................................................................. 32
3.2.6 Mb86H55rebDll API Description....................................................................35
3.3 DIRECTSHOW GRAPH............................................................................................... 41
3.3.1 Encoding Graph............................................................................................... 41
3.4 ARCHITECTURE OF SDK........................................................................................... 42
4 FAQ ............................................................................................................................... 43
A ERROR CODE............................................................................................................ 45
A.1 ERROR CODE OVERVIEW......................................................................................... 46
Page 4
HDC-4x Series SDK (Windows)
A.2 ERROR_MODULE[7:0]........................................................................................ 46
A.3 ERROR_STATUS[23:0] ........................................................................................ 47
A.3.1 IDLE................................................................................................................47
A.3.2 ENC ................................................................................................................. 48
A.3.3 DEC................................................................................................................. 52
Page 5
HDC-4x Series SDK (Windows)
Chapter
1
1 Driver and SDK
Installation
Page 6
HDC-4x Series 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.
This manual includes SDK information for the HDC-4x Series, which includes:
HDC-401 HDC-401E
NOTE:
The Found New Hardware Wizard will automatically start when the system detects the video capture card (see the image below). Click Cancel to exit the wizard and follow the steps described in this chapter to install the driver and the HDCapture SDK.
Page 7

1.2 Driver Installation

To install the HDC-4x Series SDK (Windows) driver, please follow the steps below: If the
HDC-4x Series SDK (Windows)
HDC-4x Series SDK (Windows) driver is already installed, please refer to Section uninstall the driver first.
NOTE:
If the User Access Control dialog box appears during installation, click Yes to continue.
Step 1: Make sure to log in the system as the administrator.
Step 2: Insert the driver CD.
Step 3: Locate the “Driverinstaller.bat” file in the driver CD. Double click it.
Step 4: A confirmatio n wind ow appears. Click Install.
1.2.1 to
Page 8
Figure 1-1: Windows Security
Step 5: If the following window appears, click Install this driver software Anyway.
HDC-4x Series SDK (Windows)
Figure 1-2: Windows Warning Window
Step 6: The Device Driver Installation Wizard appears. Click Next to start.
Figure 1-3: Device Driver Installation Wizard
Step 7: The driver starts to install a nd the screen in
Figure 1-4 appears.
Page 9
HDC-4x Series SDK (Windows)
Figure 1-4: Driver Installing
Step 8: When the driver installation is complete, the screen in
the Finish button to finish driver installation.
Figure 1-5: Driver Installation Complete
Figure 1-5 appears. Click
Page 10
Step 9: Check the device manager in the Windows control panel to ensure the driver
(MB86H55-REB PCI and WinDriver) has been properly installed (
Figure 1-6).
HDC-4x Series SDK (Windows)
Figure 1-6: Device Manager

1.2.1 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.

1.3 Software Installation

The HDC-4x Series SDK (Windows) 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
Page 11
Microsoft Windows 7 32-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.0  Microsoft DirectX 9.0c  Win7DSFilterTweaker tool (for Windows 7 OS only)  Visual C++ 2005 & 2008 Redistributable
Please download the setup files of these programs from the official websites and install these programs in the system. For detailed setup procedures for some of the above programs, please refer to Appendix A.

1.3.2 HDCapture SDK Installation

HDC-4x Series SDK (Windows)
To install the HDCapture SDK, please follow the steps below.
Step 1: Insert the driver CD.
Step 2: Locate the HDCaptureSDK_x86_Vxxxx.msi file in the driver CD
(HDCaptureSDK_x86_VxxxxR.msi R: released version; HDCaptureSDK_x86_VxxxxD.msi D: debug version). Double click the setup file to start the installation. The user ca n also download the latest setup file from IEI website.
Step 3: The HDCapture Setup Wizard welcome window appears. Click Next to start.
Page 12
HDC-4x Series SDK (Windows)
Figure 1-7: HDCapture Setup Wizard
Step 4: Select a folder for HDCapture installation in
Figure 1-8. Click Next to continue.
Figure 1-8: Select Installation Folder
Step 5: The following screen appears. Click Next to confirm the installation.
Page 13
HDC-4x Series SDK (Windows)
Figure 1-9: Confirm Installation
Step 6: The system starts installing the HDCapture.
Step 7: If an error happens during the installation (as shown in
Continue to continue the installation.
Figure 1-10: Installation Error Messages
Figure 1-10), click
Page 14
HDC-4x Series SDK (Windows)
NOTE:
Since "DumpFile.dll" and "PushFileSource2.dll " are DirectShow filters, the user must register them before use. If the error described in Step 7 occurs, please use one of the following methods to register after the HDCapture SDK installation:
1. Start Menu -> Programs -> HDCapture SDK V1.01 -> InstallFilter. or
2. Go to the installation folder and click InstallFilter.bat.
Step 8: When the HDCapture is successfully installed, the following window appears.
Click Close to exit. Step 0:
Figure 1-11: 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-12).
Page 15
HDC-4x Series SDK (Windows)
Figure 1-12: Uninstall HDCapture SDK
Step 3: A confirmatio n wind ow appears. Click Yes to uninstall the HDCapture SDK.
Page 16
HDC-4x Series SDK (Windows)
2 HDCapture SDK
Chapter
2
Application
Page 17

2.1 HDCapture SDK Overview

The HDCapture SDK is a video capture tool that allows user to capture video through the DVI-I input port in Windows environment. The HDCapture SDK also includes decoding function that decodes the video signal for video output to the DVI-enabled display device.

2.2 Video Capture

To use the HDCapture SDK to capture video, follow the steps below. If the older version of
HDC-4x Series SDK (Windows)
the HDCapture SDK is already installed, please refer to Section
Step 1: Launch the HDCapture SDK. The Device Setting button (Device 0) is on the
right side panel of the HDCapture SDK ( HDCapture SDK is 1280x1024 or above.
Figure 2-1). The best resolution to view
1.3.3 to uninstall it.
Page 18
Figure 2-1: HDCapture SDK
Step 2: Enable and configure the device settings by clicking the Device 0 button.
HDC-4x Series SDK (Windows)
Step 3: The Encoding window appears (Figure 2-2). Choose the video input format.
There are multiple video format options, but only two options are for the
HDC-4x Series SDK (Windows). They are:
1920x1080 (60p) (6000kps – 30000kps) 1280x720 (60p) (4000kps – 24000kps)
NOTE:
Which video format to choose depends on the video input resolution and the selected mode set by the HDC-4x Series SDK (Windows) rotary switch. If the selected mode supports 720p resolution, select 1280x720 (60p) despite of what the video input resolution is. If the selected mode supports 1080p resolution, select 1920x1080 (60p).
If the selected mode supports 720p or 1080p resolution, the decision is made by the video input resolution.
Select 1280x720 (60p) if both width and height numbers of the video
input resolution are less than 1280 and 720. For example: 800x600.
Select 1920x1080 (60p) if either width or height number of the video
input resolution is greater than 1280 or 720. For example: 1024x768.
To understand what resolutions the modes set by the rotary switch support, please refer to the HDC-4x Series user manual.
The user can also refer to Appendix B in the HDC-4x Series user manual for tables of the supported input resolution and the corresponding video format to select.
Step 4: Configure the encoding settings (Figure 2-2), including encoding file directory
(click Ref button to choose the directory), rate control (CBR or VBR) and video encoding bitrate (must be in the range of video format). When “CBR” is sele cted, the “Bitrate” text box is displayed. When “VBR” is selected, the “Average bitrate”
Page 19
and “Peak bitrate” text boxes are displayed. Close the window to save the settings.
HDC-4x Series SDK (Windows)
Figure 2-2: Encoding Settings
Step 5: Click Start
Click
to start capture the video. Click Stop to stop capture.
to reboot the device without turning off the system. Step 0:
Page 20
HDC-4x Series SDK (Windows)
Figure 2-3: Video Capture Control
NOTE:
If some error messages show under the display screen, click the Clear button to clear the error messages.

2.3 Video Decoding

The HDCapture SDK also includes decoding function that decodes the video signal for video output to the DVI-enabled display device. To decode a captured video clip, follow the steps below.
Step 1: Launch the HDCapture SDK.
Page 21
Step 2: Bring up the Decoding page by clicking one of the Device 0 button. Click the
Decoding tab to access the decoding page.
HDC-4x Series SDK (Windows)
Step 3: Click Ref button
Step 4: Select the video format of the selected video clip. The video format selected
here must be the same with the video format of the file selected in the previous step.
to locate a video file in the computer to decode.
Figure 2-4: Decoding Settings
Step 5: Close the window to save the settings.
Step 6: Click Operation Start

2.4 Video Bypass

To view the video input source on DVI display device in real time, please follow the steps below.
Page 22
to start decoding the selected video. Step 0:
HDC-4x Series SDK (Windows)
Step 1: Launch the HDCapture SDK.
Step 2: Connect the DVI cable from DVI display device to the DVI-I output port of the
HDC-4x Series SDK (Windows).
Step 3: Connect the video input source to the DVI-I input port of the HDC-4x Series SDK
(Windows).
Step 4: A blue screen shows on the DVI display device before displaying the video.
Page 23
HDC-4x Series SDK (Windows)
Chapter
3

3 API Introduction

Page 24
HDC-4x Series 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  DirectX SDK – August 2007  Windows SDK for Windows Vista (6.0.6000)  Microsoft .NET Framework 2.0/3.0/3.5/4.0 32-bit  Microsoft Visual Studio 2005 SP1
NOTE:
The DumpFile.dll and PushFileSource2.dll are filters of DirectShow.
You must register them before use them, otherwise you will get an error.

3.2 API Introduction

NOTE:
If API usage in document is different from API usage in SDK source code, the API usage in SDK source code is CORRECT.
Page 25

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.
HDC-4x Series SDK (Windows)
int iDeviceNum; // Transmitter number. int iTransmitterNum; // Device No of each device. int iDeviceNo[4]; // Device information of each device. char cDeviceInfo[4 * MAX_BUFFER_SIZE]; // Transmitter information of each device. char cTransmitterInfo[4 * MAX_BUFFER_SIZE]; } CardList_T;
and the MAX_BUFFER_SIZE is 512.
enum
{ DEVICE_MAN_RESULT_SUCCESS = 0,
Page 26
DEVICE_MAN_RESULT_NULL_ADDRESS, // ASCII to Unicode failed. DEVICE_MAN_RESULT_ATOU_FAILED,
HDC-4x Series 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. DEVICE_MAN_RESULT_GET_BUS_NO_FAILED, // Get information failed. DEVICE_MAN_RESULT_GET_INFO_FAILED, // CPLD check failed. DEVICE_MAN_RESULT_CPLD_FAILED, DEVICE_MAN_RESULT_UNKNOWN_ERROR };
1. DeviceManGetVersion(int* ot_ipVerYear,int* ot_ipVerMonth,int* ot_ipVerDay) Description: Get DeviceMan.dll verion. 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. DeviceManGetCardList(int* ot_ipCardNum, void** ot_ppCardList) Description: Get capture card list.
Page 27
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.
enum
{ CPLD_RESULT_SUCCESS = 0,
HDC-4x Series SDK (Windows)
CPLD_RESULT_MEM_ALLOC_FAILED, CPLD_RESULT_LIB_INITIALIZED, CPLD_RESULT_LIB_UNINITIALIZED, CPLD_RESULT_LIB_INITIALIZE_FAILED, CPLD_RESULT_LIB_UNINITIALIZE_FAILED, CPLD_RESULT_OPENED_NUMBER_OVER, CPLD_RESULT_OPEN_FAILED, CPLD_RESULT_INVALID_CERTIFICATE, CPLD_RESULT_INVALID_PARAMETER, CPLD_RESULT_VIDEO_SOURCE_GET_FAILED, CPLD_RESULT_VIDEO_SOURCE_SET_FAILED, CPLD_RESULT_VIDEO_RESOLUTION_NO_OUTPUT, CPLD_RESULT_VIDEO_RESOLUTION_NO_HDMI, CPLD_RESULT_VIDEO_RESOLUTION_INVALID, CPLD_RESULT_VIDEO_RESOLUTION_GET_FAILED, CPLD_RESULT_VERSION_8051_GET_FAILED, CPLD_RESULT_VERSION_CPLD_GET_FAILED,
Page 28
CPLD_RESULT_VERSION_FPGA_GET_FAILED };
HDC-4x Series 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. Parameter: N/A. Return: An integer, see enum type.
4. CPLDManOpen(int in_iBusNo) Description: Open CPLD. Parameter: in_iBusNo: Bus No. of CPLD. Return: An integer, see enum type.
5. CPLDManClose(int in_iBusNo)
Page 29
Description: Close CPLD. Parameter: in_iBusNo: Bus No. of CPLD. Return: An integer, see enum type.
HDC-4x Series SDK (Windows)
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. CPLDManCodecVideoSrcSet(int in_iBusNo, int in_iCodecNo, int in_iValue) Description: Set video source of codec. Parameter: iBusNo: Bus No. of CPLD. in_ iCodecNo: Codec No. in_iValue: Video source, used in set function. Return: An integer, see enum type.
8. CPLDManTXVideoSrcGet(int in_iBusNo, int in_iTXNo, int* ot_ipValue) Description: Get video source of transmitter. Parameter:
Page 30
iBusNo: Bus No. of CPLD. in_ iTXNo: Transmitter No. ot_ipValue: Integer pointer of video source, used in get funcion. Return:
HDC-4x Series 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. CPLDManFPGAVersion(int in_iBusNo, int* ot_ipValue); Description: Get firmware version of 8051 / CPLD / FPGA. Parameter: in_iBusNo: Bus No. of CPLD. ot_ipValue: Integer pointer of firmware version. Return: An integer, see enum type.
Page 31

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

HDC-4x Series SDK (Windows)
C# Application Layer
Mb86H55rebDll API
ApCmn.dll
DumpFile.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
ApScenario.dll
PushFileSource2.dll
Page 32
“PushFileSource2.dll” in the folder where execution file exist.
NOTE:
The DumpFile.dll and PushFileSource2.dll are filters of DirectShow. The user must register them before using them, otherwise an error will occur.
Step 2: Use name space:
using Mb86H55rebDll;
HDC-4x Series 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.OnMsg(ref m, out comment); UpdateScreenAfterEvents(result, comment); }
Step 5: In the function UpdateScreenAfterEvents(),other control functions can be added
according to the purpose. For example: Error message report function.
private void UpdateScreenAfterEvents(Mb86H55reb.AsyncEventResult result, string comment)
{ switch (result) { case Mb86H55reb.AsyncEventResult.OperationComplete: break; case Mb86H55reb.AsyncEventResult.OperationCompleteStop: mb86h55reb.Reset(); break; case Mb86H55reb.AsyncEventResult.OperationCompleteAutoStop:
Page 33
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;
HDC-4x Series SDK (Windows)
case Mb86H55reb.AsyncEventResult.AudioStatusChanged:
break;
default: break; } }
void SystemEvents_PowerModeChanged(object sender,
Microsoft.Win32.PowerModeChangedEventArgs e) {
switch (e.Mode)
{
case Microsoft.Win32.PowerModes.Suspend:
mb86h55reb.Close(); break;
Page 34
case Microsoft.Win32.PowerModes.Resume:
mb86h55reb.DirectShowEnabled(miChipNo, mbDirectShowEnabled); mbIsMb86h55rebOpened = mb86h55reb.Open(miChipNo,this.Handle);
HDC-4x Series 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,thi s.Han dle); mb86h55reb.SetCanvasHandle(mPnlCanvas.Handle); mb86h55reb.ApplyGpio(); mb86h55reb.RebootFirm(); mb86h55reb.Reset();
Step 7: Refer the following function for detail:
frmMain_Load() SystemEvents_PowerModeChanged() cmbBoardSelection_SelectedIndexChanged()

3.2.6 Mb86H55rebDll API Description

Simplify description of Mb86H55rebDll variable, interface and API. Refer to the source code to get the detail usage.
Variable:
1. string h264FileName Encode / decode file name.
Page 35
Interface
1. FMBVideoFormatEnum h264VideoFormat Video formate.
enum FMBVideoFormatEnum
{
FMBEnmVideoFmt1920x1080,
FMBEnmVideoFmt1440x1080, FMBEnmVideoFmt1280x720, FMBEnmVideoFmt720x480, FMBEnmVideoFmt720x576, EnmVideoNumofFmt
};
HDC-4x Series SDK (Windows)
2. FMBVideoFrameEnum h264VideoFrame Video frame rate.
enum FMBVideoFrameEnum
{
FMBEnmVideoFrm_60p,
FMBEnmVideoFrm_5994p, FMBEnmVideoFrm_50p, FMBEnmVideoFrm_60i, FMBEnmVideoFrm_5994i, FMBEnmVideoFrm_50i, EnmVideoNumofFrm
};
3. FMBVideoRateCtlEnum h264VideoRateCtl Video rate control.
Page 36
enum FMBVideoRateCtlEnum
{
FMBEnmVideoRateCtlCbr, FMBEnmVideoRateCtlVbr,
HDC-4x Series 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. int pciNo Get current PCI / chip No.
Page 37
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()
HDC-4x Series SDK (Windows)
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:
Page 38
The reset is begun.
7. AsyncEventResult OnMsg(ref Message m, out string comment) Description:
HDC-4x Series SDK (Windows)
It is processed to receive the message. 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. void CommitProperty() Description: The change in property is committed.
10. void ApplyGpio() Description: Property is applied to the GPIO device.
Page 39
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.
HDC-4x Series SDK (Windows)
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.
Page 40
HDC-4x Series SDK (Windows)

3.3 DirectShow Graph

3.3.1 Encoding Graph

Input Source
Source Filter
(MB86H55-REB)
Dump Filter
File in HDD
Page 41

3.4 Architecture of SDK

Chip / codec / device usually means the same thing.
HDC-4x Series SDK (Windows)
HDCapture SDK
C# Application
Get capture card information
OS
CPLDMan.dll DeviceMan.dll Mb86H55rebDll.dll
Control CPLD. Ex: Get / Set video source.
CPLD
Control chip / codec / device. Ex: Encode / Decode.
Chip
Page 42
Codec Device
HDC-4x Series SDK (Windows)
Chapter
4
4

FAQ

Page 43
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.
Q: Input source and encoding are both set to 1080 60p, but the application cannot
HDC-4x Series SDK (Windows)
encode.
A: The chip is critical for input stream timing. Make sure the input stream frequency is 1080 60p.
Q: How do I obtain the latest driver?
A: Go to
from the “Support” pages.
http://www.ieiworld.com/. You can always find and download the latest drivers
Page 44
HDC-4x Series SDK (Windows)
Appendix
A
A
Error Code
Page 45

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
HDC-4x Series SDK (Windows)
Field
ERROR_ MODULE[7:0]

A.2 ERROR_MODULE[7:0]

Module where the error occurred. The table below outlines the relationship between values and modules.
Value Module Name Function Mode 0x00 HOSTCMD Host communication library ENC, DEC 0x01 ETOP Recorder-wide controller ENC 0x02 DTOP Player-wide controller DEC 0x03 BACKGROUND Interrupt controller ENC, DEC 0x04 VREC Video input controller ENC 0x05 VMUX Video multiplex controller ENC 0x06 AREC Audio input controller ENC
ERROR_STATUS[23:0]
Page 46
0x07 AMUX Audio multiplex controller ENC 0x08 SMUX System multiplex controller ENC 0x09 VPLAY Video playback controller DEC 0x0A VDMX Video decode controller DEC 0x0B APLAY Audio playback controller DEC 0x0C ADMX Audio decode controller DEC 0x0D SDMX System stream controller DEC 0x0E SAPI Serial communication controller ENC, DEC
HDC-4x Series 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.1 IDLE

ERROR_MODULE[7:0] ERROR_MODULE[23:0]
Value
0x00
Name Value Name
0x00_0001 INVALID_SCMD_CMD_ID
HOSTCMD
0x00_0002 SCMD_CC_NOT_CONTINUOUS
HOSTCMD_ERR_SCMD_
0x00_0003
UNACCEPTABLE_FIRMWARE
Outline
The system command parameter cmd_id is invalid The system command parameter continuity_counter values are not consecutive
Incorrect firmware
Page 47

A.3.2 ENC

HDC-4x Series SDK (Windows)
ERROR_MODULE[7:0] ERROR_MODULE[23:0] Value Name Value Name
0x00_0001 INVALID_SCMD_CMD_ID
0x00 HOSTCMD
0x01 ETOP
0x00_0002 SCMD_CC_NOT_CONTINUOUS
HOSTCMD_ERR_SCMD_
0x00_0003
UNACCEPTABLE_FIRMWARE
0x00_0001 FIFO_OVERFLOW The event queue overflowed
0x00_0002 INVALID_SCMD_INIT_PARAM
0x00_0003 INVALID_VCMD_INIT_PARAM
Outline
The system command parameter cmd_id is invalid The system command parameter continuity_counter values are not consecutive
Incorrect firmware
An invalid value is specified in initialization dedicated parameter register M An invalid value is specified in initialization dedicated
0x00_0004 INVALID_ACMD_INIT_PARAM
0x00_0005 UNACCEPTABLE_EVENT
0x00_0006 INVALID_SCMD_CMD_ID
0x00_0007
0x00_0008
0x00_0009
ANOTHER_SCMD_ BEFORE_SCMD_ACK
SCMD_CC_NOT_ CONTINUOUS
INVALID_SMES_ACK_CMD_ID
parameter register V An invalid value is specified in initialization dedicated parameter register A An event that cannot be handled by the ETOP was received The system command parameter cmd_id is invalid A subsequent system command was received before an acknowledge was returned The system command parameter continuity_counter values are not consecutive The system command parameter cmd_id is invalid
Page 48
HDC-4x Series SDK (Windows)
0x03
BACKGROUND
0x00_000A
ANOTHER_SMES_ACK_ BEFORE_SMES
SMES_ACK_CC_
0x00_000B
NOT_CONTINUOUS
0x00_000C SMES_ACK_NOT_RECIEVED
0x00_000D INNER_ERROR ETOP internal error 0x00_000E EVENT_QUEUE_OVERFLOW The event queue overflowed
0x00_0001 INVALID_VCMD_INIT_PARAM
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 message acknowledge, the next message was generated
The value of the initialization dedicated parameter register V
0x04 VREC
0x05 VMUX
is invalid There is a problem concerning
0x00_0002 VIDEO_CPU_ACCESS
0x00_0003 FIFO_OVERFLOW Some idx_fifo overflowed 0x00_0004 FIFO_EMPTY Some idx_fifo became empty
0x00_0005
0x00_0006 UNACCEPTABLE_EVENT Invalid event
0x00_0007 INVALID_IDX
0x00_0008 INNER_ERROR VREC internal error 0x00_0009
0x00_0001 NG Unclassified VMUX internal error
0x00_0002 UNDERFLOW
UNACCEPTABLE_ HOSTCMD_EVENT
EVENT_QUEUE_OVERFLOW The event queue overflowed
communication with the video section
Invalid HOSTCMD event
The VRAW _idx value became invalid
A video stream buffer underflow was detected
0x00_0003
VBV_BOC VBV discontinuity was detected
Page 49
HDC-4x Series SDK (Windows)
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 Invalid parameter
0x00_0001 INVALID_INIT_PARAM
0x00_0002 AUDIO_CPU_ACCESS
0x00_0003 AUDI_IN
A stream buffer overwrite was detected
Invalid command to the multiplexing section
Invalid initialization parameter value There is a problem concerning communication with the audio section An error occurred during audio input access
0x06 AREC
0x07 AMUX
0x00_0004 FIFO_OVERFLOW Some idx_fifo overflowed 0x00_0005 FIFO_EMPTY Some idx_fifo became empty
0x00_0006
0x00_0007 UNACCEPTABLE_EVENT Invalid event
0x00_0008 INVALID_IDX
0x00_0009 INNER_ERROR AREC internal error 0x00_000A
0x00_0001 NG Unclassified AMUX internal error 0x00_0002 INVALID_HOST_CMD Invalid HOSTCMD event 0x00_0003 INVALID_EVENT Invalid event 0x00_0004 FIFO_OVERFLOW Some idx_fifo overflowed 0x00_0005 FIFO_EMTPY Some idx_fifo became empty
0x00_0006
UNACCEPTABLE_
Invalid HOSTCMD event
HOSTCMD_EVENT
The ARAW_idx value became invalid
EVENT_QUEUE_OVERFLOW The event queue overflowed
Invalid command to the
INVALID_MUXCMD
multiplexing section
Page 50
HDC-4x Series SDK (Windows)
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
0x08 SMUX
0x0E SAPI
0x00_0009 FIRST_PAT FIRST_PAT processing error
0x00_000A
0x00_000B AUTO_NULL_ON NULL output processing error
0x00_000C AUTO_NULL_OFF
0x00_000D STOP Stop processing error
0x00_000E
0x00_0001 OVERFLOW A buffer overflow occurred
0x00_0002
INVALID_ VMUX_AMUX_STATE
INVALID_MUXCMD
UNEXPECTED_ TRANS_DATA_IRQ
VMUX or AMUX state transition error
NILL output stop processing error
Invalid command to the multiplexing section
A data transmission completion interrupt was received when it should not have been
Error notification from the video section (details are displayed in the error register V_ERROR_INFO) Error notification from the audio section (details are displayed in the error register A_ERROR_INFO)
0xFF
(Special, tentative)
0x00_0001
0x00_0002
Page 51

A.3.3 DEC

HDC-4x Series SDK (Windows)
ERROR_MODULE[7:0] ERROR_MODULE[23:0] Value Name Value Name
0x00_0001 INVALID_SCMD_CMD_ID
0x00 HOSTCMD
0x02 DTOP
0x00_0002 SCMD_CC_NOT_CONTINUOUS
HOSTCMD_ERR_SCMD_
0x00_0003
UNACCEPTABLE_FIRMWARE
0x00_0001 FIFO_OVERFLOW An FIFO overflow occurred
0x00_0002 INVALID_SCMD_INIT_PARAM
0x00_0003 INVALID_VCMD_INIT_PARAM
Outline
The system command parameter cmd_id is invalid The system command parameter continuity_counter values are not consecutive
Incorrect firmware
The value specified in the initialization dedicated parameter register M is invalid The value specified in the initialization dedicated parameter
0x00_0004 INVALID_ACMD_INIT_PARAM
UNACCEPTABLE_
0x00_0005
STRM_INPUT_EVENT UNACCEPTABLE_
0x00_0006
STATE_CHANGE_EVENT
0x00_0007 INVALID_SCMD_CMD_ID
0x00_0008 INVALID_SCMD_SUB_CMD_ID
ANOTHER_SCMD_
0x00_0009
BEFORE_SCMD_ACK
register V is invalid The value specified in the initialization dedicated parameter register A is invalid An invalid stream input control event was received An invalid state transition notification event was received The system command parameter cmd_id is invalid The system command parameter sub_cmd_id is invalid A subsequent system command was received before an acknowledge was returned
Page 52
HDC-4x Series SDK (Windows)
The system command parameter
0x00_000A SCMD_CC_NOT_CONTINUOUS
0x00_000B INVALID_VIDEO_CPU_STATE
0x00_000C INVALID_AUDIO_CPU_STATE
ERROR_NOTIFIED_
0x00_000D
FROM_VIDEO_CPU
ERROR_NOTIFIED_
0x00_000E
FROM_AUDIO_CPU
0x00_000F INNER_ERROR DTOP internal error
0x04_xxxx
continuity_counter values are not consecutive 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 notification from the audio section (details are displayed in the error register A_ERROR_INFO)
An error occurred during processing of an interrupt from
0x03 BACKGROUND
0x09 VPLAY
the AUDIO_SPDIF output An error occurred during
0x05_xxxx
0x09_xxxx
0x0D_xxxx
0x00_0001 FIFO_OVERFLOW An FIFO overflow occurred
UNACCEPTABLE_
0x00_0002
HOSTCMD_EVENT
0x00_0003 INVALID_PARAM
processing of an interrupt from the audio output An error occurred during processing of an interrupt from the video output An error occurred during processing of an interrupt from the stream splitter
An invalid state transition instruction event was received Invalid argument
Page 53
HDC-4x Series SDK (Windows)
The initialization dedicated
0x00_0004 INVALID_INIT_PARAM
0x00_0005 INVALID_VIDEO_OUT_STATE
0x00_0006 INVALID_AUDIO_OUT_STATE
INVALID_
0x00_0007
VIDEO_OUT_STC_STATE INVALID
0x00_0008
_AUDIO_OUT_STC+STATE
0x00_0009 INNER_ERROR VPLAY module internal error
0x00_000A VIDOE_OUT_INNER_ERROR
0x00_000B AUDIO_OUT_INNER_ERROR
0x00_000C UNIMPLEMENTED
parameter register V is invalid
The state of the video output hardware is invalid The state of the audio output hardware is invalid The STC state of the video output hardware is invalid The STC state of the audio output hardware is invalid
The internal state of the video output hardware is invalid The internal state of the audio output hardware is invalid No corrective measure has been implemented
0x0A VDMX
0x0B APLAY
An urgent action was take because
0x00_000D NO_VALID_VIDEO_ES_INPUT
0x00_0001 FIFO_OVERFLOW An FIFO overflow occurred 0x00_0002 INVALID_PARAM Invalid argument
UNACCEPTABLE_
0x00_0003
HOSTCMD_EVENT
0x00_0004 INVALID_VIDEO_CPU_STATE
0x00_0005 INNER_ERROR VDMX module internal error
0x00_0006 DEMUX_INNER_ERROR
0x00_0001 FIFO_OVERFLOW
a valid video ES input delay was detected
An invalid HOSTCMD event was received The state of the video section is invalid
Stream splitting hardware internal error
An FIFO overflow occurred
Page 54
HDC-4x Series SDK (Windows)
The initialization dedicated
0x00_0002 INVALID_INIT_PARAM
UNACCEPTABLE_
0x00_0003
HOSTCMD_EVENT
UNACCEPTABLE_
0x00_0004
AUDIO_OUT_CONTROL_EVENT
UNACCEPTABLE_
0x00_0005
AUDIO_OUT_DONE_EVNET
0x00_0006 INVALID_AUDIO_OUT_STATE
INVALID_
0x00_0007
AUDIO_OUT_STC_STATE
0x00_0008 INVALID_MUTE_CONTROL Invalid mute control was used
0x00_0009 NEXT_AFRAME_IDX_CONFLICT
parameter register A is invalid
Invalid HOSTCMD event
Invalid AUDIO_ OUTPUT_ CONTROL event Invalid AUDIO_ OUTPUT_DONE event The state of the audio output hardware is invalid The STC state of the audio output hardware is invalid
The specification of the next frame was repeated
0x0C ADMX
0x00_000A INNER_ERROR
0x00_000B AUDIO_OUT_INNER_ERROR
0x00_000C UNIMPLEMENTED
INVALID_
0x00_000D
AUDIO_OUT_SPDFI_STATE AUDIO_OUT_
0x00_000E
SPDIF_INNER_ERROR
0x00_0001 FIFO_OVERFLOW An FIFO overflow occurred 0x00_0002 INVALID_PARAM Invalid argument
UNACCEPTABLE_
0x00_0003
HOSTCMD_VENT
0x00_0004 INVALID_AUDIO_CPU_STATE
The internal state of the APLAY module is invalid The internal state of the audio output hardware is invalid No corrective measure has been implemented The state of the audio output hardware (SPDIF) is invalid The internal state of the audio output hardware (SPDIF) is invalid
An invalid HOSTCMD event was received The state of the audio section is invalid
Page 55
0x00_0005 INNER_ERROR VDMX module internal error
HDC-4x Series SDK (Windows)
0x0D SDMX
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
UNACCEPTABLE_
0x00_0006
HOSTCMD_EVENT
0x00_0007 INNER_ERROR SDMX module internal state error
UNACCEPTABLE_STRM_
0x00_0008
INPUT_CONTROL_EVENT
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 value previously specified An invalid HOSTCMD event was received
An invalid STRM_ INPUT_CONTROL event was received
0x0E SAPI
0x00_0009 DEMUX_INNER_ERROR
0x00_000A INVALID_SECTION_FROMAT
0x00_0001 OVERFLOW A buffer overflow occurred
UNEXPECTED_
0x00_0002
TRANS_DATA_IRQ
The internal state of the stream splitting hardware is invalid The PSI section is in an invalid format
A data transmission completion interrupt was received when it should not have been
Page 56
Loading...