EDNet SDK Manual - nvrsw. · PDF fileEDNet SDK Manual...

Click here to load reader

  • date post

    20-Jul-2018
  • Category

    Documents

  • view

    239
  • download

    0

Embed Size (px)

Transcript of EDNet SDK Manual - nvrsw. · PDF fileEDNet SDK Manual...

  • EDNet SDK Manual

  • EDNet SDK Manual

    ThisdocumentdescribesEDNetSDKandAPIfordeveloperstomakenetworkclientapplicationsfor

    DVR/NVRproducts.

  • iii

    1. Introduction .......................................................................................................................... 1

    2.EDNetC/C++APIReference ...................................................................................................2

    Overview ......................................................................................................................... 2

    BasicTypesandUtilities ..................................................................................................... 2

    NetworkClients .............................................................................................................. 22

    NetworkServers .............................................................................................................. 41

    NetworkEvents ............................................................................................................... 51

    DisplayOperations ...........................................................................................................78

    SoundOperations ............................................................................................................ 84

    SoundStreaming .............................................................................................................. 89

    Buffers ........................................................................................................................... 92

    FrameBuffers .................................................................................................................. 94

    MessageLogging ............................................................................................................ 103

    3.EDNetPlugin(ActiveX)APIReference................................................................................... 106

    Overview ...................................................................................................................... 106

    BasicUsage ................................................................................................................... 106

    Events .......................................................................................................................... 106

    Attributes ...................................................................................................................... 114

    A.Appendix ......................................................................................................................... 118

    ChangeLog .................................................................................................................. 118

  • 1

    Chapter1.IntroductionEDNet(DVRNetwork)SDKprovidesanetworkclientlibrarywithActiveX(OCX)controlwhichcanbeusedin

    InternetExplorerwebbrowser.ItisusedforapplicationstoconnectandcontrolDVR/NVRnetworkservers.

  • 2

    Chapter2.EDNet C/C++ APIReferenceOverviewEDNetlibraryprovidesC/C++APIforapplicationstoconnectandcontrolremoteDVR/NTnetworkservers.

    APIisthread-safe,soyoucaneasilycallanyfunctionswithoutmulti-threadproblem.

    Sinceversion1.4.0,networkserverfunctionisalsosupported.

    Basic Types and UtilitiesBasicTypesandUtilities-varioushelperfunctions

    Synopsis

    #defineTRUE

    #defineFALSE

    #defineEDNET_INT_TO_POINTER

    #defineEDNET_POINTER_TO_INT

    #defineEDNET_UINT_TO_POINTER

    #defineEDNET_POINTER_TO_UINT

    #defineEDNET_CHANNEL_MAX

    #defineEDNET_CHANNEL_AUDIO

    #defineE_CHANNEL_VIDEO_MAP_LEN

    #defineEDNET_PROPERTY_NAME_MAX

    typedefEDNetFunc;

    enumEDNetLinkState;

    enumEDNetLinkHookType;

    enumEDNetConnectReplyError;

    enumEDNetRoleSystem;

    enumEDNetPropertyID;

    enumEDNetPropertyState;

    enumEDNetPropertyValue;

    structEDNetPropertySet;

    structEDNetSession;

    enumEDNetDeviceID;

    enumEDNetDevicePTZCommand;

    enumEDNetDeviceInfoCommand;

    enumEDNetPhoneCommand;

  • EDNetC/C++APIReference

    3

    enumEDNetDirType;

    enumEDNetMpegFileOpenError;

    enumEDNetMpegFileReadFormat;

    enumEDNetMpegFileReadFlag;

    enumEDNetMpegFileReadType;

    enumEDNetMpegFileSeekFlag;

    enumEDNetMpegFileSeekError;

    enumEDNetMpegFileCloseError;

    intednet_init(void);

    voidednet_exit(void);

    voidednet_set_deinterlace(intdeinterlace);

    constchar*ednet_get_link_state_name(EDNetLinkStatestate);

    constchar*ednet_get_property_name(EDNetPropertyIDprop_id);

    intednetx_init(void);

    voidednetx_exit(void);

    intednet_test_bit(constvoid*addr,

    intbit_nr);

    voidednet_set_bit(void*addr,

    intbit_nr);

    voidednet_clear_bit(void*addr,

    intbit_nr);

    DescriptionTheseAPIprovidesbasictypes,constants,libraryinitializationandmiscellaneoushelperfunctions.

    Details

    TRUE

    #defineTRUE(1)

    FALSE

    #defineFALSE(0)

    EDNET_INT_TO_POINTER

    #defineEDNET_INT_TO_POINTER(i)((void*)(long)(i))

  • EDNetC/C++APIReference

    4

    EDNET_POINTER_TO_INT

    #defineEDNET_POINTER_TO_INT(p)((int)(long)(p))

    EDNET_UINT_TO_POINTER

    #defineEDNET_UINT_TO_POINTER(i)((void*)(unsignedlong)(i))

    EDNET_POINTER_TO_UINT

    #defineEDNET_POINTER_TO_UINT(p)((unsignedint)(long)(p))

    EDNET_CHANNEL_MAX

    #defineEDNET_CHANNEL_MAX256

    ThenumberofvideoandaudiochannelsusedinEDNetlibrary.Channelnumbersarealwaysbetween0and

    EDNET_CHANNEL_MAX-1.Videochannelsarestartedfrom0toEDNET_CHANNEL_AUDIO-1,audio

    channelsarestartedfromEDNET_CHANNEL_AUDIOtoEDNET_CHANNEL_MAX-1.

    EDNET_CHANNEL_AUDIO

    #defineEDNET_CHANNEL_AUDIO128

    Thebasenumberofaudiochannels.Soaudiochannels'numberisalwaysEDNET_CHANNEL_AUDIO+n,

    wherenisbetween0and127.

    E_CHANNEL_VIDEO_MAP_LEN

    #defineE_CHANNEL_VIDEO_MAP_LEN((-)/8)

    EDNET_PROPERTY_NAME_MAX

    #defineEDNET_PROPERTY_NAME_MAX64

    EDNetFunc

  • EDNetC/C++APIReference

    5

    typedefint(*EDNetFunc)(void*object,void*param,void*data);

    Specifies the type of function which is called wihin EDNetClient hooks. The first parameter 'object' is

    caller client instance, the second parameter 'param' is hook information described in EDNetLinkHookType,

    and the last parameter 'data' is user-specific data, which has beed specified as the last parameter 'data' in

    ednet_client_add_hook()andednet_client_remove_hook().

    EDNetLinkState

    typedefenum

    {

    EDNET_LINK_STATE_OFFLINE=0,

    EDNET_LINK_STATE_RESOLVE,

    EDNET_LINK_STATE_CONNECT,

    EDNET_LINK_STATE_INIT,

    EDNET_LINK_STATE_LOGIN,

    EDNET_LINK_STATE_PREPARE,

    EDNET_LINK_STATE_ONLINE,

    EDNET_LINK_STATE_MAX

    }EDNetLinkState;

    A 'link' stands for a connection between a network client object and a network server(DVR/NT). The

    EDNetLinkStateisenumerativetypeforlinkstate.

    Theclient'scurrentlinkstatecanbegotbyednet_client_get_state()ornotifiedbyEDNET_LINK_HOOK_STATE.

    EDNET_LINK_STATE_OFFLINE:

    offlineordisconnected

    EDNET_LINK_STATE_RESOLVE:

    resolvinghostnametoIPaddress

    EDNET_LINK_STATE_CONNECT:

    connectingtothehost

    EDNET_LINK_STATE_INIT:

    initializingtheconnection

    EDNET_LINK_STATE_LOGIN:

    authenticatingwithusernameandpassword

    EDNET_LINK_STATE_PREPARE:

    preparingtofetchbasicinformationfromthehost

    EDNET_LINK_STATE_ONLINE:

    readytostreamingandcontrolremotehosts

    EDNET_LINK_STATE_MAX:

  • EDNetC/C++APIReference

    6

    EDNetLinkHookType

    typedefenum

    {

    EDNET_LINK_HOOK_STATE=0,

    EDNET_LINK_HOOK_EVENT,

    EDNET_LINK_HOOK_FRAME,

    EDNET_LINK_HOOK_IMAGE,

    EDNET_LINK_HOOK_MAX

    }EDNetLinkHookType;

    Thesehooktypesareusedwithednet_client_add_hook(),ednet_client_remove_hook()toaddorremovehook

    functionsforapplicationstogetnotifiedwhensomeinformationorstatusarechangedfromEDNetClientobjects.

    EDNET_LINK_HOOK_STATE:

    notifiedwhenalinkstateischanged.Youcangetclient'sstatewithednet_client_get_state().

    EDNET_LINK_HOOK_EVENT:

    notifiedwithEDNetEventtopassinformationtoapplications.

    EDNET_LINK_HOOK_FRAME:

    notifiedwithEDNetFrametopassvideo/audioframestoapplications.

    EDNET_LINK_HOOK_IMAGE:

    notifiedwithEDNetFrametopassvideoyuvimagestocreatestillimages.

    EDNET_LINK_HOOK_MAX:

    EDNetConnectReplyError

    typedefenum

    {

    EDNET_CONNECT_REPLY_OK=0,

    EDNET_CONNECT_REPLY_ERROR_RESOLVE,

    EDNET_CONNECT_REPLY_ERROR_CONNECT,

    EDNET_CONNECT_REPLY_ERROR_LOGIN,

    EDNET_CONNECT_REPLY_ERROR_PERMISSION,

    EDNET_CONNECT_REPLY_ERROR_CONNECTION_LIMIT

    }EDNetConnectReplyError;

    Describesconnectionerrors.

    EDNET_CONNECT_REPLY_OK:

    success

    EDNET_CONNECT_REPLY_ERROR_RESOLVE:

    failedtoresolveIP

  • EDNetC/C++APIReference

    7

    EDNET_CONNECT_REPLY_ERROR_CONNECT:

    failedtoconnect

    EDNET_CONNECT_REPLY_ERROR_LOGIN:

    failedtologinduetoinvaliduserandpassword

    EDNET_CONNECT_REPLY_ERROR_PERMISSION:

    failedtologinduetoinsufficientpermission

    EDNET_CONNECT_REPLY_ERROR_CONNECTION_LIMIT:

    failedtologinduetoreachconnectionlimitation

    EDNetRoleSystem

    typedefenum

    {

    EDNET_ROLE_SYSTEM_CONFIG=(1

  • EDNetC/C++APIReference

    8

    EDNET_PROPERTY_CAPTURE_RATE,

    EDNET_PROPERTY_AUDIO_CHANNELS,

    EDNET_PROPERTY_SAMPLE_RATE,

    EDNET_PROPERTY_CODEC,

    EDNET_PROPERTY_BITRATE,

    EDNET_PROPERTY_GOP_SIZE,

    EDNET_PROPERTY_FRAME_RATE,

    EDNET_PROPERTY_CONTRAST,

    EDNE