Esempio n. 1
0
        public BlendViewPipe(OeipPipe pipe)
        {
            this.Pipe = pipe;

            InputMain   = pipe.AddLayer("input main", OeipLayerType.OEIP_INPUT_LAYER);
            InputAux    = pipe.AddLayer("input aux", OeipLayerType.OEIP_INPUT_LAYER);
            BlendIndex  = pipe.AddLayer("blend", OeipLayerType.OEIP_BLEND_LAYER);
            OutGpuIndex = pipe.AddLayer("out tex", OeipLayerType.OEIP_OUTPUT_LAYER);
            int rgb2Yuv = pipe.AddLayer("rgba2yuv", OeipLayerType.OEIP_RGBA2YUV_LAYER);

            OutYuvIndex = pipe.AddLayer("out yuv tex", OeipLayerType.OEIP_OUTPUT_LAYER);

            pipe.ConnectLayer(BlendIndex, InputMain, 0, 0);
            pipe.ConnectLayer(BlendIndex, InputAux, 0, 1);
            //混合显示的位置
            blendParamet.rect.centerX = 0.7f;
            blendParamet.rect.centerY = 0.7f;
            blendParamet.rect.width   = 0.5f;
            blendParamet.rect.height  = 0.5f;
            blendParamet.opacity      = 0.0f;
            pipe.UpdateParamet(BlendIndex, blendParamet);
            //要求输入的是显存数据
            InputParamet inParamet = new InputParamet();

            inParamet.bGpu = 1;
            inParamet.bCpu = 0;
            pipe.UpdateParamet(InputMain, inParamet);
            pipe.UpdateParamet(InputAux, inParamet);

            RGBA2YUVParamet yuvParamet = new RGBA2YUVParamet();

            yuvParamet.yuvType = YUVFMT;
            Pipe.UpdateParamet(rgb2Yuv, yuvParamet);
        }
Esempio n. 2
0
        public OeipLivePipe(OeipPipe pipe)
        {
            this.Pipe = pipe;

            //添加输入层
            InputIndex = pipe.AddLayer("input", OeipLayerType.OEIP_INPUT_LAYER);
            Yuv2Rgba   = pipe.AddLayer("yuv2rgba", OeipLayerType.OEIP_YUV2RGBA_LAYER);
            OutIndex   = pipe.AddLayer("out put", OeipLayerType.OEIP_OUTPUT_LAYER);

            OutputParamet outputParamet = new OutputParamet();

            outputParamet.bGpu = IsGpu ? 1 : 0;
            outputParamet.bCpu = 1;
            pipe.UpdateParamet(OutIndex, outputParamet);
        }