예제 #1
0
파일: CameraControl.cs 프로젝트: kbitc/oeip
        public void SetFormat(int index)
        {
            var selectFormat = camera.VideoFormats[index];

            Format = selectFormat;
            VideoPipe.SetVideoFormat(selectFormat.videoType, selectFormat.width, selectFormat.height);
            cbx_formatList.SelectedIndex = index;
            camera.SetFormat(index);
            camera.Open();

            displayDx11.Visible = VideoPipe.IsGpu;
            displayWF.Visible   = !VideoPipe.IsGpu;
            displayWF.Dock      = DockStyle.Fill;
            displayDx11.Dock    = DockStyle.Fill;
            displayDx11.NativeLoad(VideoPipe, selectFormat);
        }
예제 #2
0
파일: CameraView.cs 프로젝트: kbitc/oeip
    /// <summary>
    /// 设定摄像机的输出格式
    /// </summary>
    /// <param name="index"></param>
    private void SetFormat(int index)
    {
        selectFormat = oeipCamera.VideoFormats[index];
        //设定处理图像格式,图像宽度,图像长度
        VideoPipe.SetVideoFormat(selectFormat.videoType, selectFormat.width, selectFormat.height);

        oeipCamera.SetFormat(index);
        oeipCamera.Open();

        if (SourceTex == null || SourceTex.width != selectFormat.width || SourceTex.height != selectFormat.height)
        {
            SourceTex = new Texture2D(selectFormat.width, selectFormat.height, TextureFormat.RGBA32, false);
            SourceTex.Apply();
            //Unity 纹理作为输出
            cameraPipe.SetPipeOutputGpuTex(VideoPipe.OutGpuIndex, SourceTex.GetNativeTexturePtr());
        }
    }