background image

26

DirectShow Programming

Return values

Value

Description

E_INVALIDARG

Invalid IP address.

E_UNEXPECTED

The operation could not be performed 
because the filter is not stopped.

S_OK

The method succeeded.

Summary of Contents for PCI-MPG24

Page 1: ...Advance Technologies Automate the World Manual Rev 2 00 Revision Date January 24 2008 Part No 50 15062 1000 PCI MPG24 4 CH MPEG4 Hardware Video Compression Card Network Streaming Manual ...

Page 2: ...dvised of the possibility of such damages This document contains proprietary information protected by copy right All rights are reserved No part of this manual may be repro duced by any mechanical electronic or other means in any form without prior written permission of the manufacturer Trademarks Microsoft Windows NT Windows 98 Windows 2000 and Windows XP are registered trademarks of Microsoft Co...

Page 3: ...vice adlinktech com TEL 886 2 82265877 FAX 886 2 82265717 Address 9F No 166 Jian Yi Road Chungho City Taipei 235 Taiwan Please email or FAX this completed service form for prompt and satisfactory service Company Information Company Organization Contact Person E mail Address Address Country TEL FAX Web Site Product Information Product Model Environment OS M B CPU Chipset BIOS Please give a detailed...

Page 4: ......

Page 5: ...etworkInterface 15 SetUnicastGroup SetMulticastGroup 16 GetUnicastGroup GetMulticastGroup 17 SetSubType 18 GetSubType 19 SetTVStandard 20 GetTVStandard 21 SetFrameRate 22 GetFrameRate 24 SetResolution 25 GetResolution 27 4 Windows API Functions 29 4 1 Introduction 29 4 2 Function List 29 4 3 Server functions 30 Mpg24Net_ServerOpen 30 Mpg24Net_ServerClose 31 Mpg24Net_ServerStart 32 Mpg24Net_ServerS...

Page 6: ...et_ClientSetResolution 40 Mpg24Net_ClientSetFrameRate 41 Mpg24Net_ClientSetPreviewDisplay 42 Mpg24Net_ClientGetConnectionStatus 44 Mpg24Net_ClientStartPreview 45 Mpg24Net_ClientStartSave 46 Mpg24Net_ClientStop 47 Mpg24Net_ClientPreviewShow 48 4 5 Error Codes 49 ...

Page 7: ...List of Tables iii List of Tables Table 2 1 Include Files 4 Table 2 2 Library File 4 ...

Page 8: ...iv List of Tables ...

Page 9: ...ages 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 We also provided network streaming API DLL It is an extension of PCI MPG24 API ...

Page 10: ...2 Introduction ...

Page 11: ...w software InterVideo Elecard etc for MPEG 2 video subtype 3 Mpg24Net files what listed in chapter 2 2 2 2 Software Driver Installation Network streaming files are bound with the PCI MPEG24 setup file Users will not need to install them separately If you want to install them manually please follow the steps below 1 Install DirectX 9 0C 2 Register filters Open a Windows Command Prompt window and en...

Page 12: ...ectory Include File Description Dsnetifc_ucast h The header file required for all C C DirectShow applica tions with point to point communication Dsnetifc_mcast h The header file required for all C C DirectShow applica tions with group broadcast communication Mpg24Net h The header file required for all C C applications which use PCI MPG24 API Table 2 1 Include Files Library File Description Mpg24Ne...

Page 13: ...25D478E3 Supported Media Types MEDIATYPE_Video Subtypes DIVX_MPEG4 MICROSOFT_MPEG4 MPEG2 MJPG Filter Name ADLink Unicast Receiver Filter CLSID 15089F31 ACEF 45fe B497 A2E5D90A69D7 Supported Media Types MEDIATYPE_Video Subtypes DIVX_MPEG4 MICROSOFT_MPEG4 MPEG2 MJPG Filter Name ADLink Multicast Sender Filter CLSID CE3B76CB 9540 48fa 9974 69A625D478E3 Supported Media Types MEDIATYPE_Video Subtypes DI...

