コード例 #1
0
        public bool HwInitialize()
        {
            for (i = 0; i < 4; i++)
            {
                m_hCapDev[i] = 0x00000000;
            }

            for (i = 0; i < 4; i++)
            {
                m_hCloneCapDev[i] = 0x00000000;
            }

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

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

            // CREATE CAPTURE DEVICE
            //
            for (i = 0; i < 4; 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);

            EXPORTS.QCAP_REGISTER_FORMAT_CHANGED_CALLBACK(m_hCapDev[0], m_pFormatChangedCB, 0);

            EXPORTS.QCAP_REGISTER_FORMAT_CHANGED_CALLBACK(m_hCapDev[1], m_pFormatChangedCB, 1);

            EXPORTS.QCAP_REGISTER_FORMAT_CHANGED_CALLBACK(m_hCapDev[2], m_pFormatChangedCB, 2);

            EXPORTS.QCAP_REGISTER_FORMAT_CHANGED_CALLBACK(m_hCapDev[3], m_pFormatChangedCB, 3);

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

            EXPORTS.QCAP_REGISTER_VIDEO_PREVIEW_CALLBACK(m_hCapDev[0], m_pPreviewVideoCB, 0);

            EXPORTS.QCAP_REGISTER_VIDEO_PREVIEW_CALLBACK(m_hCapDev[1], m_pPreviewVideoCB, 1);

            EXPORTS.QCAP_REGISTER_VIDEO_PREVIEW_CALLBACK(m_hCapDev[2], m_pPreviewVideoCB, 2);

            EXPORTS.QCAP_REGISTER_VIDEO_PREVIEW_CALLBACK(m_hCapDev[3], m_pPreviewVideoCB, 3);

            // REGISTER PREVIEW AUDIO CALLBACK FUNCTION
            //
            m_pPreviewAudioCB = new EXPORTS.PF_AUDIO_PREVIEW_CALLBACK(on_process_preview_audio_buffer);

            EXPORTS.QCAP_REGISTER_AUDIO_PREVIEW_CALLBACK(m_hCapDev[0], m_pPreviewAudioCB, 0);

            EXPORTS.QCAP_REGISTER_AUDIO_PREVIEW_CALLBACK(m_hCapDev[1], m_pPreviewAudioCB, 1);

            EXPORTS.QCAP_REGISTER_AUDIO_PREVIEW_CALLBACK(m_hCapDev[2], m_pPreviewAudioCB, 2);

            EXPORTS.QCAP_REGISTER_AUDIO_PREVIEW_CALLBACK(m_hCapDev[3], m_pPreviewAudioCB, 3);

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

            EXPORTS.QCAP_REGISTER_NO_SIGNAL_DETECTED_CALLBACK(m_hCapDev[0], m_pNoSignalDetectedCB, 0);

            EXPORTS.QCAP_REGISTER_NO_SIGNAL_DETECTED_CALLBACK(m_hCapDev[1], m_pNoSignalDetectedCB, 1);

            EXPORTS.QCAP_REGISTER_NO_SIGNAL_DETECTED_CALLBACK(m_hCapDev[2], m_pNoSignalDetectedCB, 2);

            EXPORTS.QCAP_REGISTER_NO_SIGNAL_DETECTED_CALLBACK(m_hCapDev[3], m_pNoSignalDetectedCB, 3);

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

            EXPORTS.QCAP_REGISTER_SIGNAL_REMOVED_CALLBACK(m_hCapDev[0], m_pSignalRemovedCB, 0);

            EXPORTS.QCAP_REGISTER_SIGNAL_REMOVED_CALLBACK(m_hCapDev[1], m_pSignalRemovedCB, 1);

            EXPORTS.QCAP_REGISTER_SIGNAL_REMOVED_CALLBACK(m_hCapDev[2], m_pSignalRemovedCB, 2);

            EXPORTS.QCAP_REGISTER_SIGNAL_REMOVED_CALLBACK(m_hCapDev[3], m_pSignalRemovedCB, 3);

            // SET INPUT
            //
            uint nInput = (uint)EXPORTS.InputVideoSourceEnum.QCAP_INPUT_TYPE_SDI;

            EXPORTS.QCAP_SET_VIDEO_INPUT(m_hCapDev[0], nInput);

            EXPORTS.QCAP_SET_VIDEO_INPUT(m_hCapDev[1], nInput);

            EXPORTS.QCAP_SET_VIDEO_INPUT(m_hCapDev[2], nInput);

            EXPORTS.QCAP_SET_VIDEO_INPUT(m_hCapDev[3], nInput);

            // RUN DEVICE
            //
            EXPORTS.QCAP_SET_VIDEO_DEINTERLACE(m_hCapDev[0], 0);

            EXPORTS.QCAP_SET_VIDEO_DEINTERLACE(m_hCapDev[1], 0);

            EXPORTS.QCAP_SET_VIDEO_DEINTERLACE(m_hCapDev[2], 0);

            EXPORTS.QCAP_SET_VIDEO_DEINTERLACE(m_hCapDev[3], 0);

            EXPORTS.QCAP_RUN(m_hCapDev[0]);

            EXPORTS.QCAP_RUN(m_hCapDev[1]);

            EXPORTS.QCAP_RUN(m_hCapDev[2]);

            EXPORTS.QCAP_RUN(m_hCapDev[3]);

            createSql(4);

            timerCheckSignal.Enabled = true;

            return(true);
        }
