Hello,
I've take a look at SDK manual but things aren't clear for me.
Using NET_DVR_GetDeviceConfig() function with NET_DVR_GET_SIGNAL_SOURCE_INFO command (1654) means we have to define some values in instance of struct NET_DVR_DEVICEID_INFO like for example sDeviceID.
But according to SDK manual, this value is returned by NET_DVR_AddNetSignal function which I don't use, so I don't know exactly how to set parameters correctly
This is how I've defined structure of NET_DVR_DEVICEID_INFO :
Any help would be appreciated.
Best regards
I've take a look at SDK manual but things aren't clear for me.
Using NET_DVR_GetDeviceConfig() function with NET_DVR_GET_SIGNAL_SOURCE_INFO command (1654) means we have to define some values in instance of struct NET_DVR_DEVICEID_INFO like for example sDeviceID.
But according to SDK manual, this value is returned by NET_DVR_AddNetSignal function which I don't use, so I don't know exactly how to set parameters correctly
I think I have to define lpInBuffer as below to use in NET_DVR_GetDeviceConfig() function :This API is used to add a network signal source on the client and the device will return the allocated deviceID. The different channel of one device is as different source and please input the transmission protocol type(byTransProtocol) and stream type(byTransMode).
Code:
NET_DVR_DEVICEID_INFO deviceIdInfo = new NET_DVR_DEVICEID_INFO();
deviceIdInfo.dwSize = (uint)Marshal.SizeOf(deviceIdInfo);
deviceIdInfo.sDeviceID = // ??
deviceIdInfo.dwChan = lChannel;
deviceIdInfo.dwInputSignalIndex = // ??
IntPtr lpInBuffer = Marshal.AllocHGlobal(Marshal.SizeOf(deviceIdInfo));
Marshal.StructureToPtr(deviceIdInfo, lpInBuffer, false);
uint dwInBufferSize = Convert.ToUInt32(deviceIdInfo.dwSize);
Code:
public struct NET_DVR_DEVICEID_INFO
{
public uint dwSize;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32, ArraySubType = UnmanagedType.I1)]
public int[] sDeviceID;
public uint dwChan;
public uint dwInputSignalIndex;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 60, ArraySubType = UnmanagedType.I1)]
public byte[] byRes;
}
Any help would be appreciated.
Best regards