IEI Integration HDC-3x-SDK User Manual

IEI Technology Corp.
User Manual
HDC-3x Series SDK (Linux)
MODEL:
HDC-3x Series SDK (Linux)
A SDK software development kit facilitates development of
Linux-based application for the HDC-3x Series
Rev. 1.17 – 25 March, 2013
Page 1
HDC-3x Series SDK (Linux)
Revision
Date Version Changes
25 March, 2013 1.17 Updated for software version v1.17:
- Added scale and source select
- Removed One Picture Mode
- Modified menu (r157)
31 August, 2012 1.17 Updated for new software version v1.17:
- Modified menu (r137) 4 May, 2011 1.02 Added information for the HDC-302E 30 March, 2011 1.01 Added information for the HDC-301 and the HDC-301E
and renamed the manual to HDC-3x Series
13 January, 2011 1.00 Initial release
Page 2
HDC-3x Series SDK (Linux)
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-3x Series SDK (Linux)
Table of Contents
1 HDCAPTURE SDK (LINUX) ...................................................................................... 6
1.1 HDCAPTURE SDK OVERVIEW................................................................................... 7
1.2 SYSTEM REQUIREMENTS............................................................................................ 7
1.3 SOFTWARE INSTALLATION .......................................................................................... 7
1.3.1 Bin File Only...................................................................................................... 7
1.3.2 Source Code....................................................................................................... 8
1.4 LAUNCH HDCAPTURE SDK..................................................................................... 10
1.5 VIDEO CAPTURE........................................................................................................11
1.5.1 Encoding Setting...............................................................................................11
1.5.2 Encoding.......................................................................................................... 18
1.6 DECODING................................................................................................................ 20
1.6.1 Decoding Setting.............................................................................................. 20
1.6.2 Video I/O Setting.............................................................................................. 23
1.6.3 Decoding.......................................................................................................... 27
2 PROGRAMMING GUIDE......................................................................................... 30
2.1 MAIN THREAD ......................................................................................................... 31
2.2 ENCODE ................................................................................................................... 33
2.3 DECODE ................................................................................................................... 34
2.4 FUNCTIONS REFERENCE........................................................................................... 35
2.4.1 OnFmbMessage ............................................................................................... 35
2.4.2 FmbInitInfo...................................................................................................... 35
2.4.3 FmbReleaseInfo ............................................................................................... 35
2.4.4 FmbCreatDevInfoAll........................................................................................ 35
2.4.5 FmbDellDevInfoAll.......................................................................................... 36
2.4.6 FmbGetDeviceTotal......................................................................................... 36
2.4.7 FmbGetBoardTotal.......................................................................................... 36
2.4.8 FmbSetCurDeviceNum .................................................................................... 36
2.4.9 FmbGetCurDeviceNum.................................................................................... 37
2.4.10 FmbGetCurDevNumOnBoard ....................................................................... 37
2.4.11 FMBDeviceNumEnum ................................................................................... 37
Page 4
HDC-3x Series SDK (Linux)
2.4.12 FmbSetFirstDev............................................................................................. 38
2.4.13 FmbSetNextDev.............................................................................................. 38
2.4.14 DrvBootAll..................................................................................................... 38
2.4.15 MmuxInit........................................................................................................ 39
2.4.16 MmuxRelease................................................................................................. 39
2.4.17 MmuxGetVer.................................................................................................. 39
2.4.18 MmuxGetCodecSrcResolution....................................................................... 39
2.4.19 MmuxIsCodecSrcConnect.............................................................................. 40
2.4.20 MmuxGetOutputSrc ....................................................................................... 41
2.4.21 MmuxSetOutputSrc........................................................................................ 41
3 LINUX OPEN SOURCE CODE ................................................................................ 43
Page 5
HDC-3x Series SDK (Linux)
Chapter
1
1 HDCapture SDK
(Linux)
Page 6
HDC-3x Series SDK (Linux)

1.1 HDCapture SDK Overview

The HDCapture SDK is a video capture tool that allows user to capture video through the HDMI input ports in Linux environment. The HDCapture SDK also includes decoding function that decodes the video signal for video output to the HDMI-enabled display device.
This manual includes SDK information for the HDC-3x Series, which includes:
HDC-301 HDC-301E HDC-302E HDC-304E

1.2 System Requirements

The following programs must be installed in order to use the HDCapture SDK in Linux:
Kernel: Fedora16-64 Distribution (based on Kernel 3.1.0)  Tool chain: Runs on Fedora16 (binutils 2.18, gcc 4.3.2, glibc 2.9)

1.3 Software Installation

1.3.1 Bin File Only

