Пример #1
0
    /**
     *  @brief Create an instance of the PXCSession interface.
     *  @param[out]	session			The PXCSession instance, to be returned.
     *  @return PXCM_STATUS_NO_ERROR	Successful execution.
     */
    public static PXCMSession CreateInstance()
    {
        IntPtr      session2 = PXCMSession_CreateInstance();
        PXCMSession session  = (session2 != IntPtr.Zero) ? new PXCMSession(session2, true) : null;

        if (session == null)
        {
            return(null);
        }
        try
        {
            PXCMMetadata md = session.QueryInstance <PXCMMetadata>();
            if (md == null)
            {
                return(session);
            }

            string frameworkName = null;
#if PH_CS
            frameworkName = "CSharp";
#elif PH_UNITY
            frameworkName = "Unity";
#endif
            if (!string.IsNullOrEmpty(frameworkName))
            {
                md.AttachBuffer(1296451664, System.Text.Encoding.Unicode.GetBytes(frameworkName));
            }
        }
        catch (Exception) {}
        return(session);
    }
Пример #2
0
 /** 
     @brief Return the module descriptor
     @param[in]  module  The module instance
     @param[out] desc	The module descriptor, to be returned.
     @return PXCM_STATUS_NO_ERROR         Successful execution.
     @return PXCM_STATUS_ITEM_UNAVAILABLE Failed to identify the module instance.
 */
 public pxcmStatus QueryModuleDesc(PXCMBase module, out PXCMSession.ImplDesc desc)
 {
     desc = new PXCMSession.ImplDesc();
     return PXCMSession_QueryModuleDesc(instance, module.instance, desc);
 }
Пример #3
0
 internal static extern pxcmStatus PXCMSenseManager_EnableModule(IntPtr putil, Int32 mid, PXCMSession.ImplDesc mdesc);
Пример #4
0
 /**
     @brief	Enable a module in the pipeline.
     @param[in] mid					The module identifier. This is usually the interface identifier.
     @param[in] mdesc				The module descriptor.
     @return PXCM_STATUS_NO_ERROR	Successful execution.
 */
 public pxcmStatus EnableModule(Int32 mid, PXCMSession.ImplDesc mdesc)
 {
     return PXCMSenseManager_EnableModule(instance, mid, mdesc);
 }
Пример #5
0
 private pxcmStatus OnCreateDevice(PXCMSession.ImplDesc desc, IntPtr device)
 {
     PXCMCapture.Device device2 = new PXCMCapture.Device(device, false);
     return handler.onCreateDevice(desc, device2);
 }