Summary of Contents for ADLINK Technology PCI-MPG24
Page 1
PCI-MPG24 4-CH MPEG4 Hardware Video Compression Card Network Streaming Manual Manual Rev. 2.00 Revision Date: January 24, 2008 Part No: 50-15062-1000 Advance Technologies; Automate the World.
Page 2
Copyright 2008 ADLINK TECHNOLOGY INC. All Rights Reserved. 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.
Page 3
Getting Service from ADLINK Customer Satisfaction is top priority for ADLINK Technology Inc. Please contact us should you require any service or assistance. ADLINK TECHNOLOGY INC. Web Site: http://www.adlinktech.com Sales & Service: Service@adlinktech.com TEL: +886-2-82265877 FAX: +886-2-82265717 Address: 9F, No. 166, Jian Yi Road, Chungho City,...
Introduction This manual is used for PCI-MPG24 networking. With this capabil- ity, users can send camera images out of local computers and receive them on remote computers. Two kinds of DirectShow filters are provided: unicast (TCP) and multicast (UDP). Unicast is used for point to point communication and multicast is used for group broadcast communication.
Open a Windows Command Prompt window and enter the fol- lowing commands: C> regsvr32 dsnet.ax C> regsvr32 dsnet_mcast.ax 3. Copy shared library: Copy Mpg24Net.dll to %windir%/system32. Note: All files listed above are located on PCI-MPG24 installa- tion directory. Installation Guide...
Library File Description Exports API function definitions. Required for all C/C++ applica- Mpg24Net.lib tions which use PCI-MPG24 API. Table 2-2: Library File Note: All of files listed above are located on PCI-MPG24 instal- lation directory Installation Guide...
3.2 Example Graphs The Microsoft DirectX SDK provides a very useful debugging utility called GraphEdit, which can be used to simulate graph building. From the Graph menu of the GraphEdit application, click Insert Filters… and choose the desired filters. Filters are organized by categories.
Multicast Receiver Preview: File Save: 3.3 Controlling Filters The ADLink net filters expose COM interfaces as a means for applications to control video configurations. ADLink Unicast Sender & ADLink Unicast Receiver Interface IUnicastConfig CLSID {C82CB41C-D32C-4f73-9267-C114DA470378} ADLink Multicast Sender & ADLink Multicast Receiver Interface IMulticastConfig CLSID...
3.3.1 SetNetworkInterface The SetNetworkInterface method sets the Network Interface Card (NIC) address that the filter will use. Syntax HRESULT SetNetworkInterface( ULONG ulNIC Parameters ulNIC Specifies the NIC address, in network order (bytes ordered form left to right). You can use the inet_addr function to convert a stan- dard dotted-format string (such as “255.255.255.255) to the cor- rect binary numbers.
3.3.2 GetNetworkInterface The GetNetworkInterface method returns the filters’ current Net- work Interface Card (NIC) address. Syntax HRESULT GetNetworkInterface( ULONG* pNIC Parameters pNIC Pointer to a variable that retrieves the NIC address, in network order (bytes ordered form left to right). You can use the inet_addr function to convert a standard dotted-format string (such as “255.255.255.255) to the correct binary number.
3.3.3 SetUnicastGroup / SetMulticastGroup The SetUnicastGroup / SetMulticastGroup methods set the group that the filter will send or listen to. Syntax HRESULT SetUnicastGroup( ULONG ulIP, USHORT usPort HRESULT SetMulticastGroup( ULONG ulIP, USHORT usPort Parameters ulIP Specifies the IP address in network order (bytes ordered from left to right).
3.3.4 GetUnicastGroup / GetMulticastGroup The GetUnicastGroup / GetMulticastGroup methods retrieve the filters’ curent group address. Syntax HRESULT GetUnicastGroup( ULONG* pIP, USHORT* pPort HRESULT GetMulticastGroup( ULONG* pIP, USHORT* pPort Parameters Pointer to a variable that retrieves the IP address in network order (bytes ordered from left to right).
3.3.5 SetSubType The SetSubType method set the filter’s media subtype. Syntax HRESULT SetSubType( ULONG ulSubType Paramters ulSubType Specifies the media subtype as one of the following: 0: DivX MPEG-4 (Need DivX V5.x) 1: Motion JPEG 2: Microsoft MPEG-4 (default) 3: MPEG-2 (Need third-party MPEG-2 DirectShow package, such as InterVideo, elecard, Nero …, etc.) Return values Value...
3.3.6 GetSubType The GetSubType method retrieves the filter’s current media sub- type. Syntax HRESULT GetSubType( ULONG* pSubType Paramters pSubType Pointer to a variable that retrieves the media subtype as one of the following: 0: DivX MPEG-4 (Need DivX V5.x) 1: Motion JPEG 2: Microsoft MPEG-4 (default) 3: MPEG-2 (Need third-party MPEG-2 DirectShow package, such as InterVideo, elecard, Nero …, etc.)
3.3.7 SetTVStandard The SetTVStandard method set the filter’s TV Standard. Syntax HRESULT SetTVStandard( ULONG ulTVStandard Paramters ulTVStandard Specifies the TV Standard as one of the following: AnalogVideo_NTSC_M, AnalogVideo_NTSC_M_J, AnalogVideo_NTSC_433, AnalogVideo_PAL_B, AnalogVideo_PAL_D, AnalogVideo_PAL_H, AnalogVideo_PAL_I, AnalogVideo_PAL_M, AnalogVideo_PAL_N, AnalogVideo_PAL_60 Return values Value Description E_INVALIDARG Invalid IP address.
3.3.8 GetTVStandard The GetTVStandard method retrieves the filter’s current TV Stan- dard. Syntax HRESULT GetTVStandard( ULONG* pTVStandard Paramters pTVStandard Pointer to a variable that retrieves the TV standard. Return values Value Description E_INVALIDARG Invalid IP address. S_OK The method succeeded. DirectShow Programming...
3.3.9 SetFrameRate The SetFrameRate method set the filters’ frame rate ratio. Syntax HRESULT SetFrameRate( ULONG ulFrameRate Paramters ulFrameRate Specifies the frame rate ratio. Frame rate ratio = 1001 * frame rate (fps). Fram rate ratio can be expressed as one of following values: If TV Standard = NTSC, 30000: NTSC 29.97fps( 30 fps ) 15000: NTSC 15fps( 30/2 fps )
Page 31
1001: PAL 1fps( 25/25 fps ) Return values Value Description E_INVALIDARG Invalid IP address. The operation could not be performed E_UNEXPECTED because the filter is not stopped. S_OK The method succeeded. DirectShow Programming...
3.3.10 GetFrameRate The GetFrameRate method retrieves the filter’s current frame rate ratio. Syntax HRESULT GetFrameRate( ULONG* pFrameRate Paramters pFrameRate Pointer to a variable that retrieves the frame rate ratio. Frame rate ratio = 1001* frame rate (fps). Return values Value Description E_INVALIDARG Invalid IP address.
3.3.11 SetResolution The SetResolution method set the filter’s resolution. Syntax HRESULT SetResolution( ULONG ulWidth, ULONG ulHeight Paramters (ulWidth, ulHeight) Specifies the width and height. It could be one of the following pairs: If TV Standard = NTSC, (720, 480), (352, 240), (640, 480), (320, 240), (480, 480),...
Page 34
Return values Value Description E_INVALIDARG Invalid IP address. The operation could not be performed E_UNEXPECTED because the filter is not stopped. S_OK The method succeeded. DirectShow Programming...
3.3.12 GetResolution The GetResolution method retrieves the filter’s current width and height. Syntax HRESULT GetResolution( ULONG* pWidth, ULONG* pHeight Paramters pWidth Pointer to a variable that retrieves the media width. pHeight Pointer to a variable that retrieves the media height. Return values Value Description...
The Application Program Interface (API) functions are based on DirectX 9.0. DirectX 9.0 must be installed in order for the API func- tions to work. The API library is additional software to PCI-MPG24.dll for net- work streaming extension. 4.2 Function List...
4.3 Server functions 4.3.1 Mpg24Net_ServerOpen This function will open a new server instance. A server instance is a network server that waits for client connections (unicast), or sends stream data to the same network group of receivers (multi- cast). Syntax int Mpg24Net_ServerOpen( int StreamType = 0 Parameters...
4.3.2 Mpg24Net_ServerClose This function will close a server instance. A server instance is a network server that waits for client connections (unicast), or sends stream data to the same network group of receivers (multicast). Syntax int Mpg24Net_ServerClose( int hHandle Parameters hHandle Specifies the handle of the server instance.
4.3.3 Mpg24Net_ServerStart This function will start a server. The server will open a network socket and wait for client connections (unicast), or send stream data over the network (multicast). If the stream type is unicast, a server instance has a maximum of 16 concurrent connections. Syntax int Mpg24Net_ServerStart( int hHandle,...
4.3.4 Mpg24Net_ServerStop This function can be used to stop a server. The server will close a network socket and close all client connections. Syntax int Mpg24Net_ServerStop( int hHandle Parameters hHandle Specifies the handle of the server instance. Return Values See chapter 4.5. Windows API Functions...
4.3.5 Mpg24Net_ServerSend This function can be used to send stream data to all clients. The stream data comes from external library (callback function of PCI_MPG24.dll). Syntax int Mpg24Net_ServerSend( int hHandle, BYTE * pBuffer, int iBufferSize, int iSyncPoint Parameters hHandle Specifies the handle of the server instance. pBuffer Specifies the buffer pointer of stream data.
Page 43
void __stdcall MyCallbackProc( BYTE * pBuffer, int iBufferSize, int iSyncPoint if(iBufferSize>0 && pBuffer) Mpg24Net_ServerSend( hHandle, pBuffer, iBufferSize, iSyncPoint start() // Open ADLink Hardware MPEG4 Device Mpg24_EncoderOpen(0, 0); // Set configuration: NTSC Full D1 30fps 4Mbps Microsoft MPEG-4 Mpg24_EncoderSetVideoFormat(0, 0, VideoFormat_Standard, 0); Mpg24_EncoderSetVideoFormat(0, 0, VideoFormat_Size, 0);...
4.4 Client functions 4.4.1 Mpg24Net_ClientOpen This function will open a new client instance. A client instance is a network client that connects to a server (unicast), or joins a net- work group (multicast). Syntax int Mpg24Net_ClientOpen( int StreamType = 0 Parameters StreamType Specifies the type of the network streaming.
4.4.2 Mpg24Net_ClientClose This function will close the client instance. A client instance is a network client that connects to a server (unicast), or joins a net- work group (multicast). Syntax int Mpg24Net_ClientClose ( int hHandle Parameters hHandle Specifies the handle of the client instance. Return Values Handle of client instance if return value is greater than or equal to 0.
4.4.3 Mpg24Net_ClientSetSubType Specifies the video subtype. Syntax int Mpg24Net_ClientSetSubType ( int hHandle, int iSubType Parameters hHandle Specifies the handle of the client instance. iSubType Specifies the video subtype. It could be: 0: DivX MPEG-4(need DivX V5.x) 1: Motion JPEG 2: Microsoft MPEG-4 (default) 3: MPEG-2 (Need third-party MPEG-2 DirectShow software, such as InterVideo, Elecard, Nero…,etc.) Return Values...
4.4.4 Mpg24Net_ClientSetTVStandard Specifies the TV standard. Syntax int Mpg24Net_ClientSetTVStandard ( int hHandle, int iTVStandard Parameters hHandle Specifies the handle of the client instance. iTVStandard Specifies the TV standard. It could be: 0: NTSC 1: PAL Return Values See chapter 4.5. Windows API Functions...
4.4.5 Mpg24Net_ClientSetResolution This function will specifies the specific resolution (width and height of video). Syntax int Mpg24Net_ClientSetResolution ( int hHandle, int iResolution Parameters hHandle Specifies the handle of the client instance. iResolution Specifies the specific resolution. It depends on the value of the TV standard.
4.4.6 Mpg24Net_ClientSetFrameRate Specifies the specific frame rate. Syntax int Mpg24Net_ClientSetFrameRate ( int hHandle, int iFrameRate Parameters hHandle Specifies the handle of the client instance. iResolution Specifies the specific frame rate which is dependant upon the value of the TV standard. It could be: TV Standard = NTSC 0: 29.97 fps 1: 15 fps...
4.4.7 Mpg24Net_ClientSetPreviewDisplay Specifies the configuration of preview window. Syntax int Mpg24Net_ClientSetPreviewDisplay ( int hHandle, int hWnd, int Left, int Top, int Width, int Height, int AutoShow Parameters hHandle Specifies the handle of the client instance. hWnd Specifies the handle of a parent window for the video window. The video images will overlay on this window.
Page 51
Return Values See chapter 4.5. Windows API Functions...
4.4.8 Mpg24Net_ClientGetConnectionStatus This function can be used to retrieve the connection status either to the server (unicast), or a network group multicast). Syntax int Mpg24Net_ClientGetConnectionStatus( int hHandle Parameters hHandle Specifies the handle of the client instance. Return Values 0: Disconnected 1: Connected Others: Error occurs.
4.4.9 Mpg24Net_ClientStartPreview This function will start a client preview of a video graph. The client will open a network socket and establish a connection with the server (unicast), or it will join a network (multicast). Syntax int Mpg24Net_ClientStartPreview( int hHandle, char *ServerIp, short port Parameters...
4.4.10 Mpg24Net_ClientStartSave This function can be used to start a client. The client will open a network socket and establish a connection with the server (uni- cast), or join a network (multicast). This function also receives the stream data and saves them to a media file. Syntax int Mpg24Net_ClientStartSave( int hHandle,...
4.4.11 Mpg24Net_ClientStop Stop a client. The client will close a network socket and terminate the server connection (unicast) or leave the network (multicast). Syntax int Mpg24Net_ClientStop( int hHandle Parameters hHandle Specifies the handle of the client instance. Return Values See chapter 4.5. Windows API Functions...
4.4.12 Mpg24Net_ClientPreviewShow This function can be used to show or hide the preview graph. Syntax int Mpg24Net_ClientPreviewShow( int hHandle, short Visible Parameters hHandle Specifies the handle of the client instance. Visible Specifies whether the preview graph is shown. It could be: 0: Invisible 1: Visible Return Values...
4.5 Error Codes Mpg24Net_GetLastErrorInfo Use this function to get an error message of last error. Syntax Int Mpg24Net_GetLastErrorInfo( TCHAR *ErrorInfo Parameters ErrorInfo Specifies the pointer of a text buffer for storing the error message. Users need to allocate a buffer space enough to get this error message (max.
Page 58
Error Name Value Description An error message comes Mpg24Net_DIRECTX_ERROR form DirectX Input parameters exceed Mpg24Net_INVALID_PARAMETER allowable range Invalid operation while run- Mpg24Net_NOT_STOPPED ning Windows API Functions...
Warranty Policy Thank you for choosing ADLINK. To understand your rights and enjoy all the after-sales services we offer, please read the follow- ing carefully. 1. Before using ADLINK’s products please read the user man- ual and follow the instructions exactly. When sending in damaged products for repair, please attach an RMA appli- cation form which can be downloaded from: http:// rma.adlinktech.com/policy/.
Page 60
3. Our repair service is not covered by ADLINK's guarantee in the following situations: Damage caused by not following instructions in the User's Manual. Damage caused by carelessness on the user's part dur- ing product transportation. Damage caused by fire, earthquakes, floods, lightening, pollution, other acts of God, and/or incorrect usage of voltage transformers.
Need help?
Do you have a question about the PCI-MPG24 and is the answer not in the manual?
Questions and answers