Пример #1
0
        //初始化
        public bool HwInitialize()
        {
            for (i = 0; i < n; i++)
            {
                m_hCapDev[i] = 0x00000000;
            }

            for (i = 0; i < n; i++)
            {
                m_bNoSignal[i] = true;
            }

            for (i = 0; i < n; i++)
            {
                m_strFormatChangedOutput[i] = "";
            }

            // CREATE CAPTURE DEVICE
            //
            for (i = 0; i < n; i++)
            {
                string str_chip_name = m_strChipName;

                EXPORTS.QCAP_CREATE(ref str_chip_name, i, (uint)m_pChannelControl_LIVE[i].Handle.ToInt32(), ref m_hCapDev[i], 1);
            }

            // REGISTER FORMAT CHANGED CALLBACK FUNCTION
            //
            m_pFormatChangedCB = new EXPORTS.PF_FORMAT_CHANGED_CALLBACK(on_process_format_changed);
            //修改后
            for (i = 0; i < n; i++)
            {
                EXPORTS.QCAP_REGISTER_FORMAT_CHANGED_CALLBACK(m_hCapDev[i], m_pFormatChangedCB, i);
            }

            // REGISTER PREVIEW VIDEO CALLBACK FUNCTION
            //
            m_pPreviewVideoCB = new EXPORTS.PF_VIDEO_PREVIEW_CALLBACK(on_process_preview_video_buffer);

            for (i = 0; i < n; i++)
            {
                EXPORTS.QCAP_REGISTER_VIDEO_PREVIEW_CALLBACK(m_hCapDev[i], m_pPreviewVideoCB, i);
            }


            // REGISTER NO SIGNAL DETECTED CALLBACK FUNCTION
            //
            m_pNoSignalDetectedCB = new EXPORTS.PF_NO_SIGNAL_DETECTED_CALLBACK(on_process_no_signal_detected);

            for (i = 0; i < n; i++)
            {
                EXPORTS.QCAP_REGISTER_NO_SIGNAL_DETECTED_CALLBACK(m_hCapDev[i], m_pNoSignalDetectedCB, i);
            }

            // REGISTER SIGNAL REMOVED CALLBACK FUNCTION
            //
            m_pSignalRemovedCB = new EXPORTS.PF_SIGNAL_REMOVED_CALLBACK(on_process_signal_removed);

            for (i = 0; i < n; i++)
            {
                EXPORTS.QCAP_REGISTER_SIGNAL_REMOVED_CALLBACK(m_hCapDev[i], m_pSignalRemovedCB, i);
            }

            // SET INPUT
            //
            for (i = 0; i < n; i++)
            {
                EXPORTS.QCAP_SET_VIDEO_INPUT(m_hCapDev[i], 0x00);
            }

            // RUN DEVICE
            //
            for (i = 0; i < n; i++)
            {
                EXPORTS.QCAP_SET_VIDEO_DEINTERLACE(m_hCapDev[i], 0);
            }

            for (i = 0; i < n; i++)
            {
                EXPORTS.QCAP_SET_VIDEO_STANDARD(m_hCapDev[i], 0x10);
            }

            for (i = 0; i < n; i++)
            {
                EXPORTS.QCAP_RUN(m_hCapDev[i]);
            }


            for (i = 0; i < n; i++)
            {
                b_bitmap[i] = false;
            }

            for (i = 0; i < n; i++)
            {
                b_bitmapchose[i] = new object();
            }

            createSql(n);

            timerCheckSignal.Enabled = true;

            return(true);
        }