HTML header:

Magewell Pro Capture Series Card

SDK Guide for Linux

Copyright 2011–2016 Nanjing Magewell Electronics Co., Ltd. All rights reserved.

Revised 17/02/2016

1 Introduction

This section mainly introduces how to develop the application software base on the Pro Capture Series card in Linux platform.

1.1 Program Interface

In general, developers usually use two main kinds of development programming interface:

Both of methods can be used either separating or combining, developer can choose by the actually requirement.

1.2 I/O Control Features

The software, which is basing on the I/O Control interface to develop, can achieve the following features:

Branch of image data transmission, the latency time required to input 64 lines image signals.

For the same capture devices can create multiple instances, each instance has different capture size and color space, each capture device keeps 400MB–700MB exclusive transmission bandwidth. User can feel flexible while using.

Support AYUV、V408、Y410、V410、RGB10、BGR10 color format for capturing image.

Accuracy of 100 nanoseconds on-board clock provides the time information for all the captured video frame, and supports the clock synchronization processing in multi capture devices on the Internet.

Support RGBA format text or image through hardware real-time synthesis to the capture images, and it can implement the multiple capture image synthesis and superposition, form the PIP and PAP effects.

Support for capturing audio data through IEC60958 / IEC61937 format,including the original audio format (5.1 channel, 7.1 channel、DTS、THX、SRS, etc.) and all kinds of compressed audio formats(AAC,MP3,etc.)

Support for upgrading onboard firmware through API. The deep integration and the remote upgrade features will be easy to be put into effect.

2 Sample Introduction

This section mainly introduces the various of sample code in the SDK.There are two types of the sample code;

2.1 I/O Control Samples

3 I/O Control Developing Interface

This section mainly introduces the I/O Control programming interface. The mainly development as per the below steps:

3.1 Developing Steps

I/O Control development is basing the steps as below:

3.2 I/O Control Instructions

I/O Control control instructions is definded in the src\public\mw-linux.h,it including following instructions:

3.2.1 Get Device Stream Information Instructions

After installing the device driver, Pro Capture Series devices will generate several video* devices(* is the number which start form 0) in the /dev folder. Each of the video* device corresponds to a capture channel, each channel can be open several times at the same time, the device stream is defined to open some capture channel for one time. The following control instructions are using for getting the detailed information of the device stream of the current device.

NAME ANNOTATION
MWCAP_IOCTL_GET_STREAMS_COUNT Obtaining the device streaming count of the current device
MWCAP_IOCTL_GET_STREAMS_INFO Obtaining the device streaming detail of the current device.Reference to 3.3.2 MWCAP_STREAMS_INFO
MWCAP_IOCTL_GET_CTRL_STREAM_ID Obtaining the device streaming ID of current controlled device
MWCAP_IOCTL_SET_CTRL_STREAM_ID Setting the device streaming ID of current controlled device
MWCAP_IOCTL_GET_SELF_STREAM_ID Obtaining the device streaming ID of current device

3.2.2 Get Device Information Instructions;

NAME ANNOTATION
MWCAP_IOCTL_GET_CHANNEL_INFO Obtaining the current capture channel information. Reference to 3.3.3 MWCAP_CHANNEL_INFO
MWCAP_IOCTL_GET_FAMILY_INFO Obtaining the device type information of the current capture channel. Reference to 3.3.4 MWCAP_PRO_CAPTURE_INFO
MWCAP_IOCTL_GET_VIDEO_CAPS Obtaining the support features of the current video channel. Reference to 3.3.5 MWCAP_VIDEO_CAPS
MWCAP_IOCTL_GET_AUDIO_CAPS Obtaining the support features of the current audio channel. Reference to 3.3.6 MWCAP_AUDIO_CAPS

3.2.3 Firmware Update Instructions;

NAME ANNOTATION
MWCAP_IOCTL_GET_FIRMWARE_STORAGE Writing the firmware storage information of the current channel. Reference to 3.3.7 MWCAP_FIRMWARE_STORAGE
MWCAP_IOCTL_SET_FIRMWARE_ERASE Earsing the firmware storage area of the current channel. Reference to 3.3.8 MWCAP_FIRMWARE_ERASE
MWCAP_IOCTL_SET_FIRMWARE_DATA Writing data to the firmware storage area of the current channel. Reference to 3.3.9 MWCAP_FIRMWARE_DATA
MWCAP_IOCTL_GET_FIRMWARE_DATA Reading data from the firmware storage area of the current channel. Reference to 3.3.9 MWCAP_FIRMWARE_DATA

3.2.4 Firmware Clock Instructions;