To install the HDCapture SDK to a system running Linux, please follow the steps below.
Step 1: Copy the HDCapture_3xx-r157_20121212-6339-3.1.0-7.fc16.x86_64.tar.bz2
( r157 release code , 20121212 release date, 6339 svn version,
3.1.0-7.fc16.x86_64 kernel version) file from the utility CD to the system hard
drive. The user can also get the latest version from IEI website.
Step 2: Unzip the file by typing:
$ tar xf HDCapture_(hdc series)-(version)_(date)-(svn version)_(kernel version).tar.gz $ tar -jvxf HDCapture_3xx-r157_20121212-6339-3.1.0-7.fc16.x86_64.tar.bz2
Step 3: Change to HDCapture directory by typing:
Page 7
$ cd HDCapture_3xx-(version)_(date)-(svn version) $ cd HDCapture_3xx-r157_20121212-6339
HDC-3x Series SDK (Linux)
Step 4: Login as root by typing:
$ su
Step 5: Enter the password:
password: ****** $
Step 6: Install the HDCapture SDK by typing:
sh install_ko_hdc3xx.sh
Step 7: The system starts to install the HDCapture SDK and shows:
Installation start. Installing fmb_player_apl... done. Installing firm... done. Making fmb_driver... `h55fmb.ko' -> `/lib/modules/2.6.43.5-2.fc15.i686/h55fmb.ko' done. Making mmux_driver... `media_mux.ko' -> `/lib/modules/2.6.43.5-2.fc15.i686/media_mux.ko' done. Unloading old MB86H55 device driver... done. Loading new MB86H55 device driver... done. Unloading old media_mux device driver... done. Loading new media_mux device driver... done. Installation completed.

1.3.2 Source Code

To install the HDCapture SDK to a system running Linux, please follow the steps below.
Page 8
Step 1: Copy the HDCapture_SDK_(version)_(date)-(svn version).tar.gz file from the
utility CD to the system hard drive. The user can also get the latest version from IEI website.
HDC-3x Series SDK (Linux)
Step 2: Unzip the file by typing:
$ tar xf HDCapture_SDK_(version)_(date)-(svn version).tar.gz $ tar xf HDCapture_3xx-r157_20121212-6339.tar.gz
Step 3: Change to HDCapture directory by typing:
$ cd (version) $ cd r157
Step 4: Login as root by typing:
$ su
Step 5: Enter the password:
password: ****** $
Step 6: Install the HDCapture SDK by typing:
#sh install_hdc3xx.sh
Step 7: The system starts to install the HDCapture SDK and shows:
Installation start. Making fmb_player_apl...done. Installing fmb_player_apl...done. Installing firm...done. Making fmb_driver...done. Making mmux_driver...done. Unloading old MB86H55 device driver...done. Loading new MB86H55 device driver...done. Unloading old media_mux device driver...done. Loading new media_mux device driver...done. Installation completed. #
Step 8: Type “exit” to logout from root: Step 0:
# exit
Page 9

1.4 Launch HDCapture SDK

Step 1: To launch the HDCapture SDK, type “hdcapture” as below:
$ hdcapture
Step 2: The system starts to launch the HDCapture SDK. When the main menu appears,
it is ready to use. Step 0:
[dev-0] Boot ... [dev-1] Boot ... [dev-2] Boot ... [dev-3] Boot ... ________________________________________________________ /_______________________________________________________/| | ||
HDC-3x Series SDK (Linux)
| HDCapture SDK for HDC 3xx series || | SDK Version: r157 || | firm : 2012-1113-9341-0400 || | cpld : 0304e003 || | fpga : 0304e003 || | mcu : 8051A101 || | mmux-driver: 0.0.3.3 || | fmb-driver : 0.0.3.2 || | apl : 0.1.5.3 || | kernel : 3.1.0-7.fc16.x86_64 || |_______________________________________________________|/ < Main menu > Select following character.
1 Encoding 2 Decoding 3 Decoding(Start pause)
Page 10
6 Encode settings 7 Decode settings
HDC-3x Series SDK (Linux)
8 Video I/O settings 9 Exit fmb-0?>
The contents marked in blue are especially for the HDC-302E and the HDC-304E
video capture cards.

1.5 Video Capture

There two main procedures to capture video by the HDCapture SDK in Linux. First, setup the encoding setting. Second, start capturing video. These two procedures are described in the following sections.

1.5.1 Encoding Setting

Before capturing the video, please connect the hardware and follow the instruction below to configure the encoding settings.
Step 1: Launch the HDCapture SDK (refer to Section
1.4).
Step 2: Type 6 to select “6 Encode settings” from the main menu.
fmb-0?>6
Step 3: The following message shows.
-------------------------------------------------------------------------------
------------------------------------------------------------------------------- < Device list > Select following number.
1 /dev/h55fmb0 2 /dev/h55fmb1 3 /dev/h55fmb2 4 /dev/h55fmb3
Page 11
fmb-0?>
HDC-3x Series SDK (Linux)
Step 4: Select a port to configure by entering the port number. For example, type 1 to
select the first port.
fmb-0?>1
Step 5: The following message shows.
< Encode settings - Sub menu >
‘Z’<-~~~~~~~~
Select following number. (Current settings)
1 Output port setting (File ./stream-0.mpg) 2 Video resolution setting (1920x1080_59.94p) 3 Video bitrate setting (CBR, 6000kbps) 4 Audio format (MPEG1L2, 256kbps) 5 Video scale (Not Use) fmb-0?>
NOTE:
The user can enter Z at anytime to go back to the previous page.
Step 6: Configure the file name of the encoded file. To configure the file name, type 1
to select the “Output port setting”.
fmb-0?>1
Step 7: The following message shows.
[[[ Encode settings - Sub menu -> Output port ]]]
‘Z’<-~~~~~~~~~~~->Enter
Page 12
Select following number. (* is current setting) 1 * File fmb-0?>
Step 8: Type 1 to select “File”.
HDC-3x Series SDK (Linux)
fmb-0?>1
Step 9: The following message shows the current file name is “stream-0.mpg”.
[[[ Encode settings - Sub menu -> Output port -> File ]]]
Input filepath of stream. Current filepath is ./stream-0.mpg. fmb-0?>
Step 10: Type the new file name. Take “video1.mpg” as an example.
fmb-0?>video1.mpg
Step 11: The encoding setting sub menu appears. The file name has been cha nged to
“video1.mpg”.
~~~~->Enter
< Encode settings - Sub menu >
‘Z’<-~~~~~~~~
Select following number. (Current settings)
1 Output port setting (File video1.mpg) 2 Video resolution setting (1920x1080_59.94p) 3 Video bitrate setting (CBR, 6000kbps) 4 Audio format (MPEG1L2, 256kbps) 5 Video scale (Not Use) fmb-0?>
Step 12: Video resolution settings. The encoding video resolution is automatically
detected by the hardware and can not be changed from the HDCapture SDK. If the video resolution is changed and does not match the current settings list in the SDK sub-menu, please type 2 to select “Video resolution setting”.
fmb-0?>2
Step 13: When the following message shows, press Enter to reload the current setting.
[[[ Encode settings - Sub menu -> Video resolution ]]]
‘Z’<-~~~~~~~~~~~~~~~->Enter
Page 13
Select following number.
1920x1080_60p
* 1920x1080_59.94p
1920x1080_50p 1920x1080_60i 1920x1080_59.94i 1920x1080_50i 1440x1080_60i 1440x1080_59.94i 1440x1080_50i 1280x720_60p 1280x720_59.94p 1280x720_50p 720x480_60i
HDC-3x Series SDK (Linux)
720x480_59.94i
720x480_50i (* is current setting)
Please change the input source resolution if you want to use select others. Then press "Enter" to reload. fmb-0?>
NOTE:
The contents marked in blue are especially for the HDC-302E and the HDC-304E video capture cards. The HDC-301 and HDC-301E can not detect the resolution automatically. The user needs to select the input source resolution manually.
Page 14
Step 14: Type Z to go back to the sub-menu of the encod e setting.
fmb-0?>z
HDC-3x Series SDK (Linux)
< Encode settings - Sub menu >
Select following number. (Current settings)
1 Output port setting (File video1.mpg) 2 Video resolution setting (1920x1080_59.94p) 3 Video bitrate setting (CBR, 6000kbps) 4 Audio format (MPEG1L2, 256kbps) 5 Video scale (Not Use) fmb-0?>
Step 15: Configure the video Scale,
‘Z’<-~~~~~~~~
fmb-0?>5
Step 16: The following message shows.
[[[ Encode settings - Sub menu -> Video scaler ]]] 'Z'<-~~~~~~~~~~~~->Enter Select following number. (* is current setting)
1. * Not Use
2. 1440x1080
3. 720x480
5. 320x240 fmb-0?>5
------------------------------------------------------------------------------- < Encode settings - Sub menu > 'Z'<-~~~~~~~~ Select following number. (Current settings)
1 Output port setting (File ./stream-0.mpg) 2 Video resolution setting(1920x1080_59.94i) 3 Video bitrate setting (CBR, 768kbps) 4 Audio format (MPEG1L2, 256kbps)
Page 15
5 Video scale (320x240)
HDC-3x Series SDK (Linux)
NOTE:
The video scale support 1080(60i) -> 480(60i) 1080(59.94i) -> 480(59.94i) 1080(50i) -> 480(50i) 1080(60i) -> 320x240(30p) 1080(59.94i) -> 320x240(29.97p) 1080(50i) -> 320x240(25p) 720(60p) -> 480 (60i) 720(59.94p) -> 480 (59.94i) 720(50p) -> 480 (50i) 720(60p) -> 320x240(30p) 720(59.94p) -> 320x240(29.97p) 720(50p) -> 320x240(25p)
Step 17: Type Z to go back to the sub-menu of the encode setting.
fmb-0?>z
< Encode settings - Sub menu >
‘Z’<-~~~~~~~~
Select following number. (Current settings)
1 Output port setting (File video1.mpg) 2 Video resolution setting (1920x1080_59.94p) 3 Video bitrate setting (CBR, 6000kbps) 4 Audio format (MPEG1L2, 256kbps)
Page 16
5 Video scale (Not Use) fmb-0?>
Loading...
+ 35 hidden pages