コード例 #2
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);
        }
コード例 #3
0
        public void ShowCloneVideo(bool bShow)
        {
            if (bShow)
            {
                m_bShowClone = true;

                if (m_pChannelControl_LIVE[0].Visible == true)
                {
                    CloneChannelPanel1.Visible = true;

                    if (m_hCapDev[0] != 0)
                    {
                        EXPORTS.QCAP_CREATE_CLONE(m_hCapDev[0], (uint)CloneChannelPanel1.Handle.ToInt32(), ref m_hCloneCapDev[0], 1);

                        if (m_hCloneCapDev[0] != 0)
                        {
                            EXPORTS.QCAP_RUN(m_hCloneCapDev[0]);

                            EXPORTS.QCAP_SET_AUDIO_VOLUME(m_hCloneCapDev[0], 0);
                        }
                    }
                }

                if (m_pChannelControl_LIVE[1].Visible == true)
                {
                    CloneChannelPanel2.Visible = true;

                    if (m_hCapDev[1] != 0)
                    {
                        EXPORTS.QCAP_CREATE_CLONE(m_hCapDev[1], (uint)CloneChannelPanel2.Handle.ToInt32(), ref m_hCloneCapDev[1], 1);

                        if (m_hCloneCapDev[1] != 0)
                        {
                            EXPORTS.QCAP_RUN(m_hCloneCapDev[1]);

                            EXPORTS.QCAP_SET_AUDIO_VOLUME(m_hCloneCapDev[1], 0);
                        }
                    }
                }

                if (m_pChannelControl_LIVE[2].Visible == true)
                {
                    CloneChannelPanel3.Visible = true;

                    if (m_hCapDev[2] != 0)
                    {
                        EXPORTS.QCAP_CREATE_CLONE(m_hCapDev[2], (uint)CloneChannelPanel3.Handle.ToInt32(), ref m_hCloneCapDev[2], 1);

                        if (m_hCloneCapDev[2] != 0)
                        {
                            EXPORTS.QCAP_RUN(m_hCloneCapDev[2]);

                            EXPORTS.QCAP_SET_AUDIO_VOLUME(m_hCloneCapDev[2], 0);
                        }
                    }
                }

                if (m_pChannelControl_LIVE[3].Visible == true)
                {
                    CloneChannelPanel4.Visible = true;

                    if (m_hCapDev[3] != 0)
                    {
                        EXPORTS.QCAP_CREATE_CLONE(m_hCapDev[3], (uint)CloneChannelPanel4.Handle.ToInt32(), ref m_hCloneCapDev[3], 1);

                        if (m_hCloneCapDev[3] != 0)
                        {
                            EXPORTS.QCAP_RUN(m_hCloneCapDev[3]);

                            EXPORTS.QCAP_SET_AUDIO_VOLUME(m_hCloneCapDev[3], 0);
                        }
                    }
                }
            }
            else
            {
                m_bShowClone = false;

                if (m_pChannelControl_LIVE[0].Visible == true)
                {
                    CloneChannelPanel1.Visible = false;

                    if (m_hCloneCapDev[0] != 0)
                    {
                        EXPORTS.QCAP_STOP(m_hCloneCapDev[0]); EXPORTS.QCAP_DESTROY(m_hCloneCapDev[0]); m_hCloneCapDev[0] = 0;
                    }
                }

                if (m_pChannelControl_LIVE[1].Visible == true)
                {
                    CloneChannelPanel2.Visible = false;

                    if (m_hCloneCapDev[1] != 0)
                    {
                        EXPORTS.QCAP_STOP(m_hCloneCapDev[1]); EXPORTS.QCAP_DESTROY(m_hCloneCapDev[1]); m_hCloneCapDev[1] = 0;
                    }
                }

                if (m_pChannelControl_LIVE[2].Visible == true)
                {
                    CloneChannelPanel3.Visible = false;

                    if (m_hCloneCapDev[2] != 0)
                    {
                        EXPORTS.QCAP_STOP(m_hCloneCapDev[2]); EXPORTS.QCAP_DESTROY(m_hCloneCapDev[2]); m_hCloneCapDev[2] = 0;
                    }
                }

                if (m_pChannelControl_LIVE[3].Visible == true)
                {
                    CloneChannelPanel4.Visible = false;

                    if (m_hCloneCapDev[3] != 0)
                    {
                        EXPORTS.QCAP_STOP(m_hCloneCapDev[3]); EXPORTS.QCAP_DESTROY(m_hCloneCapDev[3]); m_hCloneCapDev[3] = 0;
                    }
                }
            }
        }