Page 14: ...w Programming ADLink Multicast Receiver Filter Name ADLink Multicast Receiver Filter CLSID 319F0815 ACEF 45fe B497 A2E5D90A69D7 Supported Media Types MEDIATYPE_Video Subtypes DIVX_MPEG4 MICROSOFT_MPEG4 MPEG2 MJPG ...

Page 15: ...0x71 Format Type FORMAT_Videoinfo Major Type MEDIATYPE_Video SubType M P 4 S 0x0000 0x0010 0x80 0x00 0x00 0xaa 0x00 0x38 0x9b 0x71 Format Type FORMAT_Videoinfo Major Type MEDIATYPE_Video SubType MEDIASUBTYPE_MPEG2_VIDEO Format Type FORMAT_MPEG2Video Major Type MEDIATYPE_Video SubType M J P G 0x0000 0x0010 0x80 0x00 0x00 0xaa 0x00 0x38 0x9b 0x71 Format Type FORMAT_Videoinfo ...

Page 16: ... Then connect the pins from two filters by dragging the mouse from one of the filters output pin to another filters input pin An arrow will be drawn if these two pins agree on the connection After inserting ADLink Unicast Sender filter ADLink Unicast Receiver ADLink Multicast Sender filter or ADLink Multicast Receiver right click on the rectangle and click Filter Properties The filter properties d...

Page 17: ...DirectShow Programming 9 ADLink Unicast Receiver ...

Page 18: ...10 DirectShow Programming ADLink Multicast Sender ...

Page 19: ...DirectShow Programming 11 ADLink Multicast Receiver The graphs for sender and receiver are shown below Unicast Sender ...

Page 20: ...12 DirectShow Programming Unicast Receiver Preview File Save Multicast Sender ...

Page 21: ...a means for applications to control video configurations ADLink Unicast Sender ADLink Unicast Receiver ADLink Multicast Sender ADLink Multicast Receiver The methods of IUnicastConfig IMulticastConfig Interface IUnicastConfig CLSID C82CB41C D32C 4f73 9267 C114DA470378 Interface IMulticastConfig CLSID 1CB42CC8 D32C 4f73 9267 C114DA470378 ...

Page 22: ...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 Return values Value Description E_INVALIDARG Invalid IP address E_UNEXPECTED The operation could not be performed because the filter is not stopped S_OK The method succeeded...

Page 23: ...NetworkInterface 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 Return values Value Description E_INVALIDARG Invalid IP address S_OK The method succeeded ...

Page 24: ...ddress in network order bytes ordered from 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 usPort Specifies the port number in TCP IP network byte order You can use the htons function to convert the port number to the correct byte order Return values Value Description E_INVALIDARG Invalid IP address E_...

Page 25: ...a variable that retrieves the IP address in network order bytes ordered from left to right You can use the inet_addr func tion to convert a standard dotted format string such as 255 255 255 255 to the correct binary number pPort Pointer to a variable that retrieves the port number in TCP IP net work byte order You can use the htons function to convert the port number to the correct byte order Retu...

Page 26: ...e 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 Description E_INVALIDARG Invalid IP address E_UNEXPECTED The operation could not be performed because the filter is not stopped S_OK The method succeeded ...

Page 27: ...ype 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 Return values Value Description E_INVALIDARG Invalid IP address S_OK The method succeeded ...

Page 28: ...andard 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 E_UNEXPECTED The operation could not be performed because the filter is not stopped S_OK The method succeeded ...

Page 29: ...d 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 ...

