// Start is called before the first frame update void Awake() { pipe = OeipManager.Instance.CreatePipe <OeipPipe3D>(OeipGpgpuType.OEIP_CUDA); InputIndex = pipe.AddLayer("input", OeipLayerType.OEIP_INPUT_LAYER); int mapIndex = pipe.AddLayer("map", OeipLayerType.OEIP_MAPCHANNEL_LAYER); int r2y = pipe.AddLayer("rgba2yuv", OeipLayerType.OEIP_RGBA2YUV_LAYER); OutputIndex = pipe.AddLayer("output", OeipLayerType.OEIP_OUTPUT_LAYER); InputParamet input = new InputParamet(); input.bCpu = 0; input.bGpu = 1; pipe.UpdateParamet(InputIndex, input); if (pipe.GpgpuType == OeipGpgpuType.OEIP_CUDA) { MapChannelParamet mp = new MapChannelParamet(); mp.blue = 0; mp.green = 1; mp.red = 2; mp.alpha = 3; pipe.UpdateParamet(mapIndex, mp); } RGBA2YUVParamet rp = new RGBA2YUVParamet(); rp.yuvType = yUVFMT; pipe.UpdateParamet(r2y, rp); OutputParamet op = new OutputParamet(); op.bCpu = 1; op.bGpu = 0; pipe.UpdateParamet(OutputIndex, op); }
void Awake() { pipe = OeipManager.Instance.CreatePipe <OeipPipe3D>(OeipGpgpuType.OEIP_CUDA); LivePipe = new OeipLivePipe(pipe); //显示 LivePipe.OnLiveImageChange += LivePipe_OnLiveImageChange; OeipLiveManager.Instance.OnVideoFrameEvent += Instance_OnVideoFrameEvent; Loom.QueueOnMainThread(() => { Debug.Log("init loom."); }); }
private void Awake() { //创建一个管线 cameraPipe = OeipManager.Instance.CreatePipe <OeipPipe3D>(OeipGpgpuType.OEIP_CUDA); //生成一个视频渲染管线 VideoPipe = new OeipVideoPipe(cameraPipe); VideoPipe.SetOutput(false, true); //生成一个摄像机处理类 oeipCamera = new OeipCamera(); oeipCamera.OnReviceEvent += OeipCamera_OnReviceEvent; }