NAME ANNOTATION
MWCAP_IOCTL_GET_TIME Obtaining the hardware clock of the current channel
MWCAP_IOCTL_SET_TIME Setting the hardware clock of the current channel
MWCAP_IOCTL_TIME_REGULATION Regulate the hardware clock of the current channel
MWCAP_IOCTL_TIMER_REGISTRATION Register clock scheduling object
MWCAP_IOCTL_TIMER_DEREGISTRATION Deregister clock scheduling object
MWCAP_IOCTL_TIMER_EXPIRE_TIME Setting expire time of the clock scheduling object.Reference to 3.3.10 MWCAP_TIMER_EXPIRE_TIME
MWCAP_IOCTL_TIMER_WAIT Waiting for the clock scheduling object failure.Reference to 3.3.11 MWCAP_TIMER_WAIT
MWCAP_IOCTL_TIMER_CANCEL Cancel the latest waiting time of the clock scheduling object

3.2.5 Asynchronous Notification Instructions;

NAME ANNOTATION
MWCAP_IOCTL_NOTIFY_REGISTRATION Register the notification object of asynchronous event.Reference to 3.3.12 MWCAP_NOTIFY_REGISTRATION_S
MWCAP_IOCTL_NOTIFY_DEREGISTRATION Deregister the notification object of asynchronous event
MWCAP_IOCTL_NOTIFY_STATUS Obtaining the event notification status. Reference to 3.3.13 MWCAP_NOTIFY_STATUS
MWCAP_IOCTL_NOTIFY_WAIT Waiting the asynchronous event notification, Reference to 3.3.14 MWCAP_NOTIFY_WAIT
MWCAP_IOCTL_NOTIFY_CANCEL Cancel the lastest waiting asynchronous event notification
MWCAP_IOCTL_NOTIFY_ENABLE Setting the type of the asynchronous event to be available,Reference to 3.3.15 MWCAP_NOTIFY_ENABLE

3.2.6 Audio And Video Capture Instructions;

名称 注释
MWCAP_IOCTL_GET_VIDEO_BUFFER_INFO Obtaining video buffer information.Reference to 3.3.16 MWCAP_VIDEO_BUFFER_INFO
MWCAP_IOCTL_GET_VIDEO_FRAME_INFO Obtaining video frame information.Reference to 3.3.17 MWCAP_VIDEO_FRAME_INFO
MWCAP_IOCTL_VIDEO_CAPTURE_OPEN Open video capture channel
MWCAP_IOCTL_VIDEO_CAPTURE_FRAME Capturing one video frame data.Reference to 3.3.18
MWCAP_IOCTL_VIDEO_CAPTURE_STATUS Obtaining the video captrue status.Reference to 3.3.19 MWCAP_VIDEO_CAPTURE_STATUS
MWCAP_IOCTL_VIDEO_CAPTURE_CLOSE Close video capture channel
MWCAP_IOCTL_AUDIO_CAPTURE_OPEN Open audio capture channel
MWCAP_IOCTL_AUDIO_CAPTURE_FRAME Capture one audio frame data.Reference to 3.3.20 MWCAP_AUDIO_CAPTURE_FRAME
MWCAP_IOCTL_AUDIO_CAPTURE_CLOSE Close audio capture channel

3.2.7 Capture Channel Input Instructions;

名称 注释
MWCAP_IOCTL_VIDEO_INPUT_SOURCE_COUNT Obtaining the input interface count of the video channel
MWCAP_IOCTL_VIDEO_INPUT_SOURCE_ARRAY Obtaining the input interface of the video channel.Regerence to 3.3.21 MWCAP_INPUT_SOURCE_ARRAY
MWCAP_IOCTL_AUDIO_INPUT_SOURCE_COUNT Obtaining the input interface count of the audio channel
MWCAP_IOCTL_AUDIO_INPUT_SOURCE_ARRAY Obtaining the input interface of the audio channel.Regerence to3.3.21 MWCAP_INPUT_SOURCE_ARRAY
MWCAP_IOCTL_SET_INPUT_SOURCE_SCAN Setting the video input whether to automatically scan
MWCAP_IOCTL_GET_INPUT_SOURCE_SCAN Obtaining the video input whether to automatically scan
MWCAP_IOCTL_GET_INPUT_SOURCE_SCAN_STATE Obtaining the scanning state of the input interface of the capture channel
MWCAP_IOCTL_SET_AV_INPUT_SOURCE_LINK Setting the audio input whether to automatically link to the video input
MWCAP_IOCTL_GET_AV_INPUT_SOURCE_LINK Obtaining the audio input whether to automatically link to the video input
MWCAP_IOCTL_SET_VIDEO_INPUT_SOURCE Setting the current video input source in this channel.Reference to 3.4.16 MWCAP_VIDEO_INPUT_TYPE
MWCAP_IOCTL_GET_VIDEO_INPUT_SOURCE Obtaining the current video input source in this channel.Reference to3.4.16 MWCAP_VIDEO_INPUT_TYPE
MWCAP_IOCTL_SET_AUDIO_INPUT_SOURCE Setting the current audio input source in this channel.Reference to3.4.17 MWCAP_AUDIO_INPUT_TYPE
MWCAP_IOCTL_GET_AUDIO_INPUT_SOURCE Obtaining the current audio input source in this channel.Reference to3.4.17 MWCAP_AUDIO_INPUT_TYPE