Page 30: ...values If TV Standard NTSC 30000 NTSC 29 97fps 30 fps 15000 NTSC 15fps 30 2 fps 10000 NTSC 10fps 30 3 fps 7500 NTSC 7 5fps 30 4 fps 6000 NTSC 6fps 30 5 fps 5000 NTSC 5fps 30 6 fps 4285 NTSC 4 3fps 30 7 fps 3000 NTSC 3fps 30 10 fps 2000 NTSC 2fps 30 15 fps 1000 NTSC 1fps 30 30 fps If TV Standard PAL 25025 PAL 25fps 25 fps 12512 PAL 12 5fps 25 2 fps 8341 PAL 8 3fps 25 3 fps 6256 PAL 6fps 25 4 fps 50...

Page 31: ...Programming 23 1001 PAL 1fps 25 25 fps Return values Value Description E_INVALIDARG Invalid IP address E_UNEXPECTED The operation could not be performed because the filter is not stopped S_OK The method succeeded ...

Page 32: ... 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 S_OK The method succeeded ...

Page 33: ... 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 176 144 352 480 720 240 If TV Standard PAL 720 576 352 288 480 576 176 144 352 576 640 480 720 288 ...

Page 34: ...26 DirectShow Programming Return values Value Description E_INVALIDARG Invalid IP address E_UNEXPECTED The operation could not be performed because the filter is not stopped S_OK The method succeeded ...

Page 35: ...rent 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 E_INVALIDARG Invalid IP address S_OK The method succeeded ...

Page 36: ...28 DirectShow Programming ...

Page 37: ...n Mpg24Net_ServerOpen 4 3 1 Mpg24Net_ServerClose 4 3 2 Mpg24Net_ServerStart 4 3 3 Mpg24Net_ServerStop 4 3 4 Mpg24Net_ServerSend 4 3 5 Mpg24Net_ClientOpen 4 4 1 Mpg24Net_ClientClose 4 4 2 Mpg24Net_ClientSetSubType 4 4 3 Mpg24Net_ClientSetTVStandard 4 4 4 Mpg24Net_ClientSetResolution 4 4 5 Mpg24Net_ClientSetFrameRate 4 4 6 Mpg24Net_ClientSetPreviewDisplay 4 4 7 Mpg24Net_ClientGetConnectionStatus 4 4...

Page 38: ...e same network group of receivers multi cast Syntax int Mpg24Net_ServerOpen int StreamType 0 Parameters StreamType Specifies the type of the network streaming It could be 0 Unicast TCP Point to point communication 1 Multicast UDP Group broadcast communication Return Values Handle of server instance if return value is greater than or equal to 0 Or an error code if return value is negative See chapt...

Page 39: ...ance 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 Return Values See chapter 4 5 ...

Page 40: ...st If the stream type is unicast a server instance has a maximum of 16 concurrent connections Syntax int Mpg24Net_ServerStart int hHandle short port char ServerIp Parameters hHandle Specifies the handle of the server instance Port Specifies the port number ServerIp Specifies the IP address in network order bytes ordered from left to right You can leave it blank for unicast type Return Values See c...

Page 41: ... 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 ...

Page 42: ...rs hHandle Specifies the handle of the server instance pBuffer Specifies the buffer pointer of stream data iBufferSize Specifies the size of stream data iSyncPoint Specifies whether the stream data is a key frame I frame Its value could be 0 Key frame I frame 1 Other frame P frame or B frame Return Values See chapter 4 5 Example Below is a server sample which functions open a unicast server instan...

Page 43: ...ft MPEG 4 Mpg24_EncoderSetVideoFormat 0 0 VideoFormat_Standard 0 Mpg24_EncoderSetVideoFormat 0 0 VideoFormat_Size 0 Mpg24_EncoderSetVideoFormat 0 0 VideoFormat_FrameRate 0 Mpg24_EncoderSetVideoFormat 0 0 VideoFormat_TargetBitrate 0 Mpg24_EncoderSetVideoFormat 0 0 VideoFormat_SubType 0 Mpg24_EncoderSetVideoFormat 0 0 VideoFormat_MPEG4Mode 1 Mpg24_EncoderCallback 0 0 MyCallbackProc Open a server ins...

