HDC-502E SDK (Linux) IEI Technology Corp. MODEL: HDC-502E SDK (Linux) A SDK software development kit for the HDC-502E Series User Manual Page 1 Rev. 1.
HDC-502E SDK (Linux) Revision Date Version Changes 9 August, 2012 1.17 Updated for V1.17 software version 22 November, 2011 1.
HDC-502E SDK (Linux) 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 (Linux) Table of Contents 1 DRIVER AND SDK INSTALLATION ........................................................................ 6 1.1 OVERVIEW.................................................................................................................. 7 1.2 SYSTEM REQUIREMENTS ............................................................................................ 7 1.3 SOFTWARE INSTALLATION ..........................................................................................
HDC-502E SDK (Linux) 2.3.18 MmuxGetCodecSrcResolution ....................................................................... 27 2.3.19 MmuxIsCodecSrcConnect.............................................................................. 27 2.3.20 MmuxGetOutputSrc ....................................................................................... 28 2.3.21 MmuxSetOutputSrc ........................................................................................ 28 3 LINUX OPEN SOURCE CODE .................
HDC-502E SDK (Linux) Chapter 1 1 Driver and SDK Installation Page 6
HDC-502E SDK (Linux) 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 HDC502E, which includes: HDC-502E 1.
HDC-502E SDK (Linux) Step 5: Enter the password: password: ****** $ Step 6: Install the HDCapture SDK by typing: # ./install.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.
HDC-502E SDK (Linux) /_______________________________________________________/| | || | HDCapture SDK for HDC series || | SDK Version: r138 || | firm : 2011-0308-8041-0400 | cpld : 502ec100 || | fpga : 502ef113 || | mcu | mmux-driver: 0.0.3.1 | fmb-driver : 0.0.3.2 || | apl : 0.1.3.2 || | kernel : 3.4.2-1.fc16.
HDC-502E SDK (Linux) 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 fmb-0?> Step 4: Select a port to configure by entering the port number. For example, type 1 to select the first port.
HDC-502E SDK (Linux) 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 Select following number. (* is current setting) 1 * File fmb-0?> Step 8: Type 1 to select “File”.
HDC-502E SDK (Linux) 1 Output port setting (File video1.mpg) 2 Video resolution setting (1920x1080_60p) 3 Video bitrate setting (CBR, 6000kbps) 4 Audio format (MPEG1L2, 256kbps) 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”.
HDC-502E SDK (Linux) NOTE: The HDC-502E Series can not detect resolution automatically. The user needs to select the input source resolution manually. There are multiple video resolution options, but only two options are for the HDC-502E SDK (Linux). They are: 1920x1080 (60p / 50p) (6000kps - 30000kps) 1280x720 (60p / 50p) (4000kps - 24000kps) Which video resolution to choose depends on the video input resolution and the selected mode set by the HDC-502E SDK (Linux) rotary switch.
HDC-502E SDK (Linux) Step 16: The following message shows. [[[ Encode settings - Sub menu -> Video ratecontrol -> Video bitrate ]]] 'Z'<-~~~~~~~~~~~~~~~~~->Enter Select following number. (* is current setting) 1 * CBR 2 VBR fmb-0?> Step 17: To configure the video bitrate as CBR, type 1 to select “CBR”. To configure the video bitrate as VBR, type 2 to select “VBR”. Now we take CBR as an example. fmb-0?>1 Step 18: The following message shows the current CBR value.
HDC-502E SDK (Linux) NOTE: The audio format of the encoding and decoding settings is set by default and can not be changed. 1.5.2 Encoding After configuring encoding settings, the user can start capturing the video by following the steps below. Step 1: Access to the main menu. Type 1 to select “1 Encoding” from the main menu. fmb-0?>1 Step 2: The following message shows. The option marked with * is the selected port for capturing video. The unsupported port appears with an “unknown” message.
HDC-502E SDK (Linux) 'Z'<-~~~~~~~->Enter Current settings Stream output File ./stream-0.mpg Video format 1920x1080 Video framerate 60p Video rate control CBR Video bitrate 6000kbps Audio format MPEG1L2 Audio bitrate 256kbps Press key to start encoding. fmb-0?> Step 5: Press Enter. The system shows the following message and starts capturing video. [[[ Encoding ]]] Press key to stop. fmb-0?> Step 6: Press Enter again to stop capturing video. Step 0: 1.5.2.
HDC-502E SDK (Linux) fmb-0?> Step 3: The current settings of the selected port shows as following. [[[ One-picture encoding - confirm ]]] 'Z'<-~~~~~~~->Enter Current settings Stream output File ./stream-3.mpg Video format 1920x1080 Video framerate 60p Video rate control CBR Video bitrate 6000kbps System bitrate 6675kbps[Muxrate:7175kbps] Audio format MPEG1L2 Audio bitrate 256kbps Press key to start. fmb-3?> Step 4: Press Enter.
HDC-502E SDK (Linux) Chapter 2 2 Programming Guide Page 18
HDC-502E SDK (Linux) 2.1 Main Thread Step 1: Initialize global variables (FmbInitInfo). Step 2: Set the default of all devices (FmbCreatDevInfoAll) and create a thread for each device (fmbRecvThread). This thread will receive Events sent by codec chip, and send the message to the main thread through the pipe. Step 3: Write firmware to the codec chip and boot codec chip (DrvBootAll). Step 4: Read the current version of the codec chip (CheckVersionInfo).
HDC-502E SDK (Linux) Page 20
HDC-502E SDK (Linux) 2.2 Encode void FmbReset(void); void FmbInitEnc(void); void FmbStartEnc(void); void FmbStop(void); NOTE: Be sure to use OnFmbMessage () function to confirm the codec chip return the message to switch the state (return FMBEnmResultRequestComplete), then continue to the next action.
HDC-502E SDK (Linux) 2.3 Functions Reference 2.3.1 OnFmbMessage Description: receive the returned message from codec chip to determine the current state Prototype: enum FMBResultEnum OnFmbMessage (int fd) Parameters: fd: device (codec chip) handle Return Value: Current state: FMBEnmResultContinue, FMBEnmResultRequestComplete enum FMBResultEnum {FMBEnmResultContinue, FMBEnmResultRequestComplete} 2.3.
HDC-502E SDK (Linux) Return Value: TRUE: function succeeded; FALSE: functioned failed 2.3.5 FmbDellDevInfoAll Description: release all of codec chip resources Prototype: void FmbDellDevInfoAll(void) Parameters: None Return Value: None 2.3.6 FmbGetDeviceTotal Description: get the current number of codec chip Prototype: int FmbGetDeviceTotal(void) Parameters: None Return Value: codec chip number 2.3.
HDC-502E SDK (Linux) FMBEnmDevice_0 = 0, FMBEnmDevice_1, FMBEnmDevice_2, FMBEnmDevice_3, FMBEnmDevice_4, FMBEnmDevice_5, FMBEnmDevice_6, FMBEnmDevice_7, FMBEnmDeviceMax }; Return Value: None 2.3.9 FmbGetCurDeviceNum Description: get the chip number of the current operating codec (numbering by the order of all the codec on the board) Prototype: enum FMBDeviceNumEnum FmbGetCurDeviceNum(void); Parameters: None Reture Value: enum FMBDeviceNumEnum, device number 2.3.
HDC-502E SDK (Linux) 2.3.11 FMBDeviceNumEnum Description: get the chip number of the current operating codec Prototype: enum FMBDeviceNumEnum FmbGetCurDeviceNum(void) Parameters: None Return Value: enum FMBDeviceNumEnum, device number 2.3.
HDC-502E SDK (Linux) Return Value: 0: function succeeded, other values: function failed 2.3.15 MmuxInit Description: initialize the CPLD to control handle Prototype: MmuxHandle MmuxInit(int deviceNum) Parameters: deviceNum: request to initialize the version of card number and strat from 0 Return Value: MmuxHandle 2.3.16 MmuxRelease Description: release CPLD and control handle Prototype: void MmuxRelease(MmuxHandle hdMmux) Parameters: hdMmux: get handle when MmuxInit executes Return Value: None 2.3.
HDC-502E SDK (Linux) 2.3.
HDC-502E SDK (Linux) Prototype: int MmuxIsCodecSrcConnect(MmuxHandle hdMmux, int codecNum) Parameters: hdMmux: Get handle when MmuxInit executes, codecNum: request the codec chip number Return Value: 0: no signal, 1: signal input 2.3.
HDC-502E SDK (Linux) Prototype: int MmuxSetOutputSrc(MmuxHandle hdMmux, int outputNum, enum MMUX_OUTPUT_SRC outputSrc) Parameters: hdMmux: Get handle when MmuxInit executes, outputNum: request the output number (currently always 0), outputSrc: set the image source Return Value: 0: set succeeded Page 29
HDC-502E SDK (Linux) Chapter 3 3 Linux Open Source Code Page 30
HDC-502E SDK (Linux) Linux Open Source Code This product from IEI contains software originating from Fujitsu and its suppliers and also contains component from the open source community. Software code is subject to the GNU General Public License. See the GNU General Public License for the exact terms and conditions of this license. The GPL Code used in this products are distributed without any warranty and are subject to the copyrights of their authors.
HDC-502E SDK (Linux) For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
HDC-502E SDK (Linux) 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
HDC-502E SDK (Linux) Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3.
HDC-502E SDK (Linux) 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5.
HDC-502E SDK (Linux) This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded.
HDC-502E SDK (Linux) 12.
HDC-502E SDK (Linux) Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.