3.2.8 Signal Status Instructions;

NAME ANNOTATION
MWCAP_IOCTL_GET_INPUT_SPECIFIC_STATUS Obtaining the input signal status of this channel.Reference to 3.3.28 MWCAP_INPUT_SPECIFIC_STATUS
MWCAP_IOCTL_GET_VIDEO_SIGNAL_STATUS Obtaining the video signal status.Reference to 3.3.29 MWCAP_VIDEO_SIGNAL_STATUS
MWCAP_IOCTL_GET_AUDIO_SIGNAL_STATUS Obtaining the audio signal status.Reference to 3.3.30 MWCAP_AUDIO_SIGNAL_STATUS
MWCAP_IOCTL_GET_HDMI_INFOFRAME_VALID Obtaining the valid HDMI information frame.Reference to 3.4.13 MWCAP_HDMI_INFOFRAME_ID
MWCAP_IOCTL_GET_HDMI_INFOFRAME_PACKET Obtaining HDMI information frame data.Reference to 3.3.32 HDMI_INFOFRAME_PACKET

3.2.9 Video Process Instructions

NAME ANNOTATION
MWCAP_IOCTL_GET_VIDEO_INPUT_ASPECT_RATIO Obtaining the video input aspect retio.Reference to 3.3.33 MWCAP_VIDEO_ASPECT_RATIO
MWCAP_IOCTL_SET_VIDEO_INPUT_ASPECT_RATIO Setting the video input aspect retio.Reference to 3.3.33 MWCAP_VIDEO_ASPECT_RATIO
MWCAP_IOCTL_GET_VIDEO_INPUT_COLOR_FORMAT Obtaining the video input color format.Reference to 3.4.4 MWCAP_VIDEO_COLOR_FORMAT
MWCAP_IOCTL_SET_VIDEO_INPUT_COLOR_FORMAT Setting the video input color format.Reference to 3.4.4 MWCAP_VIDEO_COLOR_FORMAT
MWCAP_IOCTL_GET_VIDEO_INPUT_QUANTIZATION_RANGE Obtaining the video input quantization range.Reference to 3.4.5 MWCAP_VIDEO_QUANTIZATION_RANGE
MWCAP_IOCTL_SET_VIDEO_INPUT_QUANTIZATION_RANGE Setting the video input quantization range.Reference to 3.4.5 MWCAP_VIDEO_QUANTIZATION_RANGE

3.2.10 OSD Instructions

NAME ANNOTATION
MWCAP_IOCTL_VIDEO_CREATE_IMAGE Create OSD image.Reference to 3.3.34 MWCAP_VIDEO_CREATE_IMAGE
MWCAP_IOCTL_VIDEO_OPEN_IMAGE Open OSD image.Rreference to 3.3.35 MWCAP_VIDEO_IMAGE_REF
MWCAP_IOCTL_VIDEO_CLOSE_IMAGE Close OSD image.Reference to 3.3.35 MWCAP_VIDEO_IMAGE_REF
MWCAP_IOCTL_VIDEO_UPLOAD_IMAGE Upload OSD image.Reference to 3.3.36 MWCAP_VIDEO_UPLOAD_IMAGE

3.2.11 Timing sequence instructions

NAME ANNOTATION
MWCAP_IOCTL_GET_VIDEO_AUTO_H_ALIGN Obtaining the video auto adjust on horizontal direction
MWCAP_IOCTL_SET_VIDEO_AUTO_H_ALIGN Setting the video auto adjust on horizontal direction
MWCAP_IOCTL_GET_VIDEO_SAMPLING_PHASE Obtaining the size of the video sampling phase
MWCAP_IOCTL_SET_VIDEO_SAMPLING_PHASE Setting the size of the video sampling phase
MWCAP_IOCTL_GET_VIDEO_SAMPLING_PHASE_AUTO Obtaining the video sampling phase whahter to automatic adjustment
MWCAP_IOCTL_SET_VIDEO_SAMPLING_PHASE_AUTO Setting the video sampling phase whahter to automatic adjustment
MWCAP_IOCTL_SET_VIDEO_TIMING Setting the video timing sequence information.Reference to 3.3.37 MWCAP_VIDEO_TIMING
MWCAP_IOCTL_GET_VIDEO_PREFERRED_TIMING_ARRAY Obtaining the index of the video preferred timming sequence.Reference to 3.3.37 MWCAP_VIDEO_TIMING
MWCAP_IOCTL_SET_VIDEO_CUSTOM_TIMING Setting the video custom timming sequence parameter.Reference to 3.3.38 MWCAP_VIDEO_CUSTOM_TIMING
MWCAP_IOCTL_GET_VIDEO_CUSTOM_TIMING_COUNT Obtaining the video custom timing sequence count
MWCAP_IOCTL_GET_VIDEO_CUSTOM_TIMING_ARRAY Obtaining the video custom timing sequence.Reference to 3.3.39 MWCAP_VIDEO_CUSTOM_TIMING_PAR
MWCAP_IOCTL_SET_VIDEO_CUSTOM_TIMING_ARRAY Setting the video custom timing sequence.Reference to 3.3.39 MWCAP_VIDEO_CUSTOM_TIMING_PAR
MWCAP_IOCTL_GET_VIDEO_CUSTOM_RESOLUTION_COUNT Obtainig the video custom resolution count
MWCAP_IOCTL_GET_VIDEO_CUSTOM_RESOLUTION_ARRAY Obtaining the video custom resolution.Reference to 3.3.40 MWCAP_VIDEO_CUSTOM_RESOLUTION_PAR
MWCAP_IOCTL_SET_VIDEO_CUSTOM_RESOLUTION_ARRAY Setting the video custom resolution.Reference to 3.3.40 MWCAP_VIDEO_CUSTOM_RESOLUTION_PAR

3.2.12 Other Instructions;

NAME ANNOTATION
MWCAP_IOCTL_SET_LED_MODE Setting LED mode.Reference to 3.4.15 MWCAP_LED_MODE
MWCAP_IOCTL_SET_POST_RECONFIG Sending the reconfig setting command.Latency execute
MWCAP_IOCTL_GET_CORE_TEMPERATURE Obtaining the core temperature
MWCAP_IOCTL_GET_EDID_DATA Obtaining EDID data.Reference to 3.3.41 MWCAP_EDID_DATA
MWCAP_IOCTL_SET_EDID_DATA Setting EDID data.Reference to 3.3.41 MWCAP_EDID_DATA

3.2.13 V4L2 Control Instructions

NAME ANNOTATION
MWCAP_IOCTL_GET_VIDEO_CONNECTION_FORMAT Obtaining the video connection format.Reference to 3.3.42 MWCAP_VIDEO_CONNECTION_FORMAT
MWCAP_IOCTL_GET_VIDEO_PROCESS_SETTINGS Obtaining the video process configuration parameter.Reference to 3.3.43 MWCAP_VIDEO_PROCESS_SETTINGS
MWCAP_IOCTL_SET_VIDEO_PROCESS_SETTINGS Setting the video process configuration parameter.Reference to 3.3.43 MWCAP_VIDEO_PROCESS_SETTINGS
MWCAP_IOCTL_GET_VIDEO_OSD_SETTINGS Obtaining the video OSD configuration parameter.Reference to 3.3.44 MWCAP_VIDEO_OSD_SETTINGS
MWCAP_IOCTL_SET_VIDEO_OSD_SETTINGS Setting the video OSD configuration parameter.Reference to 3.3.44 MWCAP_VIDEO_OSD_SETTINGS
MWCAP_IOCTL_GET_VIDEO_OSD_IMAGE Obtaining the ODS image area of the video capture.Regerence to 3.3.45 MWCAP_VIDEO_OSD_IMAGE
MWCAP_IOCTL_SET_VIDEO_OSD_IMAGE Setting the ODS image area of the video capture.Regerence to 3.3.45 MWCAP_VIDEO_OSD_IMAGE
MWCAP_IOCTL_GET_BRIGHTNESS Obtaining brightness
MWCAP_IOCTL_SET_BRIGHTNESS Setting brightness
MWCAP_IOCTL_GET_CONTRAST Obtaining the video contrast
MWCAP_IOCTL_SET_CONTRAST Setting the video contrast
MWCAP_IOCTL_GET_HUE Obtaining the video hue
MWCAP_IOCTL_SET_HUE Setting the video hue
MWCAP_IOCTL_GET_SATURATION Obtaining the video saturation
MWCAP_IOCTL_SET_SATURATION Setting the video saturation

3.3 I/O Control Structure Definition

3.3.1 MWCAP_STREAM_INFO

3.3.2 MWCAP_STREAMS_INFO

3.3.3 MWCAP_CHANNEL_INFO

3.3.4 MWCAP_PRO_CAPTURE_INFO

3.3.5 MWCAP_VIDEO_CAPS

3.3.6 MWCAP_AUDIO_CAPS

3.3.7 MWCAP_FIRMWARE_STORAGE

3.3.8 MWCAP_FIRMWARE_ERASE

3.3.9 MWCAP_FIRMWARE_DATA

3.3.10 MWCAP_TIMER_EXPIRE_TIME

3.3.11 MWCAP_TIMER_WAIT

3.3.12 MWCAP_NOTIFY_REGISTRATION_S

3.3.13 MWCAP_NOTIFY_STATUS

3.3.14 MWCAP_NOTIFY_WAIT

3.3.15 MWCAP_NOTIFY_ENABLE

3.3.16 MWCAP_VIDEO_BUFFER_INFO

3.3.17 MWCAP_VIDEO_FRAME_INFO

3.3.18 MWCAP_VIDEO_CAPTURE_FRAME

3.3.19 MWCAP_VIDEO_CAPTURE_STATUS

3.3.20 MWCAP_AUDIO_CAPTURE_FRAME

3.3.21 MWCAP_INPUT_SOURCE_ARRAY

3.3.22 MWCAP_HDMI_VIDEO_TIMING

3.3.23 MWCAP_VIDEO_TIMING_SETTINGS

3.3.24 MWCAP_SDI_SPECIFIC_STATUS

3.3.25 MWCAP_HDMI_SPECIFIC_STATUS

3.3.26 MWCAP_COMPONENT_SPECIFIC_STATUS

3.3.27 MWCAP_CVBS_YC_SPECIFIC_STATUS

3.3.28 MWCAP_INPUT_SPECIFIC_STATUS

3.3.29 MWCAP_VIDEO_SIGNAL_STATUS

3.3.30 MWCAP_AUDIO_SIGNAL_STATUS

3.3.31 HDMI_INFOFRAME_HEADER

3.3.32 HDMI_INFOFRAME_PACKET

3.3.33 MWCAP_VIDEO_ASPECT_RATIO

3.3.34 MWCAP_VIDEO_CREATE_IMAGE

3.3.35 MWCAP_VIDEO_IMAGE_REF

3.3.36 MWCAP_VIDEO_UPLOAD_IMAGE

3.3.37 MWCAP_VIDEO_TIMING

3.3.38 MWCAP_VIDEO_CUSTOM_TIMING

3.3.39 MWCAP_VIDEO_CUSTOM_TIMING_PAR

3.3.40 MWCAP_VIDEO_CUSTOM_RESOLUTION_PAR

3.3.41 MWCAP_EDID_DATA

3.3.42 MWCAP_VIDEO_CONNECTION_FORMAT

3.3.43 MWCAP_VIDEO_PROCESS_SETTINGS

3.3.44 MWCAP_VIDEO_OSD_SETTINGS

3.3.45 MWCAP_VIDEO_OSD_IMAGE

3.4 I/O Control Enum definition

3.4.1 MW_FAMILY_ID

3.4.2 MWCAP_PRODUCT_ID

3.4.3 MWCAP_VIDEO_FRAME_STATE

3.4.4 MWCAP_VIDEO_COLOR_FORMAT

3.4.5 MWCAP_VIDEO_QUANTIZATION_RANGE

3.4.6 MWCAP_VIDEO_DEINTERLACE_MODE

3.4.7 MWCAP_VIDEO_ASPECT_RATIO_CONVERT_MODE

3.4.8 MWCAP_SD_VIDEO_STANDARD

3.4.9 MWCAP_VIDEO_SIGNAL_STATE

3.4.10 MWCAP_VIDEO_FRAME_TYPE

3.4.11 MWCAP_VIDEO_SATURATION_RANGE

3.4.12 MWCAP_HDMI_INFOFRAME_ID

3.4.13 MWCAP_HDMI_INFOFRAME_ID

3.4.14 MWCAP_VIDEO_TIMING_TYPE

3.4.15 MWCAP_LED_MODE

3.4.16 MWCAP_VIDEO_INPUT_TYPE

3.4.17 MWCAP_AUDIO_INPUT_TYPE