Page 44: ...et work group multicast Syntax int Mpg24Net_ClientOpen int StreamType 0 Parameters StreamType Specifies the type of the network streaming It could be 0 Unicast TCP point to point communication 1 Multicast UDP group broadcast communication Return Values Handle of client instance if return value is greater than or equal to 0 Or an error code if return value is negative See chapter 4 5 for the error ...

Page 45: ...t 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 Or an error code if return value is negative See chapter 4 5 for the error code ...

Page 46: ...nt 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 See chapter 4 5 ...

Page 47: ...ndard 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 ...

Page 48: ...Handle 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 It could be TV Standard NTSC 0 Full D1 720x480 1 CIF 352x240 2 QCIF 176x144 3 VGA 640x480 4 QVGA 320x240 TV Standard PAL 0 Full D1 720x576 1 CIF 352x288 2 QCIF 176x144 3 VGA 640x480 Return Values See chapter 4 5 ...

Page 49: ... 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 2 10 fps 3 5 fps 4 1 fps TV Standard PAL 0 25 fps 1 12 5 fps 2 8 3 fps 3 5 fps 4 1 fps Return Values See chapter 4 5 ...

Page 50: ... Specifies the handle of a parent window for the video window The video images will overlay on this window Setting it to null will cre ate a new window and display the video images on it Left Specifies the x coordinate of the video window Top Specifies the Y coordinate of the video window Width Specifies the width of the video window Height Specifies the height of the video window AutoShow Specifi...

Page 51: ...Windows API Functions 43 Return Values See chapter 4 5 ...

Page 52: ...d 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 See chapter 4 5 ...

Page 53: ... short port Parameters hHandle Specifies the handle of the client instance ServerIp Specifies the IP addres in network order bytes ordered from left to right For unicast the IP address will be the IP address of the server For multicast the IP address is same as the parameter ServerIp of Mpg24Net_ServerOpen Port Specifies the port number that is same as the parameter port of Mpg24Net_ServerOpen Ret...

Page 54: ...ort port char Filename Parameters hHandle Specifies the handle of the client instance ServerIp Specifies the IP address in network order bytes ordered from left to right For unicast the IP address will be the IP address of the server For multicast the IP address is same as the parameter ServerIp of Mpg24Net_ServerOpen Port Specifies the port number that is same as the parameter port of Mpg24Net_Se...

Page 55: ...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 ...

Page 56: ...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 See chapter 4 5 ...

Page 57: ...ue Description S_OK 0 Success Mpg24Net_INSUFFICIENT_MEMORY 1 Insufficient memory Mpg24Net_INVALID_HANDLE 2 Invalid handle number Mpg24Net_INSTANCE_NOT_OPEN 3 Instance has not been opened Mpg24Net_INSTANCE_EXCEED 4 Exceeds the maximum instance Mpg24Net_INVALID_PORT 5 Invalid port number Mpg24Net_FILTER_NOT_REGISTER 6 dsnet ax or dsnet_mcast ax has not been registered Mpg24Net_INTERFACE_ERROR 7 The ...

Page 58: ...ions Mpg24Net_DIRECTX_ERROR 9 An error message comes form DirectX Mpg24Net_INVALID_PARAMETER 10 Input parameters exceed allowable range Mpg24Net_NOT_STOPPED 11 Invalid operation while run ning Error Name Value Description ...

Page 59: ...d party products not manufactured by ADLINK will be covered by the original manufactur ers warranty X For products containing storage devices hard drives flash cards etc please back up your data before send ing them for repair ADLINK is not responsible for any loss of data X Please ensure the use of properly licensed software with our systems ADLINK does not condone the use of pirated software and...

Page 60: ...of battery fluid during or after change of batteries by customer user X Damage from improper repair by unauthorized ADLINK technicians X Products with altered and or damaged serial numbers are not entitled to our service X This warranty is not transferable or extendible X Other categories not protected under our warranty 4 Customers are responsible for shipping costs to transport damaged products ...

Reviews: