Esempio n. 1
0
    unsafe void TryCreateNdiRecv()
    {
        if (_ndiFind == IntPtr.Zero)
        {
            return;
        }

        // NDI source enumeration
        var count   = (System.UInt32) 0;
        var sources = NDIlib.find_get_current_sources(_ndiFind, ref count);

        if (count == 0)
        {
            return;
        }

        // First source entry
        var source =
            UnsafeUtility.ReadArrayElement <NDIlib.source_t>((void *)sources, 0);

        var name = Marshal.PtrToStringAnsi(source.p_ndi_name);

        Debug.Log($"Sender found: {name}");

        // Recv instantiation
        var opt = new NDIlib.recv_create_v3_t {
            bandwidth            = NDIlib.recv_bandwidth_e.recv_bandwidth_highest,
            color_format         = NDIlib.recv_color_format_e.recv_color_format_fastest,
            source_to_connect_to = source
        };

        _ndiRecv = NDIlib.recv_create_v3(ref opt);
    }
Esempio n. 2
0
            public string header(string key)
            {
                var strptr = mhttp_response_header(handle_, key);

                return(Marshal.PtrToStringAnsi(strptr));
            }