public override bool Process(GstMultipleNetworkPlayer player) { Vector2 sz = new Vector2(player.FrameSize.x / 2, player.FrameSize.y); if (_inited && CheckResized(sz)) { _inited = false; _ovr.Close(); } if (_inited == false) { _init(sz); } if (!_inited) { return(false); } if (_ready) { _ovr.BlitCameraImage(_textures [0].GetNativeTexturePtr(), _textures [1].GetNativeTexturePtr()); _ready = false; } if (!_processorThread.Processing) { _ptr = player.CopyTextureData(null, 0); _processorThread.signal.Set(); } return(true); }
void _updateTextures() { if (_inited && !_texturesUpdated) { for (int i = 0; i < 2; ++i) { _textures [i] = new Texture2D(_ovr.imageSizeW, _ovr.imageSizeH, TextureFormat.BGRA32, false); _textures [i].wrapMode = TextureWrapMode.Clamp; _textures [i].Apply(); _texturesPtr[i] = _textures [i].GetNativeTexturePtr(); } _texturesUpdated = true; } if (_ready) { ReleaseTexturePtr(); _ovr.BlitCameraImage(_texturesPtr [0], _texturesPtr [1]); _ready